Skip to content

fix: cost-limit ignore only Field Node named __schema #772

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

Merged
merged 3 commits into from
Apr 18, 2025

Conversation

M0ngi
Copy link
Contributor

@M0ngi M0ngi commented Apr 4, 2025

This PR fixes a bypass to the cost-limit plugin (in default settings) by skipping only nodes of type Field when ignoreIntrospection is set.

This will fix the following type of bypasses:

query  {
  ...__schema
}

fragment __schema on Query {
  books {
    title
    author
  }
}
query __schema {
  books {
    title
    author
  }
}

Copy link

changeset-bot bot commented Apr 4, 2025

⚠️ No Changeset found

Latest commit: ab7d466

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@M0ngi M0ngi self-assigned this Apr 4, 2025
@codecov-commenter
Copy link

codecov-commenter commented Apr 4, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.82%. Comparing base (11c682d) to head (ab7d466).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #772      +/-   ##
==========================================
+ Coverage   91.73%   91.82%   +0.08%     
==========================================
  Files          17       17              
  Lines         375      379       +4     
  Branches      126      130       +4     
==========================================
+ Hits          344      348       +4     
  Misses         31       31              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@M0ngi M0ngi requested a review from LMaxence April 4, 2025 16:04
@Gby56 Gby56 merged commit 5a32954 into main Apr 18, 2025
9 checks passed
@Gby56 Gby56 deleted the fix/cost-limit-bypass branch April 18, 2025 14:46
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.

3 participants