File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import {
22 createDiagnosticCollector ,
33 navigateTypesInNamespace ,
4+ UsageFlags ,
45 type Diagnostic ,
56 type DiagnosticCollector ,
67 type EmitContext ,
@@ -57,13 +58,14 @@ class GraphQLSchemaEmitter {
5758 this . registry . addEnum ( node ) ;
5859 } ,
5960 model : ( node : Model ) => {
60- // Add logic to handle the model node
61+ // TODO: Determine usageFlag from mutation engine or usage tracking
62+ this . registry . addModel ( node , UsageFlags . Output ) ;
6163 } ,
6264 exitEnum : ( node : Enum ) => {
6365 this . registry . materializeEnum ( node . name ) ;
6466 } ,
6567 exitModel : ( node : Model ) => {
66- // Add logic to handle the exit of the model node
68+ this . registry . materializeModel ( node . name ) ;
6769 } ,
6870 } ;
6971 }
Original file line number Diff line number Diff line change @@ -2,9 +2,19 @@ import { strictEqual } from "node:assert";
22import { describe , it } from "vitest" ;
33import { emitSingleSchema } from "./test-host.js" ;
44
5- // For now, the expected output is a placeholder string.
6- // In the future, this should be replaced with the actual GraphQL schema output.
7- const expectedGraphQLSchema = `type Query {
5+ const expectedGraphQLSchema = `type Book {
6+ name: String
7+ page_count: String
8+ published: String
9+ price: String
10+ }
11+
12+ type Author {
13+ name: String
14+ books: String
15+ }
16+
17+ type Query {
818 """
919 A placeholder field. If you are seeing this, it means no operations were defined that could be emitted.
1020 """
You can’t perform that action at this time.
0 commit comments