0
Fork 0
mirror of https://github.com/TanStack/query.git synced 2026-11-16 22:50:20 +00:00
query/docs/framework/angular/guides/dependent-queries.md
2024-01-26 14:31:25 +11:00

697 B

id title ref replace
dependent-queries Dependent Queries docs/framework/react/guides/dependent-queries.md
useQuery useQueries
injectQuery 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