Add naming pipelines, buildTypeGraph, and printMutatedType to mutation engine#88
Merged
Merged
Conversation
…MutatedType
Moves all naming transforms into the mutation engine so that after mutation,
every type.name is its final GraphQL identifier. The renderer never touches names.
New modules:
- src/lib/naming.ts: Ordered naming pipelines (type, field, enum member, base)
with declared transform lists for visibility and enforced ordering.
- src/lib/template-composition.ts: Recursive template name composition
(PaginatedModel<AdAccount> → PaginatedModelOfAdAccount).
- src/mutation-engine/type-graph.ts: buildTypeGraph + TypeGraph interface for
packaging mutated types into a self-contained walkable namespace.
- src/mutation-engine/print-type.ts: printMutatedType for stringifying mutation
engine output as GraphQL type strings (e.g., "[String!]!").
Modified mutations to use full naming pipeline:
- Models: PascalCase + Interface suffix + Input suffix + template composition
- Properties: camelCase
- Enums: PascalCase
- Enum members: CONSTANT_CASE
- Operations: camelCase
- Scalars: PascalCase (user-defined only)
- Unions: consistent naming for oneOf models, wrapper models, and fields
Test restructuring:
- Split monolithic graphql-mutation-engine.test.ts (1071 lines) into 9 focused
test files by concern (enums, models, operations, scalars, unions, context,
naming-integration, type-graph, print-type).
- Nullability tests now assert GraphQL type strings via printMutatedType
for readability (e.g., expect(...).toBe("[String]!")).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
8 tasks
mauriciogardini
approved these changes
Jun 8, 2026
Removes the confusing double-parenthesis formatting from the negated boolean expression. Each exclusion condition is now a clear guard clause. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This was referenced Jun 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
type.nameis the final GraphQL identifierbuildTypeGraphfor packaging mutated types into a self-contained TypeGraph (ref: Timothee's TypeGraph concept)printMutatedTypefor stringifying mutation output as GraphQL type stringsNew modules
src/lib/naming.tssrc/lib/template-composition.tsTemplatedTypesrc/mutation-engine/type-graph.tsbuildTypeGraph+TypeGraphinterface (inter-stage/inter-emitter contract)src/mutation-engine/print-type.tsprintMutatedType— renders mutation output as GraphQL type stringNaming pipeline design
Transforms are declared as ordered lists — order enforced by position:
Context-dependent suffixes (Input, Interface) are pipeline steps that no-op when their flag is false.
Test plan
tsc -p .)🤖 Generated with Claude Code