Skip to content

Constructor field in fragments seems to throw TypeError: nodeAndDefs[responseName].push is not a function #850

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

Closed
FlyersWeb opened this issue May 14, 2017 · 1 comment

Comments

@FlyersWeb
Copy link

When I try to query a GraphQL server with a GraphQLObject having a constructor field I get the error TypeError: nodeAndDefs[responseName].push is not a function

Intended outcome

Server should not throw error

Actual outcome

TypeError: nodeAndDefs[responseName].push is not a function

How to reproduce

Create a GraphQL object with a constructor field

    new GraphQLObjectType({
        name : 'FooType',
        fields : {
            ['constructor'] : {
                type : new GraphQLNonNull(GraphQLString)
            },
        }
    })

The query associated:

query dummyQuery {
      ...subscriptionInfo
      __typename
}
fragment subscriptionInfo on SubscriptionType {
  constructor
  __typename
}

Let me know if you need more insights

@FlyersWeb
Copy link
Author

referenced by apollographql/apollo-server#387

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

2 participants