-
Notifications
You must be signed in to change notification settings - Fork 247
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
Response construction #44
Comments
Note that the expected field ordering is not static however, but depends on the runtime types of objects and on the values of variables that are used in That means you need to follow the GraphQL execution algorithm at least in spirit, although there are simplifications you can make. This is the step that is most relevant to this issue: http://spec.graphql.org/draft/#sec-Field-Collection The way execution is implemented in |
right, if it requires some runtime info too it can become very tricky. Also, apparently the query plan we currently get from the harmonizer does not give info on the expected fields.
|
In the current state I don't think we can address this issue. A good way to solve it would be to improve the query planner to include the information that is missing. When we do re-write the query planner in Rust we will be able to create our own format and improve a few things here and there like this one. |
Yeah, the query plan does not include the input query because that seems redundant. We could return a parsed representation of the query from JS in addition to the query plan if we wanted to avoid parsing in Rust, but it seems with |
Fix query plan cache config cache->experimental_cache in_memory and experimental_cache are now defaulted Final layout: ```yaml supergraph: query_planning: experimental_cache: in_memory: limit: 2000 redis: urls: - http://example.com/ ``` --------- Co-authored-by: bryn <bryn@apollographql.com>
Fixes apollographql#44 deno_core advocates for us to use snapshots instead of loading scripts and running them. One of the recent side effects is that deno_core prints `rerun-if-changed` directives when loading scripts manually. This commit moves the scripts loading mechanism to the build (in `build_harmonizer.rs`) so the messages mentioned above won't display at runtime.
Is your feature request related to a problem? Please describe.
The response generated from subgraph responses does not match the query.
Examples with the federation demo:
field order
returns:
The
id
field should appear after thereviews
field, but because a first query to the accounts subgraph must be performed to obtained theid
key, before requesting the review, theid
is added to the response before thereviews
unnecessary data
returns
The
id
field should not be there, but since it was used for the join, it was added by the response from the accounts subgraph.These inconsistencies in the responses will block the work on integration testing #47, because they will generate a lot of differences between the gateway and router responses.
Describe the solution you'd like
The response should be created using the query plan, with only the required fields, in order, then subgraph responses would only be merged where it is necessary.
Describe alternatives you've considered
This work could be done as part of the future Rust query planner, but it looks like it can be done independently, only using the common query plan format.
The text was updated successfully, but these errors were encountered: