Skip to content

Commit a062942

Browse files
committed
cleanup
1 parent c4d5642 commit a062942

4 files changed

Lines changed: 10 additions & 19 deletions

File tree

packages/graphql/src/lib/scalar-mappings.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export interface ScalarMapping {
1515

1616
/**
1717
* Mapping table for TypeSpec standard library scalars to GraphQL custom scalars.
18-
* Based on design doc: https://github.com/microsoft/typespec/issues/4933
1918
*/
2019
const SCALAR_MAPPINGS: Record<string, Record<string, ScalarMapping>> = {
2120
// int64 → BigInt (String)
@@ -48,7 +47,7 @@ const SCALAR_MAPPINGS: Record<string, Record<string, ScalarMapping>> = {
4847
},
4948
},
5049

51-
// bytes with different encodings
50+
// bytes — requires @encode to determine format; without encoding, no GraphQL mapping applies
5251
bytes: {
5352
base64: {
5453
graphqlName: "Bytes",
@@ -62,7 +61,7 @@ const SCALAR_MAPPINGS: Record<string, Record<string, ScalarMapping>> = {
6261
},
6362
},
6463

65-
// utcDateTime with different encodings
64+
// utcDateTime — requires @encode to determine wire format; no default mapping without encoding
6665
utcDateTime: {
6766
rfc3339: {
6867
graphqlName: "UTCDateTime",
@@ -80,7 +79,7 @@ const SCALAR_MAPPINGS: Record<string, Record<string, ScalarMapping>> = {
8079
},
8180
},
8281

83-
// offsetDateTime with different encodings
82+
// offsetDateTime — requires @encode to determine wire format; no default mapping without encoding
8483
offsetDateTime: {
8584
rfc3339: {
8685
graphqlName: "OffsetDateTime",
@@ -106,7 +105,7 @@ const SCALAR_MAPPINGS: Record<string, Record<string, ScalarMapping>> = {
106105
},
107106
},
108107

109-
// duration with different encodings
108+
// duration — requires @encode to determine wire format; no default mapping without encoding
110109
duration: {
111110
ISO8601: {
112111
graphqlName: "Duration",

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

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {
22
type Enum,
33
type Model,
4-
type Namespace,
54
type Operation,
65
type Program,
76
type Scalar,
@@ -59,7 +58,7 @@ export class GraphQLMutationEngine {
5958
*/
6059
private engine;
6160

62-
constructor(program: Program, _namespace: Namespace) {
61+
constructor(program: Program) {
6362
const tk = $(program);
6463
this.engine = new MutationEngine(tk, graphqlMutationRegistry);
6564
}
@@ -101,11 +100,8 @@ export class GraphQLMutationEngine {
101100
}
102101

103102
/**
104-
* Creates a GraphQL mutation engine for the given program and namespace.
103+
* Creates a GraphQL mutation engine for the given program.
105104
*/
106-
export function createGraphQLMutationEngine(
107-
program: Program,
108-
namespace: Namespace,
109-
): GraphQLMutationEngine {
110-
return new GraphQLMutationEngine(program, namespace);
105+
export function createGraphQLMutationEngine(program: Program): GraphQLMutationEngine {
106+
return new GraphQLMutationEngine(program);
111107
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ export {
66
GraphQLModelPropertyMutation,
77
GraphQLOperationMutation,
88
GraphQLScalarMutation,
9+
GraphQLUnionMutation,
910
} from "./mutations/index.js";

packages/graphql/test/mutation-engine/graphql-mutation-engine.test.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,8 @@ import { beforeEach, describe, expect, it } from "vitest";
44
import { createGraphQLMutationEngine } from "../../src/mutation-engine/index.js";
55
import { Tester } from "../test-host.js";
66

7-
/**
8-
* Helper to create the engine with the global namespace.
9-
* For unit tests, we use the global namespace since individual types
10-
* aren't placed in a custom namespace.
11-
*/
127
function createTestEngine(program: Parameters<typeof createGraphQLMutationEngine>[0]) {
13-
return createGraphQLMutationEngine(program, program.getGlobalNamespaceType());
8+
return createGraphQLMutationEngine(program);
149
}
1510

1611
describe("GraphQL Mutation Engine - Enums", () => {

0 commit comments

Comments
 (0)