Skip to content

Commit 0fba3fe

Browse files
[graphql] Add ./mutation-engine subpath export for standalone mutation pipeline usage (#11565)
## Summary Add a `./mutation-engine` subpath export to `@typespec/graphql` to enable consumers to use the GraphQL mutation pipeline independently of the emitter. This allows for other future GraphQL related packages to use the GraphQL mutation engine to transform the input TSP into GraphQL compatible shapes in using the same library, reducing duplicate implementations. The subpath exports: - `mutateSchema`, `createGraphQLMutationEngine` — orchestration - `resolveTypeUsage` — type usage analysis (input vs output) - `GraphQLTypeContext`, `TypeGraph` — types - Mutation classes (`GraphQLModelMutation`, etc.) ## Test plan - [x] Existing tests pass (368 tests) - [x] Package builds successfully - [x] Subpath resolves correctly --------- Co-authored-by: Timothee Guerin <timothee.guerin@outlook.com>
1 parent 3aa5d51 commit 0fba3fe

3 files changed

Lines changed: 13 additions & 0 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking
3+
changeKind: fix
4+
packages:
5+
- "@typespec/graphql"
6+
---
7+
8+
Add `./mutation-engine` subpath export for standalone mutation pipeline usage

packages/graphql/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
"typespec": "./lib/main.tsp",
2525
"types": "./dist/src/index.d.ts",
2626
"default": "./dist/src/index.js"
27+
},
28+
"./mutation-engine": {
29+
"types": "./dist/src/mutation-engine/index.d.ts",
30+
"default": "./dist/src/mutation-engine/index.js"
2731
}
2832
},
2933
"engines": {

packages/graphql/src/mutation-engine/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
export { resolveTypeUsage, type TypeUsageResolver } from "../type-usage.js";
12
export { GraphQLMutationEngine, createGraphQLMutationEngine } from "./engine.js";
23
export {
34
GraphQLEnumMemberMutation,

0 commit comments

Comments
 (0)