-
Notifications
You must be signed in to change notification settings - Fork 24
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
router-bridge: Re-introduce validate
on the main
(v2) branch
#25
Comments
I've marked this as blocked until #21 lands. |
This was referenced Feb 9, 2022
validate
to the router-bridge
on the main
(v2) branchvalidate
on the main
(v2) branch
Ok, this is unblocked. |
abernix
added a commit
that referenced
this issue
Feb 14, 2022
While Federation's `buildQueryPlan` function does a fair bit of validation in order to properly build our plan (and leverages `graphql`'s [`validate`] function do most of that, it *does not* do all of the [default validations] that are specified. To be thorough, we must call `validate`, as we did [prior] to updating to the new Federation v2 alpha query planner. This also introduces a number of tests which exercise specific validations which we know as of today are not part of federation: - invalid_graphql_validation_1_is_caught: NoFragmentCyclesRule - invalid_graphql_validation_2_is_caught: ScalarLeafsRule - invalid_graphql_validation_3_is_caught: NoUnusedFragmentsRule I chose three random but different types to make sure we're capturing it. [prior]: apollographql/federation@9cb2201 [`validate`]: https://github.com/graphql/graphql-js/blob/95dac43fd4bff037e06adaa7cfb44f497bca94a7/src/validation/validate.ts#L38 [default validations]: https://github.com/graphql/graphql-js/blob/95dac43fd4bff037e06adaa7cfb44f497bca94a7/src/validation/specifiedRules.ts#L76-L103 Closes: #25
abernix
added a commit
that referenced
this issue
Feb 15, 2022
…n` (#37) While Federation's `buildQueryPlan` function does a fair bit of validation in order to properly build our plan (and leverages `graphql`'s [`validate`] function do most of that, it *does not* do all of the [default validations] that are specified. To be thorough, we must call `validate`, as we did [prior] to updating to the new Federation v2 alpha query planner. This also introduces a number of tests which exercise specific validations which we know as of today are not part of federation: - invalid_graphql_validation_1_is_caught: NoFragmentCyclesRule - invalid_graphql_validation_2_is_caught: ScalarLeafsRule - invalid_graphql_validation_3_is_caught: NoUnusedFragmentsRule I chose three random but different types to make sure we're capturing it. [prior]: apollographql/federation@9cb2201 [`validate`]: https://github.com/graphql/graphql-js/blob/95dac43fd4bff037e06adaa7cfb44f497bca94a7/src/validation/validate.ts#L38 [default validations]: https://github.com/graphql/graphql-js/blob/95dac43fd4bff037e06adaa7cfb44f497bca94a7/src/validation/specifiedRules.ts#L76-L103 Closes: #25
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I initially switched to using the new
query-planner
, via apollographql/federation@9cb2201, I removed our invocation ofvalidate
on the premise that we did all the validations inside of the Federation'sbuildQueryPlan
andoperationFromDocument
. While we do a lot in those, we do not do the complete suite of validations and we should add that back.This can be seen rather clearly in the diff on the above commit, but roughly this consists of:
The text was updated successfully, but these errors were encountered: