Skip to content

Projection resolution failing #13

@martinjuhasz

Description

@martinjuhasz

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions