dotansimha / dotansimha/graphql-code-generator-community
Infinite rendering occurs when date or datetime type values are used as arguments.
- Dominant language
- TypeScript
- Stars
- 137
- Forks
- 195
- Avg merge
- 6h 20m
- Merged PRs (30d)
- 16
Description
**Describe the bug**
**To Reproduce**
Steps to reproduce the behavior:
1. My GraphQL schema:
```graphql
# Put your schema here
type Query {
test(customArg: String): String
}
```
2. My GraphQL operations:
```graphql
# Put your operations herequery Test($customArg: String!) {
test(customArg: $customArg)
}
```
3. My `codegen.yml` config file:
```yml
# Put your YML here
schema: http://localhost:4000/graphql/
documents: src/graphql/operations/**/*.graphql
generates:
src/graphql/schemas/generated/schema.ts:
plugins:
- typescript
- typescript-operations
- typescript-react-apollo
config:
namingConvention:
transformUnderscore: true
scalars:
BigInt: bigint
DateTime: string
EmailAddress: string
```
**Expected behavior**
**Environment:**
- OS: MacOS 12.1
- `@graphql-codegen/...`:
```
"@graphql-codegen/cli": "^2.6.1",
"@graphql-codegen/typescript": "^2.4.3",
"@graphql-codegen/typescript-operations": "^2.3.0",
"@graphql-codegen/typescript-react-apollo": "^3.2.5",
```
- NodeJS: 16.11.1
**Additional context**
If you pass dayjs().toISOString() or new Date().toString(), infinite rendering will occur.
With dayjs().toString(), it was not infinite rendering, but it was extra rendering.
I don't know if it's a bug in graphql-code-generator or in GraphQL.js, but I'm sorry if this is the wrong place to post this.
Is there anything I can do to help?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.