dotansimha / dotansimha/graphql-code-generator

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

Open
#8,824 5 comments 0 reactions 0 assignees View on GitHub
stage/0-issue-prerequisites
Dominant language
TypeScript
Stars
11.3k
Forks
1.4k
Avg merge
1d 1h
Merged PRs (30d)
23

Description

### 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)

```js
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

```js
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_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.