@graphprotocol/graph-cli 0.51.0-alpha-20230530051447-89a2d32 → 0.51.0-alpha-20230530064033-7170d9a

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 CHANGED
@@ -1,11 +1,11 @@
1
1
  # @graphprotocol/graph-cli
2
2
 
3
- ## 0.51.0-alpha-20230530051447-89a2d32
3
+ ## 0.51.0-alpha-20230530064033-7170d9a
4
4
 
5
5
  ### Minor Changes
6
6
 
7
7
  - [#1296](https://github.com/graphprotocol/graph-tooling/pull/1296)
8
- [`89a2d32`](https://github.com/graphprotocol/graph-tooling/commit/89a2d3287458c90e09944db0dfcf30a98ec2a81a)
8
+ [`7170d9a`](https://github.com/graphprotocol/graph-tooling/commit/7170d9a7062ae6db4eac73818ba32606b0f18657)
9
9
  Thanks [@dotansimha](https://github.com/dotansimha)! - Added support for handling GraphQL `Int8`
10
10
  scalar as `i64` (AssemblyScript)
11
11
 
@@ -86,6 +86,9 @@ describe('Schema code generator', () => {
86
86
 
87
87
  # derivedFrom
88
88
  wallets: [Wallet!] @derivedFrom(field: "account")
89
+
90
+ # New scalars
91
+ int8: Int8!
89
92
  }
90
93
 
91
94
  type Wallet @entity {
@@ -271,6 +274,26 @@ describe('Schema code generator', () => {
271
274
  returnType: undefined,
272
275
  body: `
273
276
  this.set('isActive', Value.fromBoolean(value))
277
+ `,
278
+ },
279
+ {
280
+ name: 'get int8',
281
+ params: [],
282
+ returnType: new typescript_1.NamedType('i64'),
283
+ body: `let value = this.get('int8')
284
+ if (!value || value.kind == ValueKind.NULL) {
285
+ return 0
286
+ } else {
287
+ return value.toI64()
288
+ }
289
+ `,
290
+ },
291
+ {
292
+ name: 'set int8',
293
+ params: [new typescript_1.Param('value', new typescript_1.NamedType('i64'))],
294
+ returnType: undefined,
295
+ body: `
296
+ this.set('int8', Value.fromI64(value))
274
297
  `,
275
298
  },
276
299
  {
@@ -257,6 +257,7 @@ const VALUE_TO_ASSEMBLYSCRIPT = [
257
257
  ['[Bytes]', 'Array<Bytes>', (code) => `${code}.toBytesArray()`],
258
258
  ['[Boolean]', 'Array<boolean>', (code) => `${code}.toBooleanArray()`],
259
259
  ['[Int]', 'Array<i32>', (code) => `${code}.toI32Array()`],
260
+ ['[Int8]', 'Array<i64>', (code) => `${code}.toI64Array()`],
260
261
  ['[BigInt]', 'Array<BigInt>', (code) => `${code}.toBigIntArray()`],
261
262
  ['[ID]', 'Array<string>', (code) => `${code}.toStringArray()`],
262
263
  ['[String]', 'Array<string>', (code) => `${code}.toStringArray()`],
@@ -266,6 +267,7 @@ const VALUE_TO_ASSEMBLYSCRIPT = [
266
267
  ['Bytes', 'Bytes', (code) => `${code}.toBytes()`],
267
268
  ['Boolean', 'boolean', (code) => `${code}.toBoolean()`],
268
269
  ['Int', 'i32', (code) => `${code}.toI32()`],
270
+ ['Int8', 'i64', (code) => `${code}.toI64()`],
269
271
  ['BigInt', 'BigInt', (code) => `${code}.toBigInt()`],
270
272
  ['ID', 'string', (code) => `${code}.toString()`],
271
273
  ['String', 'string', (code) => `${code}.toString()`],
@@ -285,6 +287,7 @@ const ASSEMBLYSCRIPT_TO_VALUE = [
285
287
  ['Array<Array<Bytes>>', '[[Bytes]]', (code) => `Value.fromBytesMatrix(${code})`],
286
288
  ['Array<Array<boolean>>', '[[Boolean]]', (code) => `Value.fromBooleanMatrix(${code})`],
287
289
  ['Array<Array<i32>>', '[[Int]]', (code) => `Value.fromI32Matrix(${code})`],
290
+ ['Array<Array<i64>>', '[[Int8]]', (code) => `Value.fromI64Matrix(${code})`],
288
291
  ['Array<Array<BigInt>>', '[[BigInt]]', (code) => `Value.fromBigIntMatrix(${code})`],
289
292
  ['Array<Array<string>>', '[[String]]', (code) => `Value.fromStringMatrix(${code})`],
290
293
  ['Array<Array<string>>', '[[ID]]', (code) => `Value.fromStringMatrix(${code})`],
@@ -301,6 +304,7 @@ const ASSEMBLYSCRIPT_TO_VALUE = [
301
304
  ['Array<Bytes>', '[Bytes]', (code) => `Value.fromBytesArray(${code})`],
302
305
  ['Array<boolean>', '[Boolean]', (code) => `Value.fromBooleanArray(${code})`],
303
306
  ['Array<i32>', '[Int]', (code) => `Value.fromI32Array(${code})`],
307
+ ['Array<i64>', '[Int8]', (code) => `Value.fromI64Array(${code})`],
304
308
  ['Array<BigInt>', '[BigInt]', (code) => `Value.fromBigIntArray(${code})`],
305
309
  ['Array<string>', '[String]', (code) => `Value.fromStringArray(${code})`],
306
310
  ['Array<string>', '[ID]', (code) => `Value.fromStringArray(${code})`],
@@ -312,6 +316,7 @@ const ASSEMBLYSCRIPT_TO_VALUE = [
312
316
  ['Bytes', 'Bytes', (code) => `Value.fromBytes(${code})`],
313
317
  ['boolean', 'Boolean', (code) => `Value.fromBoolean(${code})`],
314
318
  ['i32', 'Int', (code) => `Value.fromI32(${code})`],
319
+ ['i64', 'Int8', (code) => `Value.fromI64(${code})`],
315
320
  ['BigInt', 'BigInt', (code) => `Value.fromBigInt(${code})`],
316
321
  ['string', 'String', (code) => `Value.fromString(${code})`],
317
322
  ['string', 'ID', (code) => `Value.fromString(${code})`],
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.51.0-alpha-20230530051447-89a2d32",
2
+ "version": "0.51.0-alpha-20230530064033-7170d9a",
3
3
  "commands": {
4
4
  "add": {
5
5
  "id": "add",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphprotocol/graph-cli",
3
- "version": "0.51.0-alpha-20230530051447-89a2d32",
3
+ "version": "0.51.0-alpha-20230530064033-7170d9a",
4
4
  "description": "CLI for building for and deploying to The Graph",
5
5
  "license": "(Apache-2.0 OR MIT)",
6
6
  "engines": {