Registry / testing / typed-graphql

typed-graphql

JSON →
library1.0.2jsnpmunverified

Deprecated community type definitions for graphql-js, version 1.0.2. This package was a stopgap for TypeScript 2 users before graphql-js shipped its own types. It must be used with the `typings` tool or via a `/// <reference types="typed-graphql" />` directive. No longer maintained; graphql-js has included its own TypeScript definitions since v14. Modern projects should use `graphql` directly with `@types/graphql` or the built-in types.

npm install typed-graphql
INSTALL
IMPORT
SIG · TYPED-GRAPHQL
T
typed-graphql
testingjavascriptv1.0.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.

type definitions
/// <reference types="typed-graphql" /> in a .d.ts file
import { GraphQLSchema } from 'typed-graphql'
This package provides ambient type declarations, not runtime exports. Use a triple-slash reference directive or a tsconfig path mapping.
GraphQLSchema
import { GraphQLSchema } from 'graphql';
import { GraphQLSchema } from 'typed-graphql';
All type definitions re-export from graphql. Import runtime values from graphql, not from typed-graphql.
require('typed-graphql')
const graphql = require('graphql');
const graphql = require('typed-graphql');
typed-graphql provides no JavaScript runtime; it is a declaration-only package.

Shows installation, TypeScript reference setup, and basic graphql-js usage with typed-graphql for type definitions. Note: modern projects should skip typed-graphql and use graphql's built-in types.

// Step 1: Install npm install --save-dev typed-graphql // Step 2: Add reference in a .d.ts file /// <reference types="typed-graphql" /> // Or in tsconfig.json: { "compilerOptions": { "types": ["typed-graphql"] } } // Step 3: Use graphql normally import { buildSchema, graphqlSync } from 'graphql'; const schema = buildSchema(` type Query { hello: String } `); const source = '{ hello }'; const root = { hello: () => 'world' }; const result = graphqlSync({ schema, source, rootValue: root }); console.log(result);
Debug
Known issues
deprecatedThis package is deprecated. graphql-js v14+ ships its own TypeScript definitions.
fix
Remove typed-graphql dependency. Upgrade graphql to v14 or later and ensure TypeScript can find its built-in types.
affects: >=0.0.0
gotchaTyped-graphql does not expose any runtime exports; importing from 'typed-graphql' fails at runtime.
fix
Do not import runtime code from typed-graphql. Always import from 'graphql' instead.
affects: >=0.0.0
gotchaRequires manual triple-slash reference or typings registration to be recognized by TypeScript.
fix
Add /// <reference types="typed-graphql" /> in a .d.ts file, or set 'types' in tsconfig.json.
affects: >=0.0.0
gotchaThis package may lag behind graphql-js releases, causing missing or outdated types.
fix
Use graphql's built-in types or @types/graphql instead.
affects: >=0.0.0
Errors
Common errors & fixes
Cannot find module 'typed-graphql'
Importing runtime from typed-graphql instead of graphql.
fix
Replace all imports from 'typed-graphql' with imports from 'graphql'.
Module '"typed-graphql"' resolves to a type-only module and is not importable at runtime.
TypeScript tries to use typed-graphql as a runtime module.
fix
Remove import statements from typed-graphql; use reference directives instead.
Unable to resolve reference: typed-graphql
Triple-slash reference not recognized because the package is not installed or not in typings.
fix
Ensure typed-graphql is installed as a devDependency and added to tsconfig's types array.
Upgrade
Version history
1.0.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
typed-graphql — npm install typed-graphql · libregistry