snapshot of https://github.com/TanStack/query.git (main, 2026-09-16; blobs > 131072B omitted)
This commit is contained in:
33
docs/framework/angular/guides/dependent-queries.md
Normal file
33
docs/framework/angular/guides/dependent-queries.md
Normal file
@@ -0,0 +1,33 @@
|
||||
---
|
||||
id: dependent-queries
|
||||
title: Dependent Queries
|
||||
ref: docs/framework/react/guides/dependent-queries.md
|
||||
replace: { 'useQuery': 'injectQuery', 'useQueries': 'injectQueries' }
|
||||
---
|
||||
|
||||
[//]: # 'Example'
|
||||
|
||||
```ts
|
||||
// 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,
|
||||
}))
|
||||
```
|
||||
|
||||
[//]: # 'Example'
|
||||
[//]: # 'Example2'
|
||||
|
||||
```ts
|
||||
// injectQueries is under development for Angular Query
|
||||
```
|
||||
|
||||
[//]: # 'Example2'
|
||||
Reference in New Issue
Block a user