@graphprotocol/graph-cli 0.69.0-alpha-20240318144933-441f36b → 0.69.0

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,9 +1,14 @@
1
1
  # @graphprotocol/graph-cli
2
2
 
3
- ## 0.69.0-alpha-20240318144933-441f36b
3
+ ## 0.69.0
4
4
 
5
5
  ### Minor Changes
6
6
 
7
+ - [#1522](https://github.com/graphprotocol/graph-tooling/pull/1522)
8
+ [`d132f9c`](https://github.com/graphprotocol/graph-tooling/commit/d132f9c9f6ea5283e40a8d913f3abefe5a8ad5f8)
9
+ Thanks [@dotansimha](https://github.com/dotansimha)! - Added support for handling GraphQL
10
+ `Timestamp` scalar as `i64` (AssemblyScript)
11
+
7
12
  - [#1610](https://github.com/graphprotocol/graph-tooling/pull/1610)
8
13
  [`fc03add`](https://github.com/graphprotocol/graph-tooling/commit/fc03add1a8510afa49110481b486c8fa56f8c19f)
9
14
  Thanks [@yehia67](https://github.com/yehia67)! - Generate `docker-compose.yml` with `graph init`
@@ -91,6 +91,7 @@ vitest_1.describe.concurrent('Schema code generator', () => {
91
91
 
92
92
  # New scalars
93
93
  int8: Int8!
94
+ timestamp: Timestamp!
94
95
  }
95
96
 
96
97
  type Wallet @entity {
@@ -296,6 +297,26 @@ vitest_1.describe.concurrent('Schema code generator', () => {
296
297
  returnType: undefined,
297
298
  body: `
298
299
  this.set('int8', Value.fromI64(value))
300
+ `,
301
+ },
302
+ {
303
+ name: 'get timestamp',
304
+ params: [],
305
+ returnType: new typescript_1.NamedType('i64'),
306
+ body: `let value = this.get('timestamp')
307
+ if (!value || value.kind == ValueKind.NULL) {
308
+ return 0
309
+ } else {
310
+ return value.toTimestamp()
311
+ }
312
+ `,
313
+ },
314
+ {
315
+ name: 'set timestamp',
316
+ params: [new typescript_1.Param('value', new typescript_1.NamedType('i64'))],
317
+ returnType: undefined,
318
+ body: `
319
+ this.set('timestamp', Value.fromTimestamp(value))
299
320
  `,
300
321
  },
301
322
  {
@@ -258,6 +258,7 @@ const VALUE_TO_ASSEMBLYSCRIPT = [
258
258
  ['[Boolean]', 'Array<boolean>', (code) => `${code}.toBooleanArray()`],
259
259
  ['[Int]', 'Array<i32>', (code) => `${code}.toI32Array()`],
260
260
  ['[Int8]', 'Array<i64>', (code) => `${code}.toI64Array()`],
261
+ ['[Timestamp]', 'Array<i64>', (code) => `${code}.toTimestampArray()`],
261
262
  ['[BigInt]', 'Array<BigInt>', (code) => `${code}.toBigIntArray()`],
262
263
  ['[ID]', 'Array<string>', (code) => `${code}.toStringArray()`],
263
264
  ['[String]', 'Array<string>', (code) => `${code}.toStringArray()`],
@@ -272,6 +273,7 @@ const VALUE_TO_ASSEMBLYSCRIPT = [
272
273
  ['ID', 'string', (code) => `${code}.toString()`],
273
274
  ['String', 'string', (code) => `${code}.toString()`],
274
275
  ['BigDecimal', 'BigDecimal', (code) => `${code}.toBigDecimal()`],
276
+ ['Timestamp', 'i64', (code) => `${code}.toTimestamp()`],
275
277
  [/.*/, 'string', (code) => `${code}.toString()`],
276
278
  ];
277
279
  /**
@@ -288,6 +290,7 @@ const ASSEMBLYSCRIPT_TO_VALUE = [
288
290
  ['Array<Array<boolean>>', '[[Boolean]]', (code) => `Value.fromBooleanMatrix(${code})`],
289
291
  ['Array<Array<i32>>', '[[Int]]', (code) => `Value.fromI32Matrix(${code})`],
290
292
  ['Array<Array<i64>>', '[[Int8]]', (code) => `Value.fromI64Matrix(${code})`],
293
+ ['Array<Array<i64>>', '[[Timestamp]]', (code) => `Value.fromTimestampMatrix(${code})`],
291
294
  ['Array<Array<BigInt>>', '[[BigInt]]', (code) => `Value.fromBigIntMatrix(${code})`],
292
295
  ['Array<Array<string>>', '[[String]]', (code) => `Value.fromStringMatrix(${code})`],
293
296
  ['Array<Array<string>>', '[[ID]]', (code) => `Value.fromStringMatrix(${code})`],
@@ -305,6 +308,7 @@ const ASSEMBLYSCRIPT_TO_VALUE = [
305
308
  ['Array<boolean>', '[Boolean]', (code) => `Value.fromBooleanArray(${code})`],
306
309
  ['Array<i32>', '[Int]', (code) => `Value.fromI32Array(${code})`],
307
310
  ['Array<i64>', '[Int8]', (code) => `Value.fromI64Array(${code})`],
311
+ ['Array<i64>', '[Timestamp]', (code) => `Value.fromTimestampArray(${code})`],
308
312
  ['Array<BigInt>', '[BigInt]', (code) => `Value.fromBigIntArray(${code})`],
309
313
  ['Array<string>', '[String]', (code) => `Value.fromStringArray(${code})`],
310
314
  ['Array<string>', '[ID]', (code) => `Value.fromStringArray(${code})`],
@@ -317,6 +321,7 @@ const ASSEMBLYSCRIPT_TO_VALUE = [
317
321
  ['boolean', 'Boolean', (code) => `Value.fromBoolean(${code})`],
318
322
  ['i32', 'Int', (code) => `Value.fromI32(${code})`],
319
323
  ['i64', 'Int8', (code) => `Value.fromI64(${code})`],
324
+ ['i64', 'Timestamp', (code) => `Value.fromTimestamp(${code})`],
320
325
  ['BigInt', 'BigInt', (code) => `Value.fromBigInt(${code})`],
321
326
  ['string', 'String', (code) => `Value.fromString(${code})`],
322
327
  ['string', 'ID', (code) => `Value.fromString(${code})`],
@@ -44,6 +44,7 @@ const BUILTIN_SCALAR_TYPES = [
44
44
  'Bytes',
45
45
  'ID',
46
46
  'Int8',
47
+ 'Timestamp',
47
48
  ];
48
49
  // Type suggestions for common mistakes
49
50
  const TYPE_SUGGESTIONS = [
@@ -64,6 +65,8 @@ const TYPE_SUGGESTIONS = [
64
65
  ['Float', 'BigDecimal'],
65
66
  ['int', 'Int'],
66
67
  ['int8', 'Int8'],
68
+ ['timestamp', 'Timestamp'],
69
+ ['ts', 'Timestamp'],
67
70
  ['uint', 'BigInt'],
68
71
  ['owner', 'String'],
69
72
  ['Owner', 'String'],
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.69.0-alpha-20240318144933-441f36b",
2
+ "version": "0.69.0",
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.69.0-alpha-20240318144933-441f36b",
3
+ "version": "0.69.0",
4
4
  "description": "CLI for building for and deploying to The Graph",
5
5
  "license": "(Apache-2.0 OR MIT)",
6
6
  "engines": {