Registry / devops / graphql-codegen-typescript-common

graphql-codegen-typescript-common

JSON →
library0.18.2jsnpmunverified

Deprecated template plugin for GraphQL Code Generator v0.x that generates TypeScript types for client-side and server-side GraphQL operations. Superseded by @graphql-codegen/typescript (client types) and @graphql-codegen/typescript-operations (operations) in v1.0.0+. Last version 0.18.2, now archived. Use modern plugins from @graphql-codegen/cli v1+ for current GraphQL schema support.

npm install graphql-codegen-typescript-common
INSTALL
IMPORT
SIG · GRAPHQL-CODEGEN-TY
G
graphql-codegen-typescript-common
devopsjavascriptv0.18.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

TypeScriptCommonTemplate
import { TypeScriptCommonTemplate } from 'graphql-codegen-typescript-common'
Used in codegen.yml as template property; deprecated in favor of @graphql-codegen/typescript
default template
// codegen.yml template: typescript-common
template: graphql-codegen-typescript-common
In codegen.yml, use the template name string 'typescript-common', not the package name
TypeScriptDocumentsTemplate
import { TypeScriptDocumentsTemplate } from 'graphql-codegen-typescript-common'
import TypeScriptDocumentsTemplate from 'graphql-codegen-typescript-common'
Named export, not default; this template is for operation types, separated in v1+ to @graphql-codegen/typescript-operations

Sets up GraphQL Code Generator v0.18 with deprecated TypeScript common template to generate types from schema and documents.

// Install (deprecated) npm install graphql-codegen-typescript-common@0.18.2 graphql-codegen-cli@0.18.2 // codegen.yml schema: http://localhost:4000/graphql documents: ./src/**/*.graphql generates: ./src/types/graphql.ts: - typescript-common - typescript-documents // Run npx gql-gen
Debug
Known issues
breakingTemplate 'typescript-common' and 'typescript-documents' are removed in @graphql-codegen/cli v1.0.0. Use @graphql-codegen/typescript and @graphql-codegen/typescript-operations instead.
fix
Replace with npm install @graphql-codegen/typescript @graphql-codegen/typescript-operations and update codegen.yml: plugins: ['typescript']
affects: >=1.0.0
deprecatedThis package is archived and will not receive updates for new GraphQL spec features (e.g., @defer, @stream).
fix
Migrate to @graphql-codegen/cli v1+ with modern plugins.
affects: *
gotchaCodegen v0.x uses a different configuration format than v1.x. The 'template' property is replaced by 'plugins' array.
fix
For v0: use 'template: typescript-common'. For v1: use 'plugins: ['typescript']'.
affects: >=0.18.0 <1.0.0
Errors
Common errors & fixes
TypeError: Cannot read property 'definitions' of undefined
Schema file missing or invalid; codegen v0.x expects a valid introspection result or SDL file.
fix
Ensure schema path points to valid .graphql file or introspection JSON. Check schema URL if using live endpoint.
The 'graphql-codegen-typescript-common' package doesn't export anything (exports: {}).
Importing the wrong symbol; this package exports TypeScriptCommonTemplate, but it's not meant to be used directly in runtime code.
fix
Use the package in codegen.yml configuration, not in JS/TS imports. For runtime use, upgrade to v1 plugins.
Cannot find module 'graphql-codegen-typescript-common'
Package not installed or version mismatch; v0.x template packages must match codegen-cli v0.x exactly.
fix
npm install graphql-codegen-typescript-common@0.18.2 graphql-codegen-cli@0.18.2
Upgrade
Version history
0.18.2latest on npm
Audit
Dependencies
graphql-codegen-clioptionalrequires graphql-codegen-cli as peer dependency to execute template
Agent activity
6 hits · last 30 days
node
6
Resources
graphql-codegen-typescript-common — npm install graphql-codegen-typescript-common · libregistry