Duplicated keys with autogenSWRKey enabled
vitorcamachoo opened this issue · 0 comments
vitorcamachoo commented
-
I'm submitting a ...
[X] bug report
[ ] feature request
[ ] question about the decisions made in the repository
[ ] question about how to use this project -
Summary
At our company, we're working with multiple GraphQL services, and it can happen to have queries with the same identifier, which result on duplicated key generation for hooks. Example:
generates:
# Api codegen
libs/backoffice/api/graphql/yacooba/request.ts:
documents:
- 'apps/**/*.yacooba.graphql'
- 'libs/**/*.yacooba.graphql'
plugins:
- typescript
- typescript-operations
- typescript-graphql-request
- plugin-typescript-swr
config:
autogenSWRKey: true
skipTypename: true
libs/backoffice/api/graphql/protocol/request.ts:
documents:
- 'apps/**/*.protocol.graphql'
- 'libs/**/*.protocol.graphql'
plugins:
- typescript
- typescript-operations
- typescript-graphql-request
- plugin-typescript-swr
config:
autogenSWRKey: true
skipTypename: true
The two apis have two queries with the same name, (events
), resulting on the generation of two hooks with the same key:
Is there any way to avoid this, maintaining the configuration autogenSWRKey
active ?