Command-line interface for soda-gql code generation.
This documentation is being developed.
codegenGenerate the type-safe GraphQL system from your schema:
| Option | Description |
|---|---|
--config <path> | Path to config file (default: soda-gql.config.ts) |
--emit-inject-template <path> | Generate scalar/adapter template file |
--prebuilt | Generate prebuilt types module alongside regular output |
codegen graphqlGenerate TypeScript compat code from existing .graphql operation files:
This is useful for:
.graphql filesOptions:
| Option | Description |
|---|---|
--config <path> | Path to config file |
--schema <name> | Schema name (required if multiple schemas configured) |
--input <glob> | Glob pattern for .graphql files (repeatable) |
--output <dir> | Output directory for generated files |
Example:
Given src/queries/GetUser.graphql:
Running:
Generates src/generated/GetUser.compat.ts:
builderGenerate runtime artifacts during development:
Create a soda-gql.config.ts file: