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

webpack-loader: allow loading multiple GraphQL Operations per file #4854

Open
ne0t3ric opened this issue Nov 16, 2022 · 1 comment
Open

webpack-loader: allow loading multiple GraphQL Operations per file #4854

ne0t3ric opened this issue Nov 16, 2022 · 1 comment

Comments

@ne0t3ric
Copy link

Is your feature request related to a problem? Please describe.

When I try to run tests with Jest, using @graphql-tools/jest-transform, I got an error with importing multiple GraphQL Operations from a .graphql file. The given error is :

GraphQL Webpack Loader allows only for one GraphQL Operation per file

import {deleteMenuMutation, upsertMenuMutation} from 'resources/graphql/menuMutations.graphql'

Describe the solution you'd like

Support the use of multiple GraphQL Operation per file , as it is intended in graphql-tag/loader
https://github.com/apollographql/graphql-tag/blob/ac4f0da2a3bc07f33312e5af9707a5fb2034edcd/loader.js

Describe alternatives you've considered

Separate mutations def in multiple graphql files, but it's not practical for every uses.

Additional context

@alexojegu
Copy link

And a typescript plugin similar to typescript-plugin-css-modules but for GraphQL it would be great, so as not to have errors when importing.

Related issue at graphql-tag: apollographql/graphql-tag#582

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