graphql-js
graphql-js copied to clipboard
Declare fieldNodes always has at least 1 FieldNode
fieldNodes will never be an empty array.
// Before
const node = info.fieldNodes[0] // undefined | FieldNode
// After
const node = info.fieldNodes[0] // FieldNode
This is helpful when noUncheckedIndexAccess is turned on.
The committers are authorized under a signed CLA.
- :white_check_mark: Matt Krick (c61e65575380a087ee8c17496e65c29a9135d742)
The latest changes of this PR are available on NPM as graphql@16.3.0-canary.pr.3504.7c7b6ed1e17e6cf5e114f1a89a24d289fb969aff Note: no gurantees provided so please use your own discretion.
Also you can depend on latest version built from this PR:
npm install --save graphql@canary-pr-3504