dotansimha / dotansimha/graphql-code-generator

The code generator does not take into account naming conflicts

Open
#8,751 2 comments 1 reaction 0 assignees View on GitHub
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?

@graphql-codegen/cli, @graphql-codegen/typescript-operations

### Describe the bug

There are some examples :
type VenuePlan { groundPeriods(ground: ID!):[VenuePeriod!]! }
type VenuePlanGround { Periods(date: Time!):[VenuePeriod!]! }
and when i run code generating in front-end side, there is the error:
![image](https://user-images.githubusercontent.com/19850188/208340107-45429a77-0dec-4353-a85e-99da63038b44.png)
![image](https://user-images.githubusercontent.com/19850188/208340133-590aab20-5c75-4aac-8a31-e6125c5f881c.png)

### Your Example Website or App

none

### Steps to Reproduce the Bug or Issue

when run graphql-codegen to produce code, it has produced the same name type.

### Expected behavior

The code generator needs to take into account naming conflicts

### Screenshots or Videos

![image](https://user-images.githubusercontent.com/19850188/208340107-45429a77-0dec-4353-a85e-99da63038b44.png)
![image](https://user-images.githubusercontent.com/19850188/208340133-590aab20-5c75-4aac-8a31-e6125c5f881c.png)

### Platform

"@graphql-codegen/cli": "^1.21.5",
"@graphql-codegen/schema-ast": "^1.18.3",
"@graphql-codegen/typescript": "^1.22.1",
"@graphql-codegen/typescript-graphql-request": "^3.2.1",
"@graphql-codegen/typescript-operations": "^1.18.0",

### Codegen Config File

generates:
./scripts/api/integration.ts:
documents: './operations/documents/integration/*.graphql'
schema: ./operations/schema/integration.graphql
plugins:
- typescript
- typescript-operations
- typescript-graphql-request

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