Hi I’m trying to create a custom GraphQL resolver where the parent type is a document type, and the function needs the context of the parent document to calculate the output.
Here’s a simple example of the type of thing I’m expecting to be able to achieve:
Custom Resolver:
GraphQL Field Name: fullName
Parent Type: user
Function: code concatenates user.firstName and user.lastName
Query:
query {
user {
_id
fullName
}
}
How can I get the context of the parent user document inside the function?
Thanks