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

Duplicated keys with autogenSWRKey enabled #124

Open
vitorcamachoo opened this issue Mar 17, 2021 · 0 comments
Open

Duplicated keys with autogenSWRKey enabled #124

vitorcamachoo opened this issue Mar 17, 2021 · 0 comments

Comments

@vitorcamachoo
Copy link

  • 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:

Api 1:
Screenshot 2021-03-17 at 16 48 19

Api 2:
Screenshot 2021-03-17 at 16 48 51

Is there any way to avoid this, maintaining the configuration autogenSWRKey active ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant