ardeois / graphql-codegen-typescript-mock-data

[GraphQL Codegen Plugin](https://github.com/dotansimha/graphql-code-generator) for building mock data based on the schema.
MIT License
132 stars 47 forks source link

type name are changed #115

Closed Benoit-ROBIN closed 1 year ago

Benoit-ROBIN commented 1 year ago

Hi, does anyone know why my type's name are not keep from generated type's file ? For example: In my generated type's file I have a type named Bo_AllActivityGroupPayload and in the mock file generated by typescript-mock-data this type become Bo_AllActivityGroupPayload, so the import is broken and nothing work.

here's my conf:

overwrite: true
schema: ${BACKEND_URL}
documents: 'src/**/*.{ts,tsx}'
generates:
  src/types/generated-ops.ts:
    plugins:
      - 'typescript'
      - 'typescript-operations'
      - 'typescript-react-apollo'
  src/types/fragmentTypes.json:
    plugins:
      - 'fragment-matcher'
  src/__tests__/generated-mocks.ts:
    plugins:
      - typescript-mock-data:
          typesFile: '../types/generated-ops.ts'
          generateLibrary: 'faker'
          typeNames: keep
          enumValues: keep
          terminateCircularRelationships: true
Benoit-ROBIN commented 1 year ago

I am on v3.2.2