apollo-codegen
Advanced tools
Comparing version 0.15.0 to 0.15.1
@@ -54,8 +54,15 @@ #!/usr/bin/env node | ||
type: 'boolean' | ||
}, | ||
method: { | ||
demand: false, | ||
describe: 'The HTTP request method to use for the introspection query request', | ||
type: 'string', | ||
default: 'POST', | ||
choices: ['POST', 'GET', 'post', 'get'] | ||
} | ||
}, (argv) => __awaiter(this, void 0, void 0, function* () { | ||
const { schema, output, header, insecure } = argv; | ||
const { schema, output, header, insecure, method } = argv; | ||
const urlRegex = /^https?:\/\//i; | ||
if (urlRegex.test(schema)) { | ||
yield _1.downloadSchema(schema, output, header, insecure); | ||
yield _1.downloadSchema(schema, output, header, insecure, method); | ||
} | ||
@@ -135,2 +142,7 @@ else { | ||
normalize: true | ||
}, | ||
"merge-in-fields-from-fragment-spreads": { | ||
demand: false, | ||
describe: "Merge fragment fields onto its enclosing type [default: true]", | ||
default: true | ||
} | ||
@@ -151,3 +163,4 @@ }, argv => { | ||
operationIdsPath: argv["operation-ids-path"], | ||
generateOperationIds: !!argv["operation-ids-path"] | ||
generateOperationIds: !!argv["operation-ids-path"], | ||
mergeInFieldsFromFragmentSpreads: argv["merge-in-fields-from-fragment-spreads"] | ||
}; | ||
@@ -154,0 +167,0 @@ _1.generate(inputPaths, argv.schema, argv.output, argv.target, argv.tagName, options); |
@@ -20,3 +20,3 @@ "use strict"; | ||
}; | ||
function downloadSchema(url, outputPath, additionalHeaders, insecure) { | ||
function downloadSchema(url, outputPath, additionalHeaders, insecure, method) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -28,3 +28,3 @@ const headers = Object.assign(defaultHeaders, additionalHeaders); | ||
const response = yield fetch(url, { | ||
method: 'POST', | ||
method: method, | ||
headers: headers, | ||
@@ -31,0 +31,0 @@ body: JSON.stringify({ 'query': utilities_1.introspectionQuery }), |
@@ -18,3 +18,2 @@ "use strict"; | ||
} | ||
options.mergeInFieldsFromFragmentSpreads = true; | ||
const context = compilation_1.compileToIR(schema, document, options); | ||
@@ -21,0 +20,0 @@ Object.assign(context, options); |
@@ -407,6 +407,9 @@ "use strict"; | ||
generator.printNewlineIfNeeded(); | ||
generator.printOnNewline(description && `/// ${description}`); | ||
language_1.comment(generator, description); | ||
generator.printOnNewline(`public enum ${name}: String`); | ||
generator.withinBlock(() => { | ||
values.forEach(value => generator.printOnNewline(`case ${language_1.escapeIdentifierIfNeeded(naming_1.enumCaseName(value.name))} = "${value.value}"${printing_1.wrap(' /// ', value.description)}`)); | ||
values.forEach(value => { | ||
language_1.comment(generator, value.description); | ||
generator.printOnNewline(`case ${language_1.escapeIdentifierIfNeeded(naming_1.enumCaseName(value.name))} = "${value.value}"`); | ||
}); | ||
}); | ||
@@ -413,0 +416,0 @@ generator.printNewline(); |
{ | ||
"name": "apollo-codegen", | ||
"version": "0.15.0", | ||
"version": "0.15.1", | ||
"description": "Generate API code or type annotations based on a GraphQL schema and query documents", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
219510
2525
2