WIP: New crate implementing execution and schema introspection #645
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note: this depends on ongoing work for #641, so for now this PR targets a temporary branch in order to only show relevant diffs.
This is an initial draft implementation of (trying to be) spec-compliant:
Execution:
@skip
,@include
, and type conditions)null
), raised by a resolver or otherwiseserde
-serializable data structures of a GraphQL response, request errors, field errors, and field error pathserde_json_bytes::Value
(which uses a wrapper of reference-countedBytes
for strings)Schema introspection:
__schema
and__type
) from an executable document, so the rest can be executed separately (whether with the above, or not like in Apollo Router)See
crates/apollo-introspection/tests/doc_example.rs
for an API usage example.Testing is minimal. Experience integrating with Apollo Router would be good to have before merging this PR. Execution is included in support of introspection and not exposed in the public API. If/when another use case comes we can expose it, with some more thought on the API design (especially for the resolver trait).