graphql-code-generator icon indicating copy to clipboard operation
graphql-code-generator copied to clipboard

[typescript-graphql-request] Add support for graphql-request's native batching solution.

Open kratam opened this issue 2 years ago • 0 comments

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).

kratam avatar Jul 08 '22 08:07 kratam