Skip to content
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

feat: structure composition errors #678

Conversation

EverlastingBugstopper
Copy link
Contributor

Regular composition error output now uses proper std::error::Error implementations with chains of errors rather than the previous iteration where we just hacked in a bunch of calls to eprintln!

Checking the proposed schema for subgraph users against rover-supergraph-demo@current
error[E029]: Encountered 1 composition error while trying to compose subgraph "users" into supergraph "rover-supergraph-demo@current".

Caused by:
    KEY_FIELDS_SELECT_INVALID_TYPE: [users] User -> A @key selects emaillll, but User.emaillll could not be found
    
              The changes in the schema you proposed for subgraph users are incompatible with supergraph rover-supergraph-demo@current. See https://www.apollographql.com/docs/federation/errors/ for more information on resolving composition errors.

This PR also includes a custom serializer for our error struct that will include structured composition errors if they have occurred, whether they are detected on a subgraph check or a supergraph compose.

@EverlastingBugstopper EverlastingBugstopper force-pushed the avery/structure-composition-errors branch from cf65ed6 to 657477c Compare July 16, 2021 20:43
@EverlastingBugstopper EverlastingBugstopper merged commit 36a49f3 into avery/structured-output Jul 19, 2021
@EverlastingBugstopper EverlastingBugstopper deleted the avery/structure-composition-errors branch July 19, 2021 16:42
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.

1 participant