@@ -33,7 +33,7 @@ function addDocumentNodeImport(code: string): string {
3333 return output . code
3434}
3535
36- function getFilename ( key : string , convention : LaunchQLGenOptions [ 'documents' ] [ 'convention' ] ) {
36+ function getFilename ( key : string , convention : GraphQLCodegenOptions [ 'documents' ] [ 'convention' ] ) {
3737 if ( convention === 'underscore' ) return inflection . underscore ( key )
3838 if ( convention === 'dashed' ) return inflection . underscore ( key ) . replace ( / _ / g, '-' )
3939 if ( convention === 'camelUpper' ) return inflection . camelize ( key , false )
@@ -118,15 +118,15 @@ async function writeOperationsDocuments(docs: Record<string, string>, dir: strin
118118 if ( format === 'ts' ) await writeFileUTF8 ( join ( dir , 'index.ts' ) , index . sort ( ) . join ( '\n' ) )
119119}
120120
121- export async function runCodegen ( opts : LaunchQLGenOptions , cwd : string ) {
122- const options : LaunchQLGenOptions = {
123- input : { ...( defaultLaunchQLGenOptions . input ) , ...( opts . input || { } ) } ,
124- output : { ...( defaultLaunchQLGenOptions . output ) , ...( opts . output || { } ) } ,
125- documents : { ...( defaultLaunchQLGenOptions . documents ) , ...( opts . documents || { } ) } ,
126- features : { ...( defaultLaunchQLGenOptions . features ) , ...( opts . features || { } ) } ,
127- selection : { ...( defaultLaunchQLGenOptions . selection ) , ...( opts . selection || { } ) } ,
128- scalars : { ...( defaultLaunchQLGenOptions . scalars || { } ) , ...( opts . scalars || { } ) } ,
129- typeNameOverrides : { ...( defaultLaunchQLGenOptions . typeNameOverrides || { } ) , ...( opts . typeNameOverrides || { } ) }
121+ export async function runCodegen ( opts : GraphQLCodegenOptions , cwd : string ) {
122+ const options : GraphQLCodegenOptions = {
123+ input : { ...( defaultGraphQLCodegenOptions . input ) , ...( opts . input || { } ) } ,
124+ output : { ...( defaultGraphQLCodegenOptions . output ) , ...( opts . output || { } ) } ,
125+ documents : { ...( defaultGraphQLCodegenOptions . documents ) , ...( opts . documents || { } ) } ,
126+ features : { ...( defaultGraphQLCodegenOptions . features ) , ...( opts . features || { } ) } ,
127+ selection : { ...( defaultGraphQLCodegenOptions . selection ) , ...( opts . selection || { } ) } ,
128+ scalars : { ...( defaultGraphQLCodegenOptions . scalars || { } ) , ...( opts . scalars || { } ) } ,
129+ typeNameOverrides : { ...( defaultGraphQLCodegenOptions . typeNameOverrides || { } ) , ...( opts . typeNameOverrides || { } ) }
130130 }
131131
132132 const root = join ( cwd , options . output . root )
@@ -246,8 +246,8 @@ export async function runCodegenFromJSONConfig(configPath: string, cwd: string)
246246 } catch ( e ) {
247247 throw new Error ( 'Invalid JSON config: ' + e )
248248 }
249- const merged = mergeLaunchQLGenOptions ( defaultLaunchQLGenOptions , overrides as any )
250- return runCodegen ( merged as LaunchQLGenOptions , cwd )
249+ const merged = mergeGraphQLCodegenOptions ( defaultGraphQLCodegenOptions , overrides as any )
250+ return runCodegen ( merged as GraphQLCodegenOptions , cwd )
251251}
252252
253253function buildTypeIndex ( introspection : any ) {
0 commit comments