next-graphql-loader
Allows importing .graphql or .gql files on Nextjs via graphql-tag.
Installation
npm install --save graphql next-graphql-loader
Or using yarn:
yarn add graphql next-graphql-loader
Then, import the library in your next.config.js
file.
// next.config.jsconst withGraphql = ; moduleexports = ;
or, with next-compose-plugins
:
const withGraphql = ; moduleexports =
Usage:
Just import any .graphql file :)