@graphprotocol/graph-cli 0.47.1 → 0.48.0-alpha-20230425150650-f106dbf
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/codegen/schema.js +3 -0
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @graphprotocol/graph-cli
|
|
2
2
|
|
|
3
|
+
## 0.48.0-alpha-20230425150650-f106dbf
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#1306](https://github.com/graphprotocol/graph-tooling/pull/1306)
|
|
8
|
+
[`f106dbf`](https://github.com/graphprotocol/graph-tooling/commit/f106dbf7e39d9c430c255f3eaafb591080c69e86)
|
|
9
|
+
Thanks [@saihaj](https://github.com/saihaj)! - Add loadInBlock function for entities as part of
|
|
10
|
+
codegen
|
|
11
|
+
|
|
3
12
|
## 0.47.1
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/dist/codegen/schema.js
CHANGED
|
@@ -138,6 +138,9 @@ class SchemaCodeGenerator {
|
|
|
138
138
|
\`Entities of type ${entityName} must have an ID of type ${idField.gqlTypeName()} but the id '\${id.displayData()}' is of type \${id.displayKind()}\`)
|
|
139
139
|
store.set('${entityName}', ${idField.tsValueToString()}, this)
|
|
140
140
|
}`),
|
|
141
|
+
tsCodegen.staticMethod('loadInBlock', [tsCodegen.param('id', tsCodegen.namedType(idField.typeName()))], tsCodegen.nullableType(tsCodegen.namedType(entityName)), `
|
|
142
|
+
return changetype<${entityName} | null>(store.get_in_block('${entityName}', ${idField.tsToString()}))
|
|
143
|
+
`),
|
|
141
144
|
tsCodegen.staticMethod('load', [tsCodegen.param('id', tsCodegen.namedType(idField.typeName()))], tsCodegen.nullableType(tsCodegen.namedType(entityName)), `
|
|
142
145
|
return changetype<${entityName} | null>(store.get('${entityName}', ${idField.tsToString()}))
|
|
143
146
|
`),
|
package/oclif.manifest.json
CHANGED