Skip to content

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

@ne0t3ric

Description

@ne0t3ric

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions