This repository was archived by the owner on Nov 10, 2026. It is now read-only.
Repository navigation
Conversation
graphql-middleware has been unmaintained since 2023 and pins @graphql-tools/utils 8.9.0 (GHSA-7mx3-vvmw-hjmv). shield() now returns a function that maps the schema and wraps each object field resolver with its rule, which is what applyMiddleware did through addResolversToSchema. BREAKING CHANGE: shield(rules, options) returns (schema) => schema; call it instead of applyMiddleware(schema, permissions). graphql-middleware is no longer a peer dependency. Rule `fragment` options and extractFragment/extractFragments are removed, since only graphql-middleware applied them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
|
Superseded by SOUNDBOKS/sb-backend-monorepo#558: graphql-shield moves into the monorepo as packages/graphql-shield. This repo will be archived once 2.0.1 is published from there. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
graphql-middleware 6.1.35 has been unmaintained since 2023 and pins
@graphql-tools/utils8.9.0, which Dependency Track flags as High (GHSA-7mx3-vvmw-hjmv) in every sb-backend-monorepo image. This fork was the only reason it stayed in the tree.Change
shield(rules, options)now returns(schema) => schema. It validates the rule tree against the schema (same error messages as before), then runsmapSchemafrom@graphql-tools/utilsand wraps every object field's resolver (ordefaultFieldResolver) with its rule.applyMiddlewaredid the same thing throughaddResolversToSchema, and the rule-evaluation body is unchanged.Rule precedence is unchanged: field rule, then the type's
*wildcard, then the type rule or the schema rule, thenfallbackRule.Breaking (2.0.0)
applyMiddleware(schema, permissions)becomespermissions(schema).graphql-middlewareis no longer a peer dependency.@graphql-tools/utils@^13.2.0is now a dependency.fragmentoptions andextractFragment/extractFragmentsare removed. Only graphql-middleware's fragment replacements used them, and sb-backend-monorepo uses none.subscriberesolver are no longer wrapped. We have no GraphQL subscriptions.Testing
permissions(schema): 58 tests, plus a new test that fields without a resolver are guarded and the input schema is left untouched.fragments.test.tsis deleted along with the feature.distinto sb-backend-monorepo'snode_moduleswith graphql-middleware removed.@soundboks/serverpasses 350 tests, including new allow and federation_entitiestests, and typecheck and tests pass for all six apps.The
tests/__snapshots__obsolete entry predates this PR (it was left over from the vitest migration).🤖 Generated with Claude Code