Use Graphql files with Next.js
npm install next-plugin-graphqlor
yarn add next-plugin-graphqlCreate a next.config.js in your project
// next.config.js
const withGraphql = require('next-plugin-graphql')
module.exports = withGraphql()Optionally you can add your custom Next.js configuration as parameter
// next.config.js
const withGraphql = require('next-plugin-graphql')
module.exports = withGraphql({
webpack(config, options) {
return config
}
})