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

Support Query/Mutation filtering #13

Open
nabeix opened this issue Apr 29, 2021 · 1 comment
Open

Support Query/Mutation filtering #13

nabeix opened this issue Apr 29, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@nabeix
Copy link
Member

nabeix commented Apr 29, 2021

Problem

We need generate documents for multiple client from one schema.
GraphQL documents generates documents of all Query/Mutation.
So, the generated documents includes unnecessary document for a client.
It makes overhead of module size.

Suggestion

codegen.yml

overwrite: true
schema:
  - ./schemas/**/*.graphql

generates:
  ./documents/index.graphql:
    plugins:
      - graphql-codegen-documents
    config:
      - tags:
          - client

index.graphql

type Query {
  books(first: Int!, offset: Int!): BooksConnection!  # graphql-codegen-documents: tag=client

  user(first: Int!, offset: Int!): UserConnection! # this is always target
}

I don't know graphql codegen plugin can read # comment line.

@nabeix nabeix added the enhancement New feature or request label Apr 29, 2021
@nabeix
Copy link
Member Author

nabeix commented Apr 29, 2021

Directive is better than comment.
https://www.graphql-tools.com/docs/schema-directives/

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

No branches or pull requests

1 participant