A Babel plugin that minifies GraphQL queries written as tagged template literals at build time. Current version 1.0.1 removes unnecessary whitespace from gql template strings, transforming them into compact queries. The tool is simple and focused, with no runtime overhead since minification occurs during compilation. It is an alternative to other GraphQL minifiers like graphql-minify or custom babel transforms, but is extremely lightweight and easy to set up via .babelrc. The package is maintained with a low release cadence.
npm install graphql-minNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows Babel configuration and a tagged template literal that gets minified at build time.
Ensure .babelrc includes 'graphql-min/babel' in plugins array.
Use require('graphql-min').default instead.N/A
Install graphql-min with npm i graphql-min and ensure node_modules is accessible.
Change const gql = require('graphql-min') to const gql = require('graphql-min').default.Use default import: import gql from 'graphql-min'.