dotansimha / graphql-code-generator-community

MIT License
115 stars 147 forks source link

typescript-graphql-request ignoring importOperationTypesFrom config option #159

Open chadly opened 2 years ago

chadly commented 2 years ago

Describe the bug

The typescript-graphql-request plugin is ignoring importOperationTypesFrom config option.

To Reproduce

codegen.yml:

schema: "http://example.com"
documents: "**/*.gql"
generates:
  schema.ts:
    plugins:
      - typescript
      - typescript-operations
    config:
      onlyOperationTypes: true

  sdk.ts:
    plugins:
      - add:
          content: "import * as Types from './schema';"
      - typescript-graphql-request
    config:
      importOperationTypesFrom: Types

Expected behavior

I expect it to prefix operation types with Types. but it doesn't.

todd-elvers commented 2 years ago

Just ran into this same problem. The base RawClientSideBasePluginConfig interface that the plugin uses to describe its configuration has importOperationTypesFrom, but the actual plugin itself seems to ignore this configuration value.