ESLint crashes when there's a query with an Object Type field without a selection.
Schema:
type MyObjectType {
id: ID!
someField: String
}
type Query {
fieldName: MyObjectType
}
Query:
{
fieldName
}
Intended Outcome
Ideally:
[eslint] Field "fieldName" must have a selection since type "MyObjectType" is a GraphQL Object Type.
Actual Outcome
Cannot read property 'selections' of undefined
TypeError: Cannot read property 'selections' of undefined
at getFieldWasRequestedOnNode (/[...]/node_modules/eslint-plugin-graphql/lib/rules.js:26:28)
at /[...]/node_modules/eslint-plugin-graphql/lib/rules.js:60:35
at Array.forEach (<anonymous>)
[...]
ESLint crashes when there's a query with an Object Type field without a selection.
Schema:
Query:
Intended Outcome
Ideally:
Actual Outcome
Version of eslint-plugin-graphql used: 2.1.1.
Issue Labels