Skip to content

Error 0: Unknown type "UUID". Did you mean "ID"? #8824

Open
@Szymon-Wrzos

Description

@Szymon-Wrzos

Which packages are impacted by your issue?

No response

Describe the bug

I am using graphql-codegen with typescript and it works fine, but on provided query, codegen throws
Error 0: Unknown type "UUID". Did you mean "ID"?

I cannot replace "UUID" with "ID" as its used in company's schema and cannot be changed (only names there were changed)

const CREATE_TOKEN = /* GraphQL */ `
  mutation GenerateToken($uuid: UUID!) {
    generateToken(uuid: $uuid) {
      token
    }
  }
`;

export default CREATE_TOKEN;

Your Example Website or App

cannot.provide.it

Steps to Reproduce the Bug or Issue

  1. From my side, using UUID itself provides this issue

Expected behavior

I expected this query to have generated types, not throwing an error

Screenshots or Videos

No response

Platform

  • OS: Ubuntu 22.04
  • NodeJS v19.2.0
  • "@graphql-codegen/cli": "^2.16.4",
  • "@graphql-codegen/typescript": "^2.8.7",
  • "@graphql-codegen/typescript-operations": "^2.5.12",

Codegen Config File

const config: CodegenConfig = {
  overwrite: true,
  schema: [
    {
      'https://some.graphql.api/': {
        headers: {
          Authorization: accessToken,
        },
      },
    },
  ],

  documents: 'src/graphql/*.js',
  generates: {
    'src/types/graphql/': {
      plugins: [
        'typescript',
        'typescript-operations',
      ],
    },
  },
  hooks: {
    afterAllFileWrite: 'prettier src/types/graphql --write ',
  },
};

export default config;

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    stage/0-issue-prerequisitesNeeds more information before we can start working on it

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions