apollo-codegen
Advanced tools
Comparing version 0.16.3 to 0.16.4
@@ -18,3 +18,3 @@ "use strict"; | ||
function extractDocumentFromJavascript(content, tagName = 'gql') { | ||
const re = new RegExp(tagName + '`([^`]*)`', 'g'); | ||
const re = new RegExp(tagName + '\\s*`([^`]*)`', 'g'); | ||
let match; | ||
@@ -21,0 +21,0 @@ const matches = []; |
@@ -261,3 +261,3 @@ "use strict"; | ||
function propertyDeclarationForField(generator, field) { | ||
const { kind, propertyName, typeName, type, isConditional, description } = naming_1.propertyFromField(generator.context, field); | ||
const { kind, propertyName, typeName, type, isConditional, description, isDeprecated, deprecationReason } = naming_1.propertyFromField(generator.context, field); | ||
const responseName = field.responseName; | ||
@@ -267,2 +267,3 @@ const namedType = graphql_1.getNamedType(type); | ||
language_1.comment(generator, description); | ||
language_1.deprecation(generator, isDeprecated, deprecationReason); | ||
generator.printOnNewline(`public var ${propertyName}: ${typeName}`); | ||
@@ -431,2 +432,3 @@ generator.withinBlock(() => { | ||
language_1.comment(generator, value.description); | ||
language_1.deprecation(generator, value.isDeprecated, value.deprecationReason); | ||
generator.printOnNewline(`case ${language_1.escapeIdentifierIfNeeded(naming_1.enumCaseName(value.name))} = "${value.value}"`); | ||
@@ -433,0 +435,0 @@ }); |
@@ -11,2 +11,9 @@ "use strict"; | ||
exports.comment = comment; | ||
function deprecation(generator, isDeprecated, deprecationReason) { | ||
if (isDeprecated !== undefined && isDeprecated) { | ||
deprecationReason = (deprecationReason !== undefined && deprecationReason.length > 0) ? deprecationReason : ""; | ||
generator.printOnNewline(`@available(*, deprecated, message: "${deprecationReason}")`); | ||
} | ||
} | ||
exports.deprecation = deprecation; | ||
function namespaceDeclaration(generator, namespace, closure) { | ||
@@ -13,0 +20,0 @@ if (namespace) { |
{ | ||
"name": "apollo-codegen", | ||
"version": "0.16.3", | ||
"version": "0.16.4", | ||
"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
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
224812
2620