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

[@rollup/plugin-graphql] Processing GraphQL queries declared in template files #1687

Open
lermontex opened this issue Feb 24, 2024 · 0 comments

Comments

@lermontex
Copy link

lermontex commented Feb 24, 2024

  • Rollup Plugin Name: @rollup/plugin-graphql
  • Rollup Plugin Version: 2.0.4

Feature Use Case

I'm using Vue 3 + Apollo GraphQL (composition API). I don’t use additional files (.gql/.graphql) to store GraphQL queries, but write them directly in files with the .vue extension, here’s a simple example:

// ...
import { gql } from "@apollo/client/core";
// ...

    const {
      mutate: createInvoiceMutationMutate,
    } = useMutation(
      gql`
        mutation createInvoice($input: createInvoiceInput!) {
          createInvoice(input: $input) {
            clientMutationId
            invoice {
              id
            }
          }
        }
      `,
    );

Unfortunately, at the moment there is no way to handle such a GraphQL query using @rollup/plugin-graphql

Feature Proposal

It would be great to be able to handle GraphQL queries that are declared in template files if they are wrapped in gql literal

UPD:
https://github.com/apollographql/graphql-tag

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

1 participant