Command-line interface for soda-gql code generation. The CLI binary soda-gql is provided by the @soda-gql/tools package, which also includes codegen (@soda-gql/tools/codegen), typegen (@soda-gql/tools/typegen), and formatter (@soda-gql/tools/formatter).
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 |
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: