Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Projection resolution failing #13

Open
martinjuhasz opened this issue Jun 23, 2016 · 0 comments
Open

Projection resolution failing #13

martinjuhasz opened this issue Jun 23, 2016 · 0 comments

Comments

@martinjuhasz
Copy link

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) => {})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant