babel-plugin-graphql-tag

JSON →
library 3.3.0 ·javascript
verified Jun 7, 2026

Compiles GraphQL tagged template strings using graphql-tag at build time, reducing bundle size by up to 50 KB and improving initialization speed. Current stable version is 3.3.0. It removes the graphql-tag dependency from the runtime by pre-compiling gql template literals into AST objects. Supports both import and require() for graphql-tag and @apollo/client. Options include importSources, onlyMatchImportSuffix, strip, transform, and gqlTagIdentifiers. It handles fragments via template literal interpolation. Known issues involve dynamic require() detection. Release cadence is low, with sporadic updates.