GraphQL Custom Resolver - Document Parent Type Context

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

Found the documentation :slight_smile:

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.