Closed laststylebender14 closed 6 days ago
for following example, ideally batching should work by sending all userId's in single upstream request but it doesn't.
schema @server(port: 8001, queryValidation: false, hostname: "0.0.0.0") @upstream(httpCache: 42, batch: {delay: 10}) { query: Query } type Query { posts: [Post] @graphQL(url: "http://127.0.0.1:8000/graphql", name: "posts") } type Post { id: Int! userId: Int! user: User @graphQL(url: "http://127.0.0.1:8000/graphql", name: "user", args: [{key: "id", value: "{{.value.userId}}"}], batch: true) } type User { id: Int! name(id: Int): String! }
following error is thrown on server.
on base tailcall server.
ERROR error=Deserialization Error: invalid type: unit value, expected struct Response
on upstream graphql server
INFO GET http://jsonplaceholder.typicode.com/posts HTTP/1.1 ERROR Failed to parse request: [{ "query": "query { user(id: 7) { name id } }" },{ "query": "query { user(id: 5) { name id } }" },{ "query": "query { user(id: 10) { name id } }" },{ "query": "query { user(id: 1) { name id } }" },{ "query": "query { user(id: 2) { name id } }" },{ "query": "query { user(id: 6) { name id } }" },{ "query": "query { user(id: 3) { name id } }" },{ "query": "query { user(id: 4) { name id } }" },{ "query": "query { user(id: 9) { name id } }" },{ "query": "query { user(id: 8) { name id } }" }]
query used:
# query { posts { id user { name } } }
batchRequests capability was disabled on upstream, enabling it fixes the issue.
for following example, ideally batching should work by sending all userId's in single upstream request but it doesn't.
following error is thrown on server.
on base tailcall server.
on upstream graphql server
query used: