-
Notifications
You must be signed in to change notification settings - Fork 95
Description
I tried implementing GraphQL schemas using your sample code.
You use the resolve method on a GraphQLObjectType with the following parameters: root, {id}, source, fieldASTs.
Your fieldASTs object seems to be a list containing the selectionSet that you reduce to map them to the wanted projections. Anyway when using the current version of graphql-js the object that gets returend to me is an array (atm it includes only one element) that then includes a list with the wanted selectionSet.
Any idea if this has changed and your code uses and older version or if i'm missing something? I don't get why it's an array with a single element. My current solution which works but seem's just not right:
return syntaxTree.fieldASTs[0].selectionSet.selections.reduce((projections, selection) => {})