graphql-code-generator
graphql-code-generator copied to clipboard
[typescript-graphql-request] Add support for graphql-request's native batching solution.
Is your feature request related to a problem? Please describe.
graphql-request supports batching, but it cannot be used with the sdk.
Describe the solution you'd like
The plugin should generate a batched version of the queries, e.g. sdk.queryNameBatch
where the first parameter is an array instead of an object.
Describe alternatives you've considered
I can create a client directly by using GraphQLClient
from graphql-request
and call client.batchRequests( [ { document: QueryDocumentFromGeneratedFile } ] )
but it's not ideal (I have to manually set the return type of the method).