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

Declare fieldNodes always has at least 1 FieldNode #3504

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

mattkrick
Copy link
Contributor

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.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Feb 17, 2022

CLA Signed

The committers are authorized under a signed CLA.

@github-actions
Copy link

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

Copy link

@Ramifaria1984 Ramifaria1984 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • @ #

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

Successfully merging this pull request may close these issues.

2 participants