.graphql, .gql import error
See original GitHub issueEnvironment
- Operating System:
Linux
- Node Version:
v14.18.1
- Nuxt Version:
3.0.0-27245461.ffb05fc
- Package Manager:
Yarn
- Bundler:
Vite
- User Config:
ssr
,buildModules
,css
,vite
- Runtime Modules:
-
- Build Modules:
nuxt-windicss@2.0.3
Describe the bug
Rollup does not support graphql files.
ERROR Rollup error: Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
Reproduction
Import graphql file like:
import Product from './graphs/product.graphql';
Additional context
No response
Logs
No response
Issue Analytics
- State:
- Created 2 years ago
- Reactions:7
- Comments:7 (3 by maintainers)
Top Results From Across the Web
How to solve GraphQl ImportError - cannot import name 'gql ...
I tried using the Basic example available on Official Github Page. in my Python IDLE. However, I am getting this ImportError in my...
Read more >Typescript: import fail: Cannot find module 'query.gql' #59
when you do: import schema from './schema.graphql'; , you import default property of the module, but exported doc doesn't have it, so it...
Read more >Loading queries with Webpack - Apollo GraphQL Docs
You can load GraphQL queries over .graphql files using Webpack. ... As you can see, .graphql or .gql files will be parsed whenever...
Read more >graphql-import-files - npm
Start using graphql-import-files in your project by running `npm i graphql-import-files`. There are no other projects in the npm registry ...
Read more >The graphql module exports a core subset of GraphQL ...
import { graphql } from 'graphql'; // ES6. var { graphql } = require('graphql') ... Format an error according to the rules described...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@ririen I got to work but with another plugin. Here’s how you can get it to work:
First, install the rollup graphql plugin:
Closing as this isn’t a bug. Likely integrations with graphql will be implemented with nuxt modules.