@graphprotocol/graph-cli 0.49.0-alpha-20230501231851-dbb1fb0 → 0.49.0-alpha-20230502203646-e89066d
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 +5 -5
- package/dist/codegen/schema.js +0 -3
- package/dist/codegen/schema.test.js +0 -27
- package/dist/type-generator.d.ts +1 -1
- package/dist/type-generator.js +4 -0
- package/oclif.manifest.json +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# @graphprotocol/graph-cli
|
|
2
2
|
|
|
3
|
-
## 0.49.0-alpha-
|
|
3
|
+
## 0.49.0-alpha-20230502203646-e89066d
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
|
-
- [#
|
|
8
|
-
[`
|
|
9
|
-
Thanks [@saihaj](https://github.com/saihaj)! -
|
|
10
|
-
codegen
|
|
7
|
+
- [#1327](https://github.com/graphprotocol/graph-tooling/pull/1327)
|
|
8
|
+
[`1288a95`](https://github.com/graphprotocol/graph-tooling/commit/1288a95721c0d601253e8ef041479f3c9784eadd)
|
|
9
|
+
Thanks [@saihaj](https://github.com/saihaj)! - do not generate types, instead show a message to
|
|
10
|
+
user to use substreams CLI for codegen.
|
|
11
11
|
|
|
12
12
|
## 0.48.0
|
|
13
13
|
|
package/dist/codegen/schema.js
CHANGED
|
@@ -138,9 +138,6 @@ 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
|
-
`),
|
|
144
141
|
tsCodegen.staticMethod('load', [tsCodegen.param('id', tsCodegen.namedType(idField.typeName()))], tsCodegen.nullableType(tsCodegen.namedType(entityName)), `
|
|
145
142
|
return changetype<${entityName} | null>(store.get('${entityName}', ${idField.tsToString()}))
|
|
146
143
|
`),
|
|
@@ -128,15 +128,6 @@ describe('Schema code generator', () => {
|
|
|
128
128
|
\`Entities of type Account must have an ID of type String but the id '\${id.displayData()}' is of type \${id.displayKind()}\`)
|
|
129
129
|
store.set('Account', id.toString(), this)
|
|
130
130
|
}
|
|
131
|
-
`,
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
name: 'loadInBlock',
|
|
135
|
-
static: true,
|
|
136
|
-
params: [new typescript_1.Param('id', new typescript_1.NamedType('string'))],
|
|
137
|
-
returnType: new typescript_1.NullableType(new typescript_1.NamedType('Account')),
|
|
138
|
-
body: `
|
|
139
|
-
return changetype<Account | null>(store.get_in_block('Account', id))
|
|
140
131
|
`,
|
|
141
132
|
},
|
|
142
133
|
{
|
|
@@ -316,15 +307,6 @@ describe('Schema code generator', () => {
|
|
|
316
307
|
\`Entities of type Wallet must have an ID of type String but the id '\${id.displayData()}' is of type \${id.displayKind()}\`)
|
|
317
308
|
store.set('Wallet', id.toString(), this)
|
|
318
309
|
}
|
|
319
|
-
`,
|
|
320
|
-
},
|
|
321
|
-
{
|
|
322
|
-
name: 'loadInBlock',
|
|
323
|
-
static: true,
|
|
324
|
-
params: [new typescript_1.Param('id', new typescript_1.NamedType('string'))],
|
|
325
|
-
returnType: new typescript_1.NullableType(new typescript_1.NamedType('Wallet')),
|
|
326
|
-
body: `
|
|
327
|
-
return changetype<Wallet | null>(store.get_in_block('Wallet', id))
|
|
328
310
|
`,
|
|
329
311
|
},
|
|
330
312
|
{
|
|
@@ -443,15 +425,6 @@ describe('Schema code generator', () => {
|
|
|
443
425
|
" store.set('Task', id.toBytes().toHexString(), this)\n" +
|
|
444
426
|
' }',
|
|
445
427
|
},
|
|
446
|
-
{
|
|
447
|
-
name: 'loadInBlock',
|
|
448
|
-
static: true,
|
|
449
|
-
params: [new typescript_1.Param('id', new typescript_1.NamedType('Bytes'))],
|
|
450
|
-
returnType: new typescript_1.NullableType(new typescript_1.NamedType('Task')),
|
|
451
|
-
body: '\n' +
|
|
452
|
-
" return changetype<Task | null>(store.get_in_block('Task', id.toHexString()))\n" +
|
|
453
|
-
' ',
|
|
454
|
-
},
|
|
455
428
|
{
|
|
456
429
|
name: 'load',
|
|
457
430
|
static: true,
|
package/dist/type-generator.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export default class TypeGenerator {
|
|
|
16
16
|
private protocol;
|
|
17
17
|
private protocolTypeGenerator;
|
|
18
18
|
constructor(options: TypeGeneratorOptions);
|
|
19
|
-
generateTypes(): Promise<boolean>;
|
|
19
|
+
generateTypes(): Promise<boolean | undefined>;
|
|
20
20
|
generateUncrashableEntities(graphSchema: any): Promise<any>;
|
|
21
21
|
loadSubgraph({ quiet }?: {
|
|
22
22
|
quiet: boolean;
|
package/dist/type-generator.js
CHANGED
|
@@ -58,6 +58,10 @@ class TypeGenerator {
|
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
60
|
async generateTypes() {
|
|
61
|
+
if (this.protocol.name === 'substreams') {
|
|
62
|
+
toolbox.print.success('Subgraph uses a substream datasource. Codegeneration is not required.');
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
61
65
|
try {
|
|
62
66
|
if (!this.options.skipMigrations && this.options.subgraphManifest) {
|
|
63
67
|
await (0, migrations_1.applyMigrations)({
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphprotocol/graph-cli",
|
|
3
|
-
"version": "0.49.0-alpha-
|
|
3
|
+
"version": "0.49.0-alpha-20230502203646-e89066d",
|
|
4
4
|
"description": "CLI for building for and deploying to The Graph",
|
|
5
5
|
"license": "(Apache-2.0 OR MIT)",
|
|
6
6
|
"engines": {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@float-capital/float-subgraph-uncrashable": "^0.0.0-alpha.4",
|
|
23
|
-
"@oclif/core": "2.8.
|
|
23
|
+
"@oclif/core": "2.8.2",
|
|
24
24
|
"@whatwg-node/fetch": "^0.8.4",
|
|
25
25
|
"assemblyscript": "0.19.23",
|
|
26
26
|
"binary-install-raw": "0.0.13",
|