Hello,
My issue is the subfield requires what arguments was sent to parent.
How would I do this?
Is this even possible?
query:
manypersons(page: 1, size: 100, letter: "A", activeState: true){
letters >>>>>>> returns paginated A-Z by firstname. but i had this resolve on demand because not all use cases needed it resolved. But i need to know what the activeState is so I know what letters to return
items{ >>>>>>> resolved on DB call
firstname
lastname
}
}
You can't access parent arguments directly from a child resolver, but you can access variables. ResolveFieldContext.Variables
https://graphql-dotnet.github.io/docs/getting-started/variables
So its either i use variables or resolve on my services layer (where it formats to return a dto).
thank you.
Most helpful comment
You can't access parent arguments directly from a child resolver, but you can access variables.
ResolveFieldContext.Variableshttps://graphql-dotnet.github.io/docs/getting-started/variables