1- import { emitFile , interpolatePath , type EmitContext } from "@typespec/compiler" ;
2- import { printSchema } from "graphql" ;
1+ import { emitFile , interpolatePath , type Diagnostic , type EmitContext } from "@typespec/compiler" ;
2+ import { type GraphQLSchema , printSchema } from "graphql" ;
33import type { ResolvedGraphQLEmitterOptions } from "./emitter.js" ;
44import type { GraphQLEmitterOptions } from "./lib.js" ;
5+ import type { Schema } from "./lib/schema.js" ;
56import { listSchemas } from "./lib/schema.js" ;
67import { createSchemaEmitter } from "./schema-emitter.js" ;
7- import type { GraphQLSchemaRecord } from "./types.js" ;
8+
9+ interface GraphQLSchemaRecord {
10+ readonly schema : Schema ;
11+ readonly graphQLSchema : GraphQLSchema ;
12+ readonly diagnostics : readonly Diagnostic [ ] ;
13+ }
814
915export function createGraphQLEmitter (
1016 context : EmitContext < GraphQLEmitterOptions > ,
@@ -34,7 +40,6 @@ export function createGraphQLEmitter(
3440 await emitFile ( program , {
3541 path : filePath ,
3642 content : printSchema ( schemaRecord . graphQLSchema ) ,
37- newLine : options . newLine ,
3843 } ) ;
3944 }
4045 }
@@ -47,7 +52,7 @@ export function createGraphQLEmitter(
4752 schemas . push ( { type : program . getGlobalNamespaceType ( ) } ) ;
4853 }
4954 for ( const schema of schemas ) {
50- const schemaEmitter = createSchemaEmitter ( schema , context , options ) ;
55+ const schemaEmitter = createSchemaEmitter ( schema , context , context . options ) ;
5156 const document = await schemaEmitter . emitSchema ( ) ;
5257 if ( document === undefined ) {
5358 continue ;
0 commit comments