-
Notifications
You must be signed in to change notification settings - Fork 259
feat(gateway): Implement @core v0.2, including "for" and core__Purpose support #957
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
Conversation
* Permit all core features for core v0.1 * Enforce "for" requirements on core features for core v0.2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks good! my only question is about the behavior we want to have if we see for: something
in a core v0.1 document. currently, we explicitly do not honor it and fail open, which seems… maybe not great, since we understand the likely intent, and the intent was to protect the schema from being served by us dunderheads who don't understand how the @auth
directive works (or whatever)
three options:
- hard fail if we see a
for:
in a core v0.1 doc. this will teach people (mostly us, probably ;) ) to update the feature in their docs / generators - warn if we see a
for:
in a core v0.1 doc, but honor its intention (i.e. ensure the feature is supported). this will annoy people into eventually updating the feature, and meanwhile mostly do what they want - do not warn if we see
for:
in a core v0.1 doc and honor its intention
i think (1) is a bit harsh and (3) is a bit loose, so i lean towards (2). wyt?
* Fix incorrectly written tests * Add requested test
9d10096
to
3c01ddf
Compare
… even in v0.1 documents, update test.
This PR updates the gateway to @core v0.2 🎉
This includes implementing support for the optional
for
argument in the@core
directive. This argument allows a core directive usage to specify how a gateway should behave in the case that its feature is unsupported. This is important for various use cases - in particular, execution and security concerns.the gateway will throw
UnsupportedFeature
on schema update IF:for
argument (only valid options are currentlyEXECUTION
andSECURITY
additionally, if the supergraph specifies core v0.1, and contains core directives which use
for:
, the gateway will reportForUnsupported
.TODOs
@apollo/core-schema
Add MIT license core-schema-js#11@apollo/core-schema
? I don't think we should be depending on a github branch, and certainly not amain
branch. apollographql/core-schema-js@e6c318eCloses https://github.com/apollographql/polaris-planning/issues/109