Webpack loader for Next.js that enables importing .graphql and .gql files, transforming them into compiled GraphQL documents via graphql-tag/loader. Current stable version is 1.0.1, with no active development or recent releases. It wraps graphql-tag/loader for use in Next.js webpack configuration, but the documentation incorrectly references next-svgr-react-component instead of the actual loader. Low maintenance project, suitable for simple use cases.
npm install next-graphql-loaderNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows correct webpack plugin setup in next.config.js and importing a .graphql file in a Next.js page.
Use const withGraphql = require('next-graphql-loader');Run npm install graphql alongside next-graphql-loader.
Pin graphql to ^15.0.0 as specified in peerDependencies.
npm install graphql
Ensure graphql and graphql-tag are installed: npm install graphql graphql-tag