Skip to content

Commit c3a15e4

Browse files
committed
Merge branch 'incrypto32/derived-loader-fixes' of github.com:graphprotocol/graph-tooling into incrypto32/derived-loader-fixes
2 parents 8ed4459 + dd5d0b2 commit c3a15e4

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@graphprotocol/graph-cli": patch
3+
---
4+
dependencies updates:
5+
- Updated dependency [`@oclif/[email protected]` ↗︎](https://www.npmjs.com/package/@oclif/core/v/2.8.4) (from `2.8.2`, in `dependencies`)

packages/cli/src/codegen/schema.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -302,10 +302,11 @@ export default class SchemaCodeGenerator {
302302
returnType instanceof tsCodegen.NamedType ? returnType.getPrimitiveDefault() : null;
303303

304304
const getNonNullable = `if (!value || value.kind == ValueKind.NULL) {
305-
${primitiveDefault === null
306-
? "throw new Error('Cannot return null for a required field.')"
307-
: `return ${primitiveDefault}`
308-
}
305+
${
306+
primitiveDefault === null
307+
? "throw new Error('Cannot return null for a required field.')"
308+
: `return ${primitiveDefault}`
309+
}
309310
} else {
310311
return ${typesCodegen.valueToAsc('value', fieldValueType)}
311312
}`;
@@ -351,7 +352,10 @@ export default class SchemaCodeGenerator {
351352
return type;
352353
}
353354

354-
_generatedEntityDerivedFieldGetter(_entityDef: ObjectTypeDefinitionNode, fieldDef: FieldDefinitionNode) {
355+
_generatedEntityDerivedFieldGetter(
356+
_entityDef: ObjectTypeDefinitionNode,
357+
fieldDef: FieldDefinitionNode,
358+
) {
355359
const name = fieldDef.name.value;
356360
const gqlType = fieldDef.type;
357361
const fieldValueType = this._valueTypeFromGraphQl(gqlType);

0 commit comments

Comments
 (0)