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

deprecate package once graphql-codegen support is fixed #184

Open
n1ru4l opened this issue Sep 25, 2020 · 2 comments
Open

deprecate package once graphql-codegen support is fixed #184

n1ru4l opened this issue Sep 25, 2020 · 2 comments

Comments

@n1ru4l
Copy link
Owner

n1ru4l commented Sep 25, 2020

Once flattenGeneratedTypes is fixed and does inline operations this package can be deprecated and a link to graphql-codegen can be added.

I already tried re-searching some time ago why inlining fragments are broken on graphql-codegen, but due to complexity (package layering) and limited time I had to stop it.

Yesterday I tried upgrading and checked again, but graphql-codegen still did not inline fragments for the operations.

@samlof
Copy link

samlof commented Apr 9, 2022

Seems like flattenGeneratedTypes still not fixed? At least I didn't get it to work with newest @graphql-codegen/cli@2.6.2, @graphql-codegen/typescript@2.4.8 and @graphql-codegen/typescript-operations@2.3.5. All the fragments are back to being fragments instead of inlined.

Tried running with codegen.yml

overwrite: true
schema: "http://localhost:3030/query"
documents:
  - "src/**/*.graphql"
  - "src/**/*.tsx"
generates:
  src/generated/introspection.ts:
    plugins:
      - "urql-introspection"

  src/generated/graphql.ts:
    plugins:
      - "typescript"
      - "typescript-operations"
      - "typescript-urql"
    config:
      dedupeOperationSuffix: true
      omitOperationSuffix: true
      skipDocumentsValidation: true
      flattenGeneratedTypes: true
      flattenGeneratedTypesIncludeFragments: true

@n1ru4l
Copy link
Owner Author

n1ru4l commented Apr 9, 2022

Yes that is correct. Probably the solution will be to reimplement the relay compiler logic within codegen itself at some point as the relay-compiler moved to rust

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

2 participants