Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
|
raw
history blame
697 Bytes
metadata
id: dependent-queries
title: Dependent Queries
ref: docs/framework/react/guides/dependent-queries.md
replace:
  useQuery: injectQuery
  useQueries: injectQueries
// Get the user
userQuery = injectQuery(() => ({
  queryKey: ['user', email],
  queryFn: getUserByEmail,
}))

// Then get the user's projects
projectsQuery = injectQuery(() => ({
  queryKey: ['projects', this.userQuery.data()?.id],
  queryFn: getProjectsByUser,
  // The query will not execute until the user id exists
  enabled: !!this.userQuery.data()?.id,
}))
// injectQueries is under development for Angular Query