-
Notifications
You must be signed in to change notification settings - Fork 275
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(federation): query plan correctness checker #6498
base: dev
Are you sure you want to change the base?
Conversation
✅ Docs preview readyThe preview is ready to be viewed. View the preview File Changes 0 new, 1 changed, 0 removed
Build ID: 789e8fe275ae195cd6ad8cda URL: https://www.apollographql.com/docs/deploy-preview/789e8fe275ae195cd6ad8cda |
@duckki, please consider creating a changeset entry in |
CI performance tests
|
a910d24
to
bcb23f4
Compare
2632b38
to
38bb635
Compare
// These two intersections are distinct type conditions. | ||
// - `U ∧ I` = {R, S} | ||
// - `U ∧ J` = `U` = {R, S, X} | ||
let op_str = r#" | ||
query { | ||
test_u { | ||
... on I { | ||
data(arg: 0) | ||
} | ||
... on J { | ||
data(arg: 0) | ||
} | ||
} | ||
} | ||
"#; | ||
// Note: The set {R, S} has no corresponding named type definition in the schema, while | ||
// `U ∧ J` is just the same as `U`. | ||
insta::assert_snapshot!(response_shape(op_str), @r###" | ||
{ | ||
test_u -----> test_u { | ||
data -may-> data(arg: 0) on I ∧ U = {R, S} | ||
data -may-> data(arg: 0) on U | ||
} | ||
} |
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 needs a bit of clarification, or more clearly named types. It becomes confusing to reason about single letter types in sets and intersections 😅 . For example, we can use the Pet
schema that graphql js uses, or expand on the startstuff schema to add more unions?
Also, what does the ----->
actually denote in these snapshots? I take it -may->
is an option? So, test_u
has two possible options?
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 wrote some design doc (google doc).
- implemented ResponseShape computation from an operation
- comparison of two response shapes - query plans analysis, deriving plan's overall response shape
- instead of federation internal error
…ated data structures
…tions unnecessarily
e1bd353
to
294c280
Compare
- API schema is necessary to parse the input operation.
- support multiple nested TypenameEqual elements for FetchDataRewrite - added more error cases for sanity check
I have finished the first version (the completeness checking part) and rebased it on more recent |
This PR implements the first version of the query plan correctness checker.
It implemented the completeness part of the plan. I'll create a separate PR for the soundness part.
Status