Skip to content

Declare fieldNodes always has at least 1 FieldNode - #3504

Open
mattkrick wants to merge 3 commits into
graphql:17.x.x-before-rebase-on-16.x.xfrom
mattkrick:patch-1
Open

mattkrick wants to merge 3 commits into
graphql:17.x.x-before-rebase-on-16.x.xfrom
mattkrick:patch-1

Conversation

@mattkrick

Copy link
Copy Markdown
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

linux-foundation-easycla Bot commented Feb 17, 2022 •

Copy link
Copy Markdown

CLA Signed

The committers are authorized under a signed CLA.

@github-actions

Copy link
Copy Markdown

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

@Ramifaria1984 Ramifaria1984 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

  • @ #

This branch has not been deployed

No deployments
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