Skip to content

Commit 67bad85

Browse files
committed
Merge update
1 parent b51672b commit 67bad85

File tree

2 files changed

+2433
-8308
lines changed

2 files changed

+2433
-8308
lines changed

graphql/codegen/src/codegen.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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

253253
function buildTypeIndex(introspection: any) {

0 commit comments

Comments
 (0)