Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using graphql-codegen creates two duplicate "export enum OrderBy". #10183

Open
toki-developer opened this issue Mar 30, 2024 · 0 comments
Open
Labels
k/bug Something isn't working

Comments

@toki-developer
Copy link

toki-developer commented Mar 30, 2024

Version Information

Server Version:
v2.37.0

Environment

Hasura Cloud

What is the current behaviour?

Using graphql-codegen creates two duplicate "export enum OrderBy".

.
.
/** column ordering options */
export enum OrderBy {
  /** in ascending order, nulls last */
  ASC = 'ASC',
  /** in ascending order, nulls first */
  ASC_NULLS_FIRST = 'ASC_NULLS_FIRST',
  /** in ascending order, nulls last */
  ASC_NULLS_LAST = 'ASC_NULLS_LAST',
  /** in descending order, nulls first */
  DESC = 'DESC',
  /** in descending order, nulls first */
  DESC_NULLS_FIRST = 'DESC_NULLS_FIRST',
  /** in descending order, nulls last */
  DESC_NULLS_LAST = 'DESC_NULLS_LAST'
}
.
.
.
/** column ordering options */
export enum OrderBy {
  /** in ascending order, nulls first */
  ASC = 'asc',
  /** in ascending order, nulls first */
  ASC_NULLS_FIRST = 'asc_nulls_first',
  /** in ascending order, nulls last */
  ASC_NULLS_LAST = 'asc_nulls_last',
  /** in descending order, nulls last */
  DESC = 'desc',
  /** in descending order, nulls first */
  DESC_NULLS_FIRST = 'desc_nulls_first',
  /** in descending order, nulls last */
  DESC_NULLS_LAST = 'desc_nulls_last'
}
.
........

So, when I run "yarn build", I get the following error.

Type error: Duplicate identifier 'ASC'.

What is the expected behaviour?

I want only one "export enum OrderBy" to be created when using graphql-codegen.

How to reproduce the issue?

  1. Connect two databases to Hasura (im my case, Postgres and BigQuery).
  2. Creating types from Schema using graphql-codegen.

Keywords

Duplicate order-by, graphql-codegen

@toki-developer toki-developer added the k/bug Something isn't working label Mar 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
k/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant