Skip to content

Commit 135a092

Browse files
committed
Regenerate doc snippet and llm-docs for new exports
The build.sh check that detects uncommitted changes was failing because 01-types-implement-interface.out didn't reflect the new getTypeName and personClassMap exports, and llm-docs/guides/node-spec.md was using a different list-bullet style than the rest of llm-docs.
1 parent 6dedaa6 commit 135a092

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

llm-docs/guides/node-spec.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ The [Global Object Identification](https://graphql.org/learn/global-object-ident
44

55
The spec requires:
66

7-
- A `Node` interface with a single `id: ID!` field
8-
- A root `node(id: ID!): Node` query field that can fetch any `Node` by its global ID
9-
- A root `nodes(ids: [ID!]!): [Node]!` query field for batch fetching
7+
- A `Node` interface with a single `id: ID!` field
8+
- A root `node(id: ID!): Node` query field that can fetch any `Node` by its global ID
9+
- A root `nodes(ids: [ID!]!): [Node]!` query field for batch fetching
1010

1111
Grats provides several features that make implementing this spec straightforward, with full static type safety.
1212

@@ -94,5 +94,5 @@ This eliminates the common bug of adding a `Node` implementor but forgetting to
9494

9595
Grats generates two exports in `schema.ts` that power this pattern:
9696

97-
- **`nodeClassMap`** — An object mapping GraphQL typenames to their class constructors for every type that implements the `Node` interface. Grats generates one of these maps per interface in your schema.
98-
- **`getTypeName`** — A function that returns the GraphQL typename for any class instance, using the same prototype-chain resolution that GraphQL uses internally. This lets you encode global IDs without defining `__typename` on your classes.
97+
- **`nodeClassMap`** — An object mapping GraphQL typenames to their class constructors for every type that implements the `Node` interface. Grats generates one of these maps per interface in your schema.
98+
- **`getTypeName`** — A function that returns the GraphQL typename for any class instance, using the same prototype-chain resolution that GraphQL uses internally. This lets you encode global IDs without defining `__typename` on your classes.

website/docs/04-docblock-tags/snippets/01-types-implement-interface.out

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,7 @@ function resolveType(obj: any): string {
7070
}
7171
throw new Error("Cannot find type name.");
7272
}
73+
export const getTypeName = resolveType;
74+
export const personClassMap = {
75+
User: UserClass
76+
};

0 commit comments

Comments
 (0)