TypeScript Nhost
GraphQL Code Generator plugin for Nhost Typescript SDK. It generates the schema for the Typescript Nhost SDK.
- Version
- 1.0.1
- Weekly downloads
- 539
- License
- MIT
- Updated
- Apr 19, 2026
Installation
npm i -D @graphql-codegen/typescript-nhost
yarn add -D @graphql-codegen/typescript-nhost
pnpm add -D @graphql-codegen/typescript-nhost
bun add -D @graphql-codegen/typescript-nhost
Config API Reference
scalars
type: object
Extends or overrides the built-in scalars and custom GraphQL scalars to a custom type.
This plugin generates the schema for the
Typescript Nhost SDK.
Usage
Step 1: Generate the schema
First, install GraphQL codegen and the Nhost Typescript plugin:
Then configure the code generator by adding a codegen.yaml file:
Step 2: Install and configure the Nhost Typescript SDK
A GraphQL query named todos will then be accessible through:
The todos object will be strongly typed based on the GraphQL schema, and the fields that would
have been selected in the query.
Custom scalars
It is possible to customize the scalar types in adapting the configuration file. The following
example illustrates how to specify some Hasura scalars. The @graphql-codegen/add plugin is
necessary to be able to add the definition of the JSONValue type.