apollo-codegen
Advanced tools
Comparing version 0.12.4 to 0.12.5
@@ -385,3 +385,7 @@ 'use strict'; | ||
generator.withinBlock(function () { | ||
generator.printOnNewline(`return ${structName}(snapshot: snapshot["${propertyName}"]! as! Snapshot)`); | ||
if (isOptional) { | ||
generator.printOnNewline(`return (snapshot["${propertyName}"]! as! Snapshot?).flatMap { ${structName}(snapshot: $0) }`); | ||
} else { | ||
generator.printOnNewline(`return ${structName}(snapshot: snapshot["${propertyName}"]! as! Snapshot)`); | ||
} | ||
}); | ||
@@ -388,0 +392,0 @@ generator.printOnNewline("set"); |
{ | ||
"name": "apollo-codegen", | ||
"version": "0.12.4", | ||
"version": "0.12.5", | ||
"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
634677
9793