0

I'm having a problem while generating TS interfaces from my graphQL schema. My code:

export const userTypeDefs = gql`

  input SignUpRequestInput {
    name: String!
    password: String!
    role: Int!
  }

  interface SomeInter {
    name: String!
  }

  type Mutation {
    createUser(request: SignUpRequestInput): SomeInter
  }
`;

When I run server in my graphql playground I can see both SignUpRequestInput input and SomeInter interface, nevertheless when I run graphql-codegen script it only generates SignUpRequestInput interface and omits SomeInter

Script that I'm running:

graphql-codegen --config codegen.yml

codegen.yml:

overwrite: true
schema: 'http://localhost:4000/graphql'
documents: null
generates:
  src/interfaces/generated.ts:
    plugins:
      - 'typescript'
    config:
      skipTypename: true
      declarationKind:
        type: 'interface'
        input: 'interface'
        interface: 'interface'

Does anyone know what I'm doing wrong? Thanks

0 Answers0