Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Prevent Infinite Loop in OverlappingFieldsCanBeMergedRule #3442

Merged
merged 5 commits into from
Jan 5, 2022
Merged

Prevent Infinite Loop in OverlappingFieldsCanBeMergedRule #3442

merged 5 commits into from
Jan 5, 2022

Conversation

nicolaslt
Copy link
Contributor

We have spotted some RangeError: Maximum call stack size exceeded exceptions while testing our own setup, and traced it to this validation rule.

Note: I don't feel 100% confident that I understand the logic flow and intent of this code in detail. Perhaps the bugfix I'm providing is isolated, or perhaps it's a whole class of use case that has been omitted in tests in which cases this might break some valid use cases but not be detected?

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Dec 24, 2021

CLA Signed

The committers are authorized under a signed CLA.

@Cito
Copy link
Member

Cito commented Dec 24, 2021

Great find - important to fix this! The proposed solution looks good to me.

@nicolaslt
Copy link
Contributor Author

@Cito I've just realised the error still happens when the cyclical reference is transitive. I'm going to try to fix this as well within the next 3h, but I will have limited availability after that until the 4th of January.

@Cito
Copy link
Member

Cito commented Dec 24, 2021

@nicolaslt The algorithm is a bit complex. Will try to examine the issue more thoroughly and compare the validation algorithm with the spec where it looks simpler.

@nicolaslt
Copy link
Contributor Author

I've worked out that we might be able to simple re-use comparedFragmentPairs, if we extend its scope to keep track of fields as well as fragment (in which case I'd rename it, eh).

The only reason I can think of not to do that is if it's valid to have a field named after a fragment. I'm on my way to test this.

@nicolaslt
Copy link
Contributor Author

nicolaslt commented Dec 24, 2021

Yep, it's valid GraphQL it seems! (though tested with version 15.2.0, not with latest)

Schema:

type Query {                      
  getObject: Object               
}                                 

type Object {        
  field: Boolean     
  otherField: Boolean
}

Query:

query myQuery {
  getObject {
    ...field
    field
  }
}
                          
fragment field on Object {
   otherField             
}

Results (with a dummy resolver):

{
  "data": {
    "getObject": {
      "otherField": null,
      "field": null
    }
  }
}

So the proper fix I think would be to use comparedFragmentPairs and make getReferencedFieldsAndFragmentNames return type something that lets line 270 realise when the fieldOrFragmentName is actually a fragment or a field. If it's a fragment, read&write to comparedFragmentPairs, if it's a field carry on as usual.

@nicolaslt
Copy link
Contributor Author

I'm starting to understand the codebase a bit better. I think just using comparedFragmentPairs is actually ok.

I'm about to push a new version with extra tests added for good measure.

@nicolaslt
Copy link
Contributor Author

@Cito I think this is ready again

@Cito
Copy link
Member

Cito commented Dec 24, 2021

@nicolaslt Thanks - will look into this after the festivities.

@Cito
Copy link
Member

Cito commented Dec 25, 2021

@nicolaslt Had another look and I think breaking the recursion in collect_conflicts_between_fields_and_fragment like you do here is the proper solution. Nice!

Still, I wonder whether the validation algorithm could be simplified and made less complex, in terms of code and runtime complexity, which is quadratic in both number of fields in the selection sets, and in the levels of nested fragments. This might be exploited for denial of service attacks, by sending requests with many overlapping fields and/or deeply nested fragments - if you do both, you can construct queries that are not too large, but still would take an extremely long time to validate. However, this is essentially the algorithm from the spec, just a bit more complicated because it also provides a list of error messages for the individual conflicts.

Instead of iterating over all pairs of fields in a selection set, one could to the following: First, initialize an empty "MergedResponseShape". Then Iterate through all fields in the selection set, and create the ResponseShape for the field. If it is not compatible with the MergedResponseShape, report an error. Otherwise extend the MergedResponseShape and continue.

@Cito
Copy link
Member

Cito commented Dec 26, 2021

Oops - just noticed that regarding the runtime complexity of the algorithm, we already have #2185.

@nicolaslt
Copy link
Contributor Author

Yeah, I didn't spot that other PR but it did feel like the implementation could be improved.

What's next for both PRs? Should we port all missing tests (if any) to the other PR, or merge mine in the interim?

@Cito
Copy link
Member

Cito commented Dec 26, 2021

I think we should merge this PR to fix the immediate problem and to have the additional tests until we change the implementation as suggested in #2185.

@nicolaslt
Copy link
Contributor Author

nicolaslt commented Dec 26, 2021 via email

@nicolaslt
Copy link
Contributor Author

Hi all, is there any ETA for when this could be merged/released?

I'm quite eager to patch my servers.

@dotansimha
Copy link
Member

@IvanGoncharov any thoughts before merging this one?

@IvanGoncharov IvanGoncharov added the PR: bug fix 🐞 requires increase of "patch" version number label Jan 5, 2022
@IvanGoncharov IvanGoncharov merged commit 4175b26 into graphql:main Jan 5, 2022
@IvanGoncharov
Copy link
Member

@nicolaslt Thanks for contributing this fix 👍
I did some small tweaks in the tests before merging it.

@Cito Big thanks for the excellent review!

@nicolaslt
Copy link
Contributor Author

Nice, thanks @IvanGoncharov.

Would you have an estimate on when this would be released?

cbush pushed a commit to mongodb/docs-realm that referenced this pull request Mar 6, 2023
<h3>Snyk has created this PR to upgrade graphql from 16.3.0 to
16.6.0.</h3>

:information_source: Keep your dependencies up-to-date. This makes it
easier to fix existing vulnerabilities and to more quickly identify and
fix newly disclosed vulnerabilities when they affect your project.
<hr/>

- The recommended version is **5 versions** ahead of your current
version.
- The recommended version was released **6 months ago**, on 2022-08-16.


<details>
<summary><b>Release notes</b></summary>
<br/>
  <details>
    <summary>Package name: <b>graphql</b></summary>
    <ul>
      <li>
<b>16.6.0</b> - <a
href="https://snyk.io/redirect/github/graphql/graphql-js/releases/tag/v16.6.0">2022-08-16</a></br><h2>v16.6.0
(2022-08-16)</h2>
<h4>New Feature <g-emoji class="g-emoji" alias="rocket"
fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f680.png">🚀</g-emoji></h4>
<ul>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3645"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3645/hovercard">#3645</a>
createSourceEventStream: introduce named arguments and deprecate
positional arguments (<a
href="https://snyk.io/redirect/github/yaacovCR">@ yaacovCR</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3702"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3702/hovercard">#3702</a>
parser: limit maximum number of tokens (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
</ul>
<h4>Bug Fix <g-emoji class="g-emoji" alias="lady_beetle"
fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f41e.png">🐞</g-emoji></h4>
<ul>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3686"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3686/hovercard">#3686</a>
Workaround for codesandbox having bug with TS enums (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3701"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3701/hovercard">#3701</a>
Parser: allow 'options' to explicitly accept undefined (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
</ul>
<h4>Committers: 2</h4>
<ul>
<li>Ivan Goncharov(<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li>Yaacov Rydzinski (<a
href="https://snyk.io/redirect/github/yaacovCR">@ yaacovCR</a>)</li>
</ul>
      </li>
      <li>
<b>16.5.0</b> - <a
href="https://snyk.io/redirect/github/graphql/graphql-js/releases/tag/v16.5.0">2022-05-09</a></br><h2>v16.5.0
(2022-05-09)</h2>
<h4>New Feature <g-emoji class="g-emoji" alias="rocket"
fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f680.png">🚀</g-emoji></h4>
<ul>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3565"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3565/hovercard">#3565</a>
Expose GraphQLErrorOptions type (<a aria-label="Pull request #3554"
class="issue-link js-issue-link" data-error-text="Failed to load title"
data-id="1223840320" data-permission-text="Title is private"
data-url="graphql/graphql-js#3554"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3554/hovercard"
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3554">#3554</a>)
(<a href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
</ul>
<h4>Committers: 1</h4>
<ul>
<li>Ivan Goncharov(<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
</ul>
      </li>
      <li>
<b>16.5.0-canary.pr.3686.d9ad8e3fd58929d38deea522d794a6b22d3244b5</b> -
2022-08-02
      </li>
      <li>
<b>16.4.0</b> - <a
href="https://snyk.io/redirect/github/graphql/graphql-js/releases/tag/v16.4.0">2022-04-25</a></br><h2>v16.4.0
(2022-04-25)</h2>
<h4>New Feature <g-emoji class="g-emoji" alias="rocket"
fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f680.png">🚀</g-emoji></h4>
<ul>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3465"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3465/hovercard">#3465</a>
refactor: use object for GraphQLError constructor (<a
href="https://snyk.io/redirect/github/n1ru4l">@ n1ru4l</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3487"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3487/hovercard">#3487</a>
feat: expose getArgumentValues (<a
href="https://snyk.io/redirect/github/saihaj">@ saihaj</a>)</li>
</ul>
<h4>Bug Fix <g-emoji class="g-emoji" alias="lady_beetle"
fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f41e.png">🐞</g-emoji></h4>
<ul>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3514"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3514/hovercard">#3514</a>
GraphQLError: switch constructor overload order (<a
href="https://snyk.io/redirect/github/glasser">@ glasser</a>)</li>
</ul>
<h4>Docs <g-emoji class="g-emoji" alias="memo"
fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f4dd.png">📝</g-emoji></h4>
<details>
<summary> 2 PRs were merged </summary>
<ul>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3505"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3505/hovercard">#3505</a>
correct outdated documentation (<a
href="https://snyk.io/redirect/github/Ginhing">@ Ginhing</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3512"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3512/hovercard">#3512</a>
Update documentation on deprecated formatError(..) (<a
href="https://snyk.io/redirect/github/dwelch2344">@ dwelch2344</a>)</li>
</ul>
</details>
<h4>Polish <g-emoji class="g-emoji" alias="nail_care"
fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f485.png">💅</g-emoji></h4>
<details>
<summary> 3 PRs were merged </summary>
<ul>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3522"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3522/hovercard">#3522</a>
tests(execution): add missing new lines (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3524"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3524/hovercard">#3524</a>
tests(printSchema): test omitting schema of common names (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3537"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3537/hovercard">#3537</a>
ESLint: disallow using node globals in src/tests (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
</ul>
</details>
<h4>Internal <g-emoji class="g-emoji" alias="house"
fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f3e0.png">🏠</g-emoji></h4>
<details>
<summary> 26 PRs were merged </summary>
<ul>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3468"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3468/hovercard">#3468</a>
ci: add stub action for canary releases on PRs (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3470"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3470/hovercard">#3470</a>
ci: implement canary releases on PRs (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3472"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3472/hovercard">#3472</a>
ci: remove NPM caching on canary release script (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3473"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3473/hovercard">#3473</a>
ci: Pass 'GITHUB_TOKEN' to GitHub CLI (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3475"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3475/hovercard">#3475</a>
ci: checkout repo in canary workflow (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3477"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3477/hovercard">#3477</a>
ci: fix &amp; cleanup script for modifying NPM package into canary (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3479"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3479/hovercard">#3479</a>
ci: Add missing require to canary script (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3481"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3481/hovercard">#3481</a>
ci: fix missing PR number in canary release workflow (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3483"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3483/hovercard">#3483</a>
ci: fix missing PR number in canary release workflow (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3484"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3484/hovercard">#3484</a>
ci: Moving GH Action template syntax to env variables (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3486"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3486/hovercard">#3486</a>
ci: improve comment on canary releases (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3488"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3488/hovercard">#3488</a>
ci: Extract branch publishing into separate workflow (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3489"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3489/hovercard">#3489</a>
ci: use '.node-version' file to configure node version used for CI (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3491"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3491/hovercard">#3491</a>
ci: use separate workflows for 'push' and 'pull_request' (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3493"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3493/hovercard">#3493</a>
ci: remove unused 'workflow_id' input (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3496"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3496/hovercard">#3496</a>
ci: fix deprecation of canary package (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3497"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3497/hovercard">#3497</a>
ci: use environments to track deployments (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3502"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3502/hovercard">#3502</a>
ci: fix deployments of npm &amp; deno branches (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3503"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3503/hovercard">#3503</a>
ci: Add '@ github-actions' bot (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3523"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3523/hovercard">#3523</a>
github-actions-bot: replace 'octokit/request-action' action (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3525"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3525/hovercard">#3525</a>
github-actions-bot: Fix collapsing of unrelated comments (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3530"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3530/hovercard">#3530</a>
integrationTests/node: fix crash on Mac with M1 by using docker (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3534"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3534/hovercard">#3534</a>
github-actions-bot: fix publishing of canary releases (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3536"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3536/hovercard">#3536</a>
github-actions-bot: fix usage of NPM_CANARY_PR_PUBLISH_TOKEN (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3538"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3538/hovercard">#3538</a>
github-actions-bot: fix reply on commands (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3543"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3543/hovercard">#3543</a>
pass valid value to codecov config (<a
href="https://snyk.io/redirect/github/is2ei">@ is2ei</a>)</li>
</ul>
</details>
<h4>Dependency <g-emoji class="g-emoji" alias="package"
fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f4e6.png">📦</g-emoji></h4>
<details>
<summary> 2 PRs were merged </summary>
<ul>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3485"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3485/hovercard">#3485</a>
Update deps (<a href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3533"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3533/hovercard">#3533</a>
Update deps (<a href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
</ul>
</details>
<h4>Committers: 7</h4>
<ul>
<li>David Glasser(<a href="https://snyk.io/redirect/github/glasser">@
glasser</a>)</li>
<li>David Welch(<a href="https://snyk.io/redirect/github/dwelch2344">@
dwelch2344</a>)</li>
<li>Ginhing(<a href="https://snyk.io/redirect/github/Ginhing">@
Ginhing</a>)</li>
<li>Horie Issei(<a href="https://snyk.io/redirect/github/is2ei">@
is2ei</a>)</li>
<li>Ivan Goncharov(<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li>Laurin Quast(<a href="https://snyk.io/redirect/github/n1ru4l">@
n1ru4l</a>)</li>
<li>Saihajpreet Singh(<a href="https://snyk.io/redirect/github/saihaj">@
saihaj</a>)</li>
</ul>
      </li>
      <li>
<b>16.4.0-canary.pr.2839.e3a8069cfaa6406186314b62aced6487f417a2e6</b> -
2022-04-27
      </li>
      <li>
<b>16.3.0</b> - <a
href="https://snyk.io/redirect/github/graphql/graphql-js/releases/tag/v16.3.0">2022-01-26</a></br><h2>v16.3.0
(2022-01-26)</h2>
<h4>New Feature <g-emoji class="g-emoji" alias="rocket"
fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f680.png">🚀</g-emoji></h4>
<ul>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3454"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3454/hovercard">#3454</a>
feat: allow providing an object to the GraphQLError constructor (<a
href="https://snyk.io/redirect/github/n1ru4l">@ n1ru4l</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3464"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3464/hovercard">#3464</a>
Expose <code>getArgumentValues</code> as public API (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
</ul>
<h4>Bug Fix <g-emoji class="g-emoji" alias="lady_beetle"
fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f41e.png">🐞</g-emoji></h4>
<ul>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3442"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3442/hovercard">#3442</a>
Prevent Infinite Loop in OverlappingFieldsCanBeMergedRule (<a
href="https://snyk.io/redirect/github/nicolaslt">@ nicolaslt</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3455"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3455/hovercard">#3455</a>
OverlappingFieldsCanBeMerged: sort argument values before comparing (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
</ul>
<h4>Docs <g-emoji class="g-emoji" alias="memo"
fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f4dd.png">📝</g-emoji></h4>
<details>
<summary> 2 PRs were merged </summary>
<ul>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3269"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3269/hovercard">#3269</a>
feat: setup docs site (<a
href="https://snyk.io/redirect/github/saihaj">@ saihaj</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3437"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3437/hovercard">#3437</a>
CONTRIBUTING.md: remove reference to Facebook bug bounty program (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
</ul>
</details>
<h4>Polish <g-emoji class="g-emoji" alias="nail_care"
fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f485.png">💅</g-emoji></h4>
<details>
<summary> 7 PRs were merged </summary>
<ul>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3441"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3441/hovercard">#3441</a>
UniqueArgumentDefinitionNamesRule: Improve tests (<a
href="https://snyk.io/redirect/github/Cito">@ Cito</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3446"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3446/hovercard">#3446</a>
Use 'eslint-plugin-simple-import-sort' to sort imports (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3447"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3447/hovercard">#3447</a>
Fix index.ts files to be compatible with Typedoc (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3452"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3452/hovercard">#3452</a>
validation-test.ts: various grammar fixes (<a
href="https://snyk.io/redirect/github/spawnia">@ spawnia</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3457"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3457/hovercard">#3457</a>
OverlappingFieldsCanBeMergedRule: simplify argument comparison (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3459"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3459/hovercard">#3459</a>
blockString-tests: remove duplicate test, fix grammar (<a
href="https://snyk.io/redirect/github/Cito">@ Cito</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3461"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3461/hovercard">#3461</a>
visit: simplify handling of root node (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
</ul>
</details>
<h4>Internal <g-emoji class="g-emoji" alias="house"
fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f3e0.png">🏠</g-emoji></h4>
<details>
<summary> 5 PRs were merged </summary>
<ul>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3433"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3433/hovercard">#3433</a>
gh/actions: refactor out action to deploy branches (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3434"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3434/hovercard">#3434</a>
gh/actions: remove 'npm dedupe' check since it unexpectadly do update
(<a href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3435"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3435/hovercard">#3435</a>
gh/actions: run benchmark &amp; diff-npm-package only on PRs (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3436"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3436/hovercard">#3436</a>
gh/actions: make all cloned repo read-only (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3443"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3443/hovercard">#3443</a>
ci/checkPackageLock: update only package-lock.json (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
</ul>
</details>
<h4>Dependency <g-emoji class="g-emoji" alias="package"
fallback-src="https://github.githubassets.com/images/icons/emoji/unicode/1f4e6.png">📦</g-emoji></h4>
<details>
<summary> 4 PRs were merged </summary>
<ul>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3438"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3438/hovercard">#3438</a>
Update deps (<a href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3444"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3444/hovercard">#3444</a>
Update deps (<a href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3462"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3462/hovercard">#3462</a>
Update deps (<a href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/pull/3463"
data-hovercard-type="pull_request"
data-hovercard-url="/graphql/graphql-js/pull/3463/hovercard">#3463</a>
Update deps + fix 'npm audit' (<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
</ul>
</details>
<h4>Committers: 6</h4>
<ul>
<li>Benedikt Franke(<a href="https://snyk.io/redirect/github/spawnia">@
spawnia</a>)</li>
<li>Christoph Zwerschke(<a href="https://snyk.io/redirect/github/Cito">@
Cito</a>)</li>
<li>Ivan Goncharov(<a
href="https://snyk.io/redirect/github/IvanGoncharov">@
IvanGoncharov</a>)</li>
<li>Laurin Quast(<a href="https://snyk.io/redirect/github/n1ru4l">@
n1ru4l</a>)</li>
<li>Nicolas Lagoutte(<a
href="https://snyk.io/redirect/github/nicolaslt">@ nicolaslt</a>)</li>
<li>Saihajpreet Singh(<a href="https://snyk.io/redirect/github/saihaj">@
saihaj</a>)</li>
</ul>
      </li>
    </ul>
from <a
href="https://snyk.io/redirect/github/graphql/graphql-js/releases">graphql
GitHub release notes</a>
  </details>
</details>


<details>
  <summary><b>Commit messages</b></summary>
  </br>
  <details>
    <summary>Package name: <b>graphql</b></summary>
    <ul>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/commit/3a51ecade74a0198847e8b1ab1bcdc129485b79b">3a51eca</a>
16.6.0</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/commit/f0a0a4dadffe41dae541ab297f95997435b27c57">f0a0a4d</a>
parser: limit maximum number of tokens (#3702)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/commit/6c6508bd0d74587d7d264f6ab2258df5aeccc6af">6c6508b</a>
Parser: allow &#x27;options&#x27; to explicitly accept undefined
(#3701)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/commit/af8221a6504b66a95b9bc0c20935e8f18b23d7d2">af8221a</a>
Workaround for codesandbox having bug with TS enums (#3686)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/commit/59a73d64ee8a7a717c73e7dfdc1ea627a12a283e">59a73d6</a>
createSourceEventStream: introduce named arguments and deprecate
positional arguments (#3645)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/commit/1f8ba95c662118452bd969c6b26ba4e9050c55da">1f8ba95</a>
16.5.0</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/commit/1112b4d58ec755dbde4f4734f3a4f8a6d6459681">1112b4d</a>
Expose GraphQLErrorOptions type (#3554) (#3565)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/commit/23dba4ed89634897155c422877d8192609e6d427">23dba4e</a>
16.4.0</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/commit/af64b671f36d469122f8a20b4aef9d65dbfe2374">af64b67</a>
pass valid value to codecov config (#3543)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/commit/16503cd1927da5f2928d4abfa84a64b3502bd6ba">16503cd</a>
github-actions-bot: fix reply on commands (#3538)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/commit/092655452ffac9195eb436e328e36ca792a9b1f3">0926554</a>
ESLint: disallow using node globals in src/tests (#3537)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/commit/4f062aaaa57b1bcf166d5e6d546c678ce2298433">4f062aa</a>
github-actions-bot: fix usage of NPM_CANARY_PR_PUBLISH_TOKEN
(#3536)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/commit/a981dc61731a1e2e54e525ce7cfe4dc053a80a84">a981dc6</a>
github-actions-bot: fix publishing of canary releases (#3534)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/commit/bb70cbc93e9d3eb499798069da61cb303ebcd9b6">bb70cbc</a>
Update deps (#3533)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/commit/b38429f4d46b17f23d15406a2ca0d1eb201864b6">b38429f</a>
integrationTests/node: fix crash on Mac with M1 by using docker
(#3530)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/commit/15040d02eb3c5ce2122c9329d26df5cde5ff5b3f">15040d0</a>
Update documentation on deprecated formatError(..) (#3512)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/commit/ff06428bcd0eb3a23f52480cb04d465157553afb">ff06428</a>
refactor: use object for GraphQLError constructor (#3465)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/commit/5f247e0e8f38b441b4445187d0c7f7170a417244">5f247e0</a>
github-actions-bot: Fix collapsing of unrelated comments (#3525)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/commit/faa42e2cb377cbc26c38f67b2f65891a61c22277">faa42e2</a>
tests(printSchema): test omitting schema of common names (#3524)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/commit/def26e6757a372762f102f7554204ba236bcf0b2">def26e6</a>
github-actions-bot: replace &#x27;octokit/request-action&#x27; action
(#3523)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/commit/f3248cd1a10c375f0a9a0d434dc6567a6cd54598">f3248cd</a>
tests(execution): add missing new lines (#3522)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/commit/6bcd241349d9a891149e524bd5046717f16798cb">6bcd241</a>
ci: Add &#x27;@ github-actions&#x27; bot (#3503)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/commit/e1726dfea66979bfe7ad1c0b0834613e4b6ce4b4">e1726df</a>
GraphQLError: switch constructor overload order (#3514)</li>
<li><a
href="https://snyk.io/redirect/github/graphql/graphql-js/commit/da5723860e87c97831c02a1137e9431d96c14239">da57238</a>
correct outdated documentation (#3505)</li>
    </ul>

<a
href="https://snyk.io/redirect/github/graphql/graphql-js/compare/f597c694339b7c488f05496806e404659f6ff955...3a51ecade74a0198847e8b1ab1bcdc129485b79b">Compare</a>
  </details>
</details>
<hr/>

**Note:** *You are seeing this because you or someone else with access
to this repository has authorized Snyk to open upgrade PRs.*

For more information: <img
src="https://api.segment.io/v1/pixel/track?data=eyJ3cml0ZUtleSI6InJyWmxZcEdHY2RyTHZsb0lYd0dUcVg4WkFRTnNCOUEwIiwiYW5vbnltb3VzSWQiOiI3ODgyYTEzNi0wNzEyLTQ0OGEtYmYyOC03NjYyNmNiNjBiNjEiLCJldmVudCI6IlBSIHZpZXdlZCIsInByb3BlcnRpZXMiOnsicHJJZCI6Ijc4ODJhMTM2LTA3MTItNDQ4YS1iZjI4LTc2NjI2Y2I2MGI2MSJ9fQ=="
width="0" height="0"/>

🧐 [View latest project
report](https://app.snyk.io/org/sandbox-2ba/project/9043c51f-3f0d-45c6-8455-b658274f2872?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)

🛠 [Adjust upgrade PR
settings](https://app.snyk.io/org/sandbox-2ba/project/9043c51f-3f0d-45c6-8455-b658274f2872/settings/integration?utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr)

🔕 [Ignore this dependency or unsubscribe from future upgrade
PRs](https://app.snyk.io/org/sandbox-2ba/project/9043c51f-3f0d-45c6-8455-b658274f2872/settings/integration?pkg&#x3D;graphql&amp;utm_source&#x3D;github&amp;utm_medium&#x3D;referral&amp;page&#x3D;upgrade-pr#auto-dep-upgrades)

<!---
(snyk:metadata:{"prId":"7882a136-0712-448a-bf28-76626cb60b61","prPublicId":"7882a136-0712-448a-bf28-76626cb60b61","dependencies":[{"name":"graphql","from":"16.3.0","to":"16.6.0"}],"packageManager":"npm","type":"auto","projectUrl":"https://app.snyk.io/org/sandbox-2ba/project/9043c51f-3f0d-45c6-8455-b658274f2872?utm_source=github&utm_medium=referral&page=upgrade-pr","projectPublicId":"9043c51f-3f0d-45c6-8455-b658274f2872","env":"prod","prType":"upgrade","vulns":[],"issuesToFix":[],"upgrade":[],"upgradeInfo":{"versionsDiff":5,"publishedDate":"2022-08-16T19:26:38.481Z"},"templateVariants":[],"hasFixes":false,"isMajorUpgrade":false,"isBreakingChange":false,"priorityScoreList":[]})
--->

---------

Co-authored-by: snyk-bot <snyk-bot@snyk.io>
benjie added a commit that referenced this pull request Jun 21, 2024
sachindshinde added a commit to sachindshinde/graphql-js that referenced this pull request Aug 16, 2024
sachindshinde added a commit to sachindshinde/graphql-js that referenced this pull request Aug 16, 2024
sachindshinde added a commit to sachindshinde/graphql-js that referenced this pull request Aug 16, 2024
yaacovCR pushed a commit to yaacovCR/graphql-js that referenced this pull request Sep 23, 2024
yaacovCR pushed a commit that referenced this pull request Sep 23, 2024
…th nested fragments (#4168)

In trying to prevent infinite loops, #3442 introduced a bug that causes certain violations of the [Field Selection Merging](https://spec.graphql.org/draft/#sec-Field-Selection-Merging) validation to not be caught (released in `16.3.0`, and backported to `15.9.0`). This PR fixes this bug, while continuing to prevent infinite loops.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
PR: bug fix 🐞 requires increase of "patch" version number
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants