A TypeScript Language Service Plugin that provides GraphQL features like auto-completion, diagnostics, type generation, and fragment navigation directly inside TypeScript IDE. Current stable version is 4.0.5, with a monthly release cadence. It supports TypeScript ≥4.8, GraphQL ≥15, and Node ≥18. Differentiators include CLI commands for typegen, extract, validate, and report, plus a webpack transformer for compile-time query-to-AST conversion. Ships TypeScript types.
npm install ts-graphql-pluginNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows tsconfig plugin setup, template literal tag for GraphQL query, CLI typegen, and usage of generated types.
Switch to ESM: use 'import' instead of 'require', and ensure your project is configured for ESM (e.g., 'type': 'module' in package.json).
Replace gql`...` with `#graphql\n ...` or a plain string.
Ensure 'schema' option points to a reachable introspection endpoint or local .graphql file.
Use tagged template literal with 'graphql' tag or include '#graphql' as first line comment.
Run 'npm install ts-graphql-plugin graphql typescript -D' and ensure TypeScript version ≥4.8.
Check 'schema' in tsconfig.json plugins section; use a valid URL or absolute path.
Verify 'name' is exactly 'ts-graphql-plugin' and restart your editor.
Set 'type': 'module' in package.json or use dynamic import().