-
Notifications
You must be signed in to change notification settings - Fork 0
Tamp GraphQLCodegen
Wrapper for graphql-code-generator 5 — generates typed clients from a GraphQL schema. Small CLI surface; the plugin ecosystem shifts independently.
using Tamp.GraphQLCodegen.V5;Full reference: https://github.com/tamp-build/tamp-graphql-codegen.
GraphQLCodegen.Generate(tool, s => …) // the default invocation (no subverb token)
GraphQLCodegen.Init(tool, s => …) // interactive scaffold
GraphQLCodegen.Raw(tool, …) // escape hatchCommon flags (all verbs): --silent, --verbose, --debug, --errors-only, --profile, --require <module> (repeatable, order-preserving).
Generate-specific: --config, --overwrite, --watch [pattern], --project.
The plugins (@graphql-codegen/typescript, @graphql-codegen/typescript-operations, …) are not bundled with @graphql-codegen/cli. They have to be installed separately and resolvable from the project's CWD. In CI we install them globally and let Node's NODE_PATH fallback find them; in production builds they're in devDependencies so CWD resolution Just Works.
If you ever see this error chain from codegen:
[FAILED] - codegen-typescript
[FAILED] - codegen-typescript-template
[FAILED] - typescript
…it means the plugin packages aren't reachable from the working directory. Add them to package.json or set NODE_PATH to point at the global node_modules.
[NuGetPackage("graphql-codegen", UseSystemPath = true)]
readonly Tool Codegen = null!;
Target Codegen => _ => _.Executes(() =>
GraphQLCodegen.Generate(Codegen, s => s
.SetConfig("codegen.ts")
.SetOverwrite()
.SetWorkingDirectory(RootDirectory / "frontend")));- Module Catalog
- Satellite repo: https://github.com/tamp-build/tamp-graphql-codegen
The example(s) above use the fluent Set*-chain shape. Every wrapper verb on this page also accepts a new XxxSettings { ... } object-init form. Both produce identical CommandPlans; the fluent shape stays canonical in docs and the tamp init template. See Build Script Authoring → Two authoring styles for the side-by-side comparison.
Start here
Modules
- Module Catalog (canonical list, 50+ satellites)
- .NET toolchain
- Containers
- JS toolchain
- Supply-chain security
Analyzers
Tooling
Execution
CI integration
Editor integration
Migration
Reference
Project