@rematter/genql
Advanced tools
Comparing version 7.1.0-rc1 to 7.1.0-rc2
@@ -16,2 +16,6 @@ #!/usr/bin/env node | ||
const parse_1 = require("./helpers/parse"); | ||
const configFilePath = (0, node_path_1.resolve)(process.cwd(), '.genqlrc.js'); | ||
const baseConfig = (0, node_fs_1.existsSync)(configFilePath) | ||
? require(configFilePath) | ||
: {}; | ||
const program = yargs_1.default | ||
@@ -21,3 +25,3 @@ .option('output', { | ||
description: 'Output directory', | ||
required: true, | ||
demandOption: !!baseConfig.output, | ||
type: 'string', | ||
@@ -40,3 +44,2 @@ }) | ||
}) | ||
// .array('header', ) | ||
.option('header', { | ||
@@ -74,4 +77,2 @@ alias: 'H', | ||
.help('h').argv; | ||
const configFilePath = (0, node_path_1.resolve)(process.cwd(), '.genqlrc.js'); | ||
const baseConfig = (0, node_fs_1.existsSync)(configFilePath) ? require(configFilePath) : {}; | ||
// .option('-o, --output <./myClient>', 'output directory') | ||
@@ -93,10 +94,14 @@ // .option('-e, --endpoint <http://example.com/graphql>', 'GraphQL endpoint') | ||
endpoint: (_a = program.endpoint) !== null && _a !== void 0 ? _a : baseConfig.endpoint, | ||
useGet: (_b = program.get) !== null && _b !== void 0 ? _b : baseConfig.get, | ||
useGet: (_b = program.get) !== null && _b !== void 0 ? _b : baseConfig.useGet, | ||
schema: ((_c = program.schema) !== null && _c !== void 0 ? _c : baseConfig.schema) && | ||
readFile((_d = program.schema) !== null && _d !== void 0 ? _d : baseConfig.schema), | ||
output: (_e = program.output) !== null && _e !== void 0 ? _e : baseConfig.output, | ||
headers: (0, parse_1.parseColonSeparatedStrings)(((_f = program.header) !== null && _f !== void 0 ? _f : baseConfig.header) || []), | ||
scalarTypes: (0, parse_1.parseColonSeparatedStrings)(((_g = program.scalar) !== null && _g !== void 0 ? _g : baseConfig.scalar) || []), | ||
headers: program.header | ||
? (0, parse_1.parseColonSeparatedStrings)(program.header || []) | ||
: (_f = baseConfig.headers) !== null && _f !== void 0 ? _f : {}, | ||
scalarTypes: program.scalar | ||
? (0, parse_1.parseColonSeparatedStrings)(program.scalar || []) | ||
: (_g = baseConfig.scalarTypes) !== null && _g !== void 0 ? _g : {}, | ||
verbose: (_h = program.verbose) !== null && _h !== void 0 ? _h : baseConfig.verbose, | ||
sortProperties: (_j = program.sort) !== null && _j !== void 0 ? _j : baseConfig.sort, | ||
sortProperties: (_j = program.sort) !== null && _j !== void 0 ? _j : baseConfig.sortProperties, | ||
isRequiredField: baseConfig.isRequiredField, | ||
@@ -103,0 +108,0 @@ }; |
{ | ||
"name": "@rematter/genql", | ||
"version": "7.1.0-rc1", | ||
"version": "7.1.0-rc2", | ||
"description": "Generate a TypeScript SDK for any GraphQl API", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -11,2 +11,7 @@ #!/usr/bin/env node | ||
const configFilePath = resolve(process.cwd(), '.genqlrc.js') | ||
const baseConfig: Partial<Config> = existsSync(configFilePath) | ||
? require(configFilePath) | ||
: {} | ||
const program = yargs | ||
@@ -16,3 +21,3 @@ .option('output', { | ||
description: 'Output directory', | ||
required: true, | ||
demandOption: !!baseConfig.output, | ||
type: 'string', | ||
@@ -35,3 +40,2 @@ }) | ||
}) | ||
// .array('header', ) | ||
.option('header', { | ||
@@ -78,6 +82,2 @@ alias: 'H', | ||
const configFilePath = resolve(process.cwd(), '.genqlrc.js') | ||
const baseConfig = existsSync(configFilePath) ? require(configFilePath) : {} | ||
// .option('-o, --output <./myClient>', 'output directory') | ||
@@ -100,3 +100,3 @@ // .option('-e, --endpoint <http://example.com/graphql>', 'GraphQL endpoint') | ||
endpoint: program.endpoint ?? baseConfig.endpoint, | ||
useGet: program.get ?? baseConfig.get, | ||
useGet: program.get ?? baseConfig.useGet, | ||
schema: | ||
@@ -106,10 +106,10 @@ (program.schema ?? baseConfig.schema) && | ||
output: program.output ?? baseConfig.output, | ||
headers: parseColonSeparatedStrings( | ||
(program.header ?? baseConfig.header) || [], | ||
), | ||
scalarTypes: parseColonSeparatedStrings( | ||
(program.scalar ?? baseConfig.scalar) || [], | ||
), | ||
headers: program.header | ||
? parseColonSeparatedStrings(program.header || []) | ||
: baseConfig.headers ?? {}, | ||
scalarTypes: program.scalar | ||
? parseColonSeparatedStrings(program.scalar || []) | ||
: baseConfig.scalarTypes ?? {}, | ||
verbose: program.verbose ?? baseConfig.verbose, | ||
sortProperties: program.sort ?? baseConfig.sort, | ||
sortProperties: program.sort ?? baseConfig.sortProperties, | ||
isRequiredField: baseConfig.isRequiredField, | ||
@@ -116,0 +116,0 @@ } |
@@ -9,13 +9,8 @@ import { GraphQLField, GraphQLInterfaceType, GraphQLObjectType } from 'graphql' | ||
useGet?: boolean | ||
// the schema string | ||
schema?: string | ||
// the output dir | ||
output?: string | ||
// options?: Options | ||
headers?: Record<string, string> | ||
scalarTypes?: { [k: string]: string } | ||
// import fetch from a package | ||
fetchImport?: string | ||
sortProperties?: boolean | ||
isRequiredField?: (meta: { | ||
@@ -22,0 +17,0 @@ field: GraphQLField<any, any> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
380611
7221