0

I'm generating graphql queries using graphql-codegen along with typescript-graphql-request. It works fine, but the generated client produces queries in the following format:

{
  "query": "query getUser($id: String!) { getUser(eid: $eid) { id title } }",
  "variables": {"id":"123"},
  "operationName": "getUser"
}

However, my backend only seem to support a compiled query liked this:

{ "query":"query{getUser(id:\"123\"){eid title }}"}

Are there any settings I can use in graphql-codegen to make it produce such a payload? If not, are there any other frameworks I can use to hook in the middleware to do the conversion myself?

Johan
  • 35,120
  • 54
  • 178
  • 293

0 Answers0