Share on socials

Implement `to_schema` for a `QueryPlan`

Exclusives

Open to everyone

Description

Implement a method to_document on QueryPlan to create an ExecutableDocument.

Here is an example of how the ExecutableDocument should look like when rendered:

{
QueryPlan {
Sequence {
Fetch(service: "SubgraphA") {
updateInAOne: updateFooInA {
id
bar
}
}
Fetch(service: "SubgraphB") {
updateInBOne: updateFooInB {
id
baz
}
}
}
Fetch(service: "SubgraphA") {
updateInATwo: updateFooInA {
id
bar
}
}
}
}

Technical Requirements

  • Implement it as a method to_doc on QueryPlan<A> to create an ExecutableDocument.
  • Add unit tests for some sample QueryPlans in model.rs

Contributor chat