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

[typescript-graphql-request] allow custom Sdk type

Open eth3lbert opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe.

Currently, @graphql-codgen/typescript-graphql-request uses a hard-coded Sdk type. If the schema also has a Sdk type, this will cause a conflict.

Describe the solution you'd like

Allow the user to customize the Sdk type, for example by adding the sdkType option to the configuration.

eth3lbert avatar Nov 08 '23 01:11 eth3lbert

Could also fix via hooks:

  hooks: {
    afterOneFileWrite: [
      `sed -i -e "s|export type Sdk = ReturnType|export type MySdk = ReturnType|g"`,
    ]
  }

eth3lbert avatar Nov 17 '23 01:11 eth3lbert