A TypeScript custom transformer that compiles GraphQL tagged template strings (gql) at build time using graphql-tag. Version 0.2.1 is the latest stable release; no frequent updates. Key differentiators: reduces bundle size by removing graphql-tag dependency (~50 KB), speeds up runtime initialization, and works with Webpack (awesome-typescript-loader, ts-loader) and FuseBox. It removes imports of graphql-tag and replaces gql`...` with compiled AST objects. Only supports TypeScript; alternatives include babel-plugin-graphql-tag for Babel users.
npm install ts-transform-graphql-tagNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to integrate the transformer with ts-loader in a Webpack config.
Use a bundler (Webpack/FuseBox) or a custom build step with ts-patch.
Only import graphql-tag for gql template literals; do not rely on it for other runtime imports.
Keep graphql as a production dependency.
Use `getCustomTransformers: () => ({ before: [getTransformer()] })` instead of a plain object.Install graphql-tag as a dev dependency: `npm install --save-dev graphql-tag`.