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

fix(federation): composeAndValidate throws when no base type exists #605

Open
trevor-scheer opened this issue Mar 25, 2021 · 0 comments
Open

Comments

@trevor-scheer
Copy link
Member

trevor-scheer commented Mar 25, 2021

Attempting to extend a type which isn't defined in any service causes composeAndValidate to throw, which is not a behavior we want. composeAndValidate should capture all composition errors with as much helpful information as possible and return them.

While #478 aimed to address this problem in the first place, resolving this issue should mean that we land a fix which no longer requires the try/catch and discard error approach. These changes should be undone (though the tests can stay and be updated!).

In the weeds a bit:
It's helpful for us to compose as far as we're able to in order to collect as many errors as possible (rather than having the act of composition fail completely with no resulting schema to run validations against). In order to accomplish this in this case, we'll likely need to "create" a false base type to bypass the failure and proceed with composition. This is one option among possible others.

Related: #567
I think tackling these issues simultaneously makes a lot of sense!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant