-
Notifications
You must be signed in to change notification settings - Fork 583
feat(graphql-yoga): add support for experimental error coordinate #4288
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
base: main
Are you sure you want to change the base?
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
89d3ba3 to
947292d
Compare
Apollo Federation Subgraph Compatibility Results
Learn more: |
💻 Website PreviewThe latest changes are available as preview in: https://pr-4288.graphql-yoga.pages.dev |
✅ Benchmark Results |
🚀 Snapshot Release (
|
| Package | Version | Info |
|---|---|---|
@graphql-yoga/apollo-link |
5.2.0-alpha-20251120144328-f407246d4f94919701bf3bdd78b9ae60c7059269 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/urql-exchange |
5.2.0-alpha-20251120144328-f407246d4f94919701bf3bdd78b9ae60c7059269 |
npm ↗︎ unpkg ↗︎ |
graphql-yoga |
5.17.0-alpha-20251120144328-f407246d4f94919701bf3bdd78b9ae60c7059269 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/nestjs |
3.18.0-alpha-20251120144328-f407246d4f94919701bf3bdd78b9ae60c7059269 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/nestjs-federation |
3.18.0-alpha-20251120144328-f407246d4f94919701bf3bdd78b9ae60c7059269 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/plugin-apollo-inline-trace |
3.17.0-alpha-20251120144328-f407246d4f94919701bf3bdd78b9ae60c7059269 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/apollo-managed-federation |
0.16.0-alpha-20251120144328-f407246d4f94919701bf3bdd78b9ae60c7059269 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/plugin-apollo-usage-report |
0.12.0-alpha-20251120144328-f407246d4f94919701bf3bdd78b9ae60c7059269 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/plugin-apq |
3.17.0-alpha-20251120144328-f407246d4f94919701bf3bdd78b9ae60c7059269 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/plugin-csrf-prevention |
3.17.0-alpha-20251120144328-f407246d4f94919701bf3bdd78b9ae60c7059269 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/plugin-defer-stream |
3.17.0-alpha-20251120144328-f407246d4f94919701bf3bdd78b9ae60c7059269 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/plugin-disable-introspection |
2.18.0-alpha-20251120144328-f407246d4f94919701bf3bdd78b9ae60c7059269 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/plugin-graphql-sse |
3.17.0-alpha-20251120144328-f407246d4f94919701bf3bdd78b9ae60c7059269 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/plugin-jwt |
3.11.0-alpha-20251120144328-f407246d4f94919701bf3bdd78b9ae60c7059269 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/plugin-persisted-operations |
3.17.0-alpha-20251120144328-f407246d4f94919701bf3bdd78b9ae60c7059269 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/plugin-prometheus |
6.12.0-alpha-20251120144328-f407246d4f94919701bf3bdd78b9ae60c7059269 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/plugin-response-cache |
3.19.0-alpha-20251120144328-f407246d4f94919701bf3bdd78b9ae60c7059269 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/plugin-sofa |
3.17.0-alpha-20251120144328-f407246d4f94919701bf3bdd78b9ae60c7059269 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/render-apollo-sandbox |
0.2.0-alpha-20251120144328-f407246d4f94919701bf3bdd78b9ae60c7059269 |
npm ↗︎ unpkg ↗︎ |
@graphql-yoga/render-graphiql |
5.17.0-alpha-20251120144328-f407246d4f94919701bf3bdd78b9ae60c7059269 |
npm ↗︎ unpkg ↗︎ |
|
|
||
| export const yoga = createYoga({ | ||
| schema, | ||
| plugins: [useErrorCoordinate()] |
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.
Should we enable it by default, since error masking will strip it out anyways?
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.
I don't think so, since it is experimental. If the user has it's own masking function, it could leak if it is not updated ^^'
And the OTEL plugin will be able to automatically enable it as needed by using addPlugin (which is also why it's a plugin and not an option!)
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.
😍
feat(graphql-yoga): add support for experimental error coordinate
ba5a7ec to
f407246
Compare
Description
This PR add optional experimental support of the
coordinateerror attribute proposal (graphql/graphql-spec#1200).This allows us to more easily identify the resolver which is the source of error than with the
pathwhich can be difficult to walk, or even lead to unsolvable ambiguities.Related to GW-501
Usage
Since this is experimental, it has to be explicitly enabled by adding the appropriate plugin to the
Yoga instance:
Once enabled, located errors will gain the
coordinateattribute:Security concerns
Adding a schema coordinate to errors exposes information about the schema, which can be an attack
vector if you rely on the fact your schema is private and secret.
This is why the
coordinateattribute is not serialized by default, and will not be exposed toclients.
If you want to send this information to client, override either each
toJSONerror's method, or adda dedicated extension.