Registry / devops / graphql-fast-api

graphql-fast-api

JSON →
library1.0.58jsnpmunverified

GraphQL Fast API is a Node.js framework for building GraphQL APIs with minimal boilerplate and high performance. Version 1.0.58 is the current stable release, updated weekly. It provides automatic schema generation from TypeScript definitions, built-in subscription support, and a plugin system for extensibility. Unlike Apollo Server or express-graphql, it focuses on zero-configuration setup, code-first development, and leverages fast serialization for low latency. Supports both ESM and CommonJS, with full TypeScript types.

npm install graphql-fast-api
INSTALL
IMPORT
SIG · GRAPHQL-FAST-API
G
graphql-fast-api
devopsjavascriptv1.0.58
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.

createFastAPI
import { createFastAPI } from 'graphql-fast-api'
const createFastAPI = require('graphql-fast-api')
Default export available; named export preferred. ESM-only since v1.
defineType
import { defineType } from 'graphql-fast-api'
import defineType from 'graphql-fast-api'
Named export, not default. Used for defining GraphQL types in code-first approach.
GraphQLFastAPI
import { GraphQLFastAPI } from 'graphql-fast-api'
const GraphQLFastAPI = require('graphql-fast-api').GraphQLFastAPI
Class-based alternative; use createFastAPI factory function instead for simplicity.

Creates a minimal GraphQL server with a single hello query using type definitions and resolvers.

import { createFastAPI, defineType } from 'graphql-fast-api'; const typeDefs = defineType(` type Query { hello: String } `); const resolvers = { Query: { hello: () => 'Hello, world!' } }; const app = createFastAPI({ schema: { typeDefs, resolvers } }); app.listen({ port: 4000 }).then(() => { console.log('Server running on http://localhost:4000/graphql'); });
Debug
Known issues
breakingIn v1.0.0, the createFastAPI function changed from accepting a single config object to requiring a schema property. Older usage with direct schema will break.
fix
Update to latest version and wrap resolver/handler config inside a `schema` object.
affects: <1.0.0
deprecatedThe `useGraphQLMiddleware` function is deprecated. Use `createFastAPI` with middleware plugins instead.
fix
Replace `useGraphQLMiddleware(app, options)` with `app.use(plugin)` where plugin is a compatible middleware plugin.
affects: >=1.0.30
gotchaResolvers must return plain objects for custom scalars; native GraphQL scalar types are automatically serialized.
fix
Ensure custom scalar resolvers return values that match the specified serialization format.
affects: >=1.0.0
breakingIn v1.0.45, the `subscriptions` configuration was moved from server options to a separate `subscriptions` object in the schema definition.
fix
Move subscription definitions inside `schema.subscriptions` instead of passing them as server options.
affects: >=1.0.45 <1.0.50
Errors
Common errors & fixes
Error: Cannot find module 'graphql-fast-api'
Package not installed or incorrect import path.
fix
Run `npm install graphql-fast-api` and ensure using the correct import statement.
TypeError: createFastAPI is not a function
CommonJS require used but package is ESM-only.
fix
Change to import statement: `import { createFastAPI } from 'graphql-fast-api'`.
GraphQLError: Type "Query" is not defined.
Missing type definition for Query in schema.
fix
Ensure your typeDefs include at least one Query type with a field.
Upgrade
Version history
1.0.58latest on npm
Audit
Dependencies
graphqloptionalPeer dependency for GraphQL schema execution and type system.
Agent activity
6 hits · last 30 days
node
6
Resources
graphql-fast-api — npm install graphql-fast-api · libregistry