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

Not compatible with typescript-urql-graphcache #617

Open
villesau opened this issue Feb 13, 2022 · 0 comments · May be fixed by #618
Open

Not compatible with typescript-urql-graphcache #617

villesau opened this issue Feb 13, 2022 · 0 comments · May be fixed by #618

Comments

@villesau
Copy link

villesau commented Feb 13, 2022

typescript-urql-graphcache is a bit similar to typescript plugin: It cannot be generated on per-file basis as it generates single type from the schema it self. This means that if I want full type safety for my graph-cache, I cannot rely on graphql-let only and I still need to manually invoke graphql-codegen. It might be related to this: https://github.com/piglovesyou/graphql-let#no-generates but all the links are broken.

Is there a way to inject more plugins that generates types to __types__.tsx ?

Source of the typescript-urql-graphcache: https://github.com/dotansimha/graphql-code-generator/tree/master/packages/plugins/typescript/urql-graphcache

An example config with graphql-codegen would be something like this:

schema: schema.graphql
documents:
  - '**/*.graphql'
generates:
  src/graphql/types.generated.ts:
    plugins:
      - typescript
      - typescript-urql-graphcache
@villesau villesau linked a pull request Feb 13, 2022 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant