Open MedHeikelBouzayene opened 4 weeks ago
Let's have this schema:
schema @server(port: 8000, hostname: "0.0.0.0") { query: Query } type Query { queryNodeA: NodeA @graphQL(url: "http://localhost:8083", name: "nodeA") } type NodeA { name: String nodeB: NodeB nodeC: NodeC } type NodeB { name: String nodeA: NodeA nodeC: NodeC } type NodeC { name: String nodeA: NodeA nodeB: NodeB }
when I send try this query:
query QueryNodeA { queryNodeA { name nodeB { name } nodeC { name } } }
that's the query sent to the graphql server: > Body { "query": "query { nodeA { name nodeB { name } nodeC } }" }
{ "query": "query { nodeA { name nodeB { name } nodeC } }" }
That's the query expected to be sent to the graphql server:
Body
{ "query": "query { nodeA { name nodeB { name } nodeC { name } } }" }
This can be fixed by adding a jit/transform/graphql.rs. This transformer will be responsible to building the exact GraphQL query for each source GraphQL query.
jit/transform/graphql.rs
Prerequisites
Describe the bug
Let's have this schema:
when I send try this query:
that's the query sent to the graphql server: > Body
{ "query": "query { nodeA { name nodeB { name } nodeC } }" }
Expected behavior
That's the query expected to be sent to the graphql server:
{ "query": "query { nodeA { name nodeB { name } nodeC { name } } }" }