697 B
697 B
id, title, ref, replace
| id | title | ref | replace | ||||
|---|---|---|---|---|---|---|---|
| dependent-queries | Dependent Queries | docs/framework/react/guides/dependent-queries.md |
|
// 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