@graphprotocol/graph-cli 0.29.0 → 0.30.0-alpha.1

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.
Files changed (56) hide show
  1. package/examples/basic-event-handlers/node_modules/keccak/build/Makefile +1 -1
  2. package/examples/basic-event-handlers/node_modules/keccak/build/Release/.deps/Release/obj.target/keccak/src/addon.o.d.raw +16 -16
  3. package/examples/basic-event-handlers/node_modules/keccak/build/config.gypi +4 -4
  4. package/examples/basic-event-handlers/node_modules/keccak/build/keccak.target.mk +14 -14
  5. package/examples/basic-event-handlers/node_modules/websocket/build/Makefile +1 -1
  6. package/examples/basic-event-handlers/node_modules/websocket/build/Release/.deps/Release/obj.target/bufferutil/src/bufferutil.o.d.raw +16 -16
  7. package/examples/basic-event-handlers/node_modules/websocket/build/bufferutil.target.mk +14 -14
  8. package/examples/basic-event-handlers/node_modules/websocket/build/config.gypi +1 -1
  9. package/examples/basic-event-handlers/node_modules/websocket/build/validation.target.mk +14 -14
  10. package/examples/basic-event-handlers/package.json +1 -1
  11. package/examples/basic-event-handlers/yarn.lock +4 -4
  12. package/examples/example-subgraph/package.json +1 -1
  13. package/examples/example-subgraph/yarn.lock +4 -4
  14. package/package.json +1 -1
  15. package/resources/test/docker-compose.yml +4 -2
  16. package/src/codegen/schema.js +3 -44
  17. package/src/codegen/schema.test.js +0 -6
  18. package/src/codegen/types/conversions.js +19 -19
  19. package/src/codegen/types/index.js +0 -25
  20. package/src/codegen/types/index.test.js +0 -22
  21. package/src/commands/deploy.js +0 -5
  22. package/src/commands/init.js +1 -0
  23. package/src/migrations/mapping_api_version_0_0_5.js +1 -1
  24. package/src/migrations/mapping_api_version_0_0_6.js +74 -0
  25. package/src/migrations/spec_version_0_0_2.js +1 -1
  26. package/src/migrations/spec_version_0_0_3.js +29 -0
  27. package/src/migrations/spec_version_0_0_4.js +25 -0
  28. package/src/migrations.js +4 -0
  29. package/src/protocols/ethereum/manifest.graphql +2 -0
  30. package/src/protocols/index.js +2 -2
  31. package/src/scaffold/index.js +1 -1
  32. package/src/validation/manifest.js +64 -12
  33. package/tests/cli/init/ethereum/from-example/.gitattributes +1 -0
  34. package/tests/cli/init/ethereum/from-example/LICENSE +21 -0
  35. package/tests/cli/init/ethereum/from-example/README.md +3 -0
  36. package/tests/cli/init/ethereum/from-example/abis/Gravity.json +1 -0
  37. package/tests/cli/init/ethereum/from-example/bin/Counter.bin +1 -0
  38. package/tests/cli/init/ethereum/from-example/contracts/Gravity.sol +63 -0
  39. package/tests/cli/init/ethereum/from-example/contracts/Migrations.sol +23 -0
  40. package/tests/cli/init/ethereum/from-example/docker-compose.yml +39 -0
  41. package/tests/cli/init/ethereum/from-example/migrations/1_initial_migration.js +5 -0
  42. package/tests/cli/init/ethereum/from-example/migrations/2_deploy_contract.js +5 -0
  43. package/tests/cli/init/ethereum/from-example/migrations/3_create_gravatars.js +15 -0
  44. package/tests/cli/init/ethereum/from-example/networks.json +7 -0
  45. package/tests/cli/init/ethereum/from-example/package.json +23 -0
  46. package/tests/cli/init/ethereum/from-example/schema.graphql +6 -0
  47. package/tests/cli/init/ethereum/from-example/src/mapping.ts +22 -0
  48. package/tests/cli/init/ethereum/from-example/subgraph.yaml +27 -0
  49. package/tests/cli/init/ethereum/from-example/truffle.js +27 -0
  50. package/tests/cli/init/ethereum/from-example/yarn.lock +5977 -0
  51. package/tests/cli/validation/conflicting-protocol-names/Abi.json +7 -0
  52. package/tests/cli/validation/conflicting-protocol-names/mapping.ts +0 -0
  53. package/tests/cli/validation/conflicting-protocol-names/schema.graphql +3 -0
  54. package/tests/cli/validation/conflicting-protocol-names/subgraph.yaml +41 -0
  55. package/tests/cli/validation/conflicting-protocol-names.stderr +10 -0
  56. package/tests/cli/validation.test.js +9 -0
@@ -326,7 +326,7 @@ ifeq ($(strip $(foreach prefix,$(NO_LOAD),\
326
326
  endif
327
327
 
328
328
  quiet_cmd_regen_makefile = ACTION Regenerating $@
329
- cmd_regen_makefile = cd $(srcdir); /usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "--toplevel-dir=." -I/Users/otaviopace/graph-cli/examples/basic-event-handlers/node_modules/keccak/build/config.gypi -I/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node/common.gypi "--depth=." "-Goutput_dir=." "--generator-output=build" "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/Users/otaviopace/Library/Caches/node-gyp/14.16.0" "-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp" "-Dnode_lib_file=/Users/otaviopace/Library/Caches/node-gyp/14.16.0/<(target_arch)/node.lib" "-Dmodule_root_dir=/Users/otaviopace/graph-cli/examples/basic-event-handlers/node_modules/keccak" "-Dnode_engine=v8" binding.gyp
329
+ cmd_regen_makefile = cd $(srcdir); /usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "--toplevel-dir=." -I/Users/eva/graph-cli/examples/basic-event-handlers/node_modules/keccak/build/config.gypi -I/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi -I/Users/eva/Library/Caches/node-gyp/14.16.0/include/node/common.gypi "--depth=." "-Goutput_dir=." "--generator-output=build" "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/Users/eva/Library/Caches/node-gyp/14.16.0" "-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp" "-Dnode_lib_file=/Users/eva/Library/Caches/node-gyp/14.16.0/<(target_arch)/node.lib" "-Dmodule_root_dir=/Users/eva/graph-cli/examples/basic-event-handlers/node_modules/keccak" "-Dnode_engine=v8" binding.gyp
330
330
  Makefile: $(srcdir)/../../../../../../../usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi $(srcdir)/build/config.gypi $(srcdir)/binding.gyp $(srcdir)/../../../../../Library/Caches/node-gyp/14.16.0/include/node/common.gypi
331
331
  $(call do_cmd,regen_makefile)
332
332
 
@@ -1,21 +1,21 @@
1
1
  Release/obj.target/keccak/src/addon.o: ../src/addon.cc \
2
- /Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node/node.h \
3
- /Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node/v8.h \
4
- /Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node/cppgc/common.h \
5
- /Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node/v8config.h \
6
- /Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node/v8-internal.h \
7
- /Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node/v8-version.h \
8
- /Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node/v8-platform.h \
9
- /Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node/node_version.h \
2
+ /Users/eva/Library/Caches/node-gyp/14.16.0/include/node/node.h \
3
+ /Users/eva/Library/Caches/node-gyp/14.16.0/include/node/v8.h \
4
+ /Users/eva/Library/Caches/node-gyp/14.16.0/include/node/cppgc/common.h \
5
+ /Users/eva/Library/Caches/node-gyp/14.16.0/include/node/v8config.h \
6
+ /Users/eva/Library/Caches/node-gyp/14.16.0/include/node/v8-internal.h \
7
+ /Users/eva/Library/Caches/node-gyp/14.16.0/include/node/v8-version.h \
8
+ /Users/eva/Library/Caches/node-gyp/14.16.0/include/node/v8-platform.h \
9
+ /Users/eva/Library/Caches/node-gyp/14.16.0/include/node/node_version.h \
10
10
  ../../nan/nan.h \
11
- /Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node/uv.h \
12
- /Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node/uv/errno.h \
13
- /Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node/uv/version.h \
14
- /Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node/uv/unix.h \
15
- /Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node/uv/threadpool.h \
16
- /Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node/uv/darwin.h \
17
- /Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node/node_buffer.h \
18
- /Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node/node_object_wrap.h \
11
+ /Users/eva/Library/Caches/node-gyp/14.16.0/include/node/uv.h \
12
+ /Users/eva/Library/Caches/node-gyp/14.16.0/include/node/uv/errno.h \
13
+ /Users/eva/Library/Caches/node-gyp/14.16.0/include/node/uv/version.h \
14
+ /Users/eva/Library/Caches/node-gyp/14.16.0/include/node/uv/unix.h \
15
+ /Users/eva/Library/Caches/node-gyp/14.16.0/include/node/uv/threadpool.h \
16
+ /Users/eva/Library/Caches/node-gyp/14.16.0/include/node/uv/darwin.h \
17
+ /Users/eva/Library/Caches/node-gyp/14.16.0/include/node/node_buffer.h \
18
+ /Users/eva/Library/Caches/node-gyp/14.16.0/include/node/node_object_wrap.h \
19
19
  ../../nan/nan_callbacks.h ../../nan/nan_callbacks_12_inl.h \
20
20
  ../../nan/nan_maybe_43_inl.h ../../nan/nan_converters.h \
21
21
  ../../nan/nan_converters_43_inl.h ../../nan/nan_new.h \
@@ -76,7 +76,7 @@
76
76
  "v8_use_siphash": 1,
77
77
  "want_separate_host_toolset": 0,
78
78
  "xcode_version": "11.0",
79
- "nodedir": "/Users/otaviopace/Library/Caches/node-gyp/14.16.0",
79
+ "nodedir": "/Users/eva/Library/Caches/node-gyp/14.16.0",
80
80
  "standalone_static_library": 1,
81
81
  "save_dev": "",
82
82
  "legacy_bundling": "",
@@ -133,8 +133,8 @@
133
133
  "https_proxy": "",
134
134
  "engine_strict": "",
135
135
  "description": "true",
136
- "userconfig": "/Users/otaviopace/.npmrc",
137
- "init_module": "/Users/otaviopace/.npm-init.js",
136
+ "userconfig": "/Users/eva/.npmrc",
137
+ "init_module": "/Users/eva/.npm-init.js",
138
138
  "cidr": "",
139
139
  "user": "",
140
140
  "node_version": "14.16.0",
@@ -178,7 +178,7 @@
178
178
  "otp": "",
179
179
  "cache_min": "10",
180
180
  "searchexclude": "",
181
- "cache": "/Users/otaviopace/.npm",
181
+ "cache": "/Users/eva/.npm",
182
182
  "color": "true",
183
183
  "package_lock": "true",
184
184
  "package_lock_only": "",
@@ -52,13 +52,13 @@ CFLAGS_OBJC_Debug :=
52
52
  CFLAGS_OBJCC_Debug :=
53
53
 
54
54
  INCS_Debug := \
55
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node \
56
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/src \
57
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/deps/openssl/config \
58
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/deps/openssl/openssl/include \
59
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/deps/uv/include \
60
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/deps/zlib \
61
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/deps/v8/include \
55
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/include/node \
56
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/src \
57
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/deps/openssl/config \
58
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/deps/openssl/openssl/include \
59
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/deps/uv/include \
60
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/deps/zlib \
61
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/deps/v8/include \
62
62
  -I$(srcdir)/../nan
63
63
 
64
64
  DEFS_Release := \
@@ -108,13 +108,13 @@ CFLAGS_OBJC_Release :=
108
108
  CFLAGS_OBJCC_Release :=
109
109
 
110
110
  INCS_Release := \
111
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node \
112
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/src \
113
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/deps/openssl/config \
114
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/deps/openssl/openssl/include \
115
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/deps/uv/include \
116
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/deps/zlib \
117
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/deps/v8/include \
111
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/include/node \
112
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/src \
113
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/deps/openssl/config \
114
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/deps/openssl/openssl/include \
115
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/deps/uv/include \
116
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/deps/zlib \
117
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/deps/v8/include \
118
118
  -I$(srcdir)/../nan
119
119
 
120
120
  OBJS := \
@@ -331,7 +331,7 @@ ifeq ($(strip $(foreach prefix,$(NO_LOAD),\
331
331
  endif
332
332
 
333
333
  quiet_cmd_regen_makefile = ACTION Regenerating $@
334
- cmd_regen_makefile = cd $(srcdir); /usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "--toplevel-dir=." -I/Users/otaviopace/graph-cli/examples/basic-event-handlers/node_modules/websocket/build/config.gypi -I/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node/common.gypi "--depth=." "-Goutput_dir=." "--generator-output=build" "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/Users/otaviopace/Library/Caches/node-gyp/14.16.0" "-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp" "-Dnode_lib_file=/Users/otaviopace/Library/Caches/node-gyp/14.16.0/<(target_arch)/node.lib" "-Dmodule_root_dir=/Users/otaviopace/graph-cli/examples/basic-event-handlers/node_modules/websocket" "-Dnode_engine=v8" binding.gyp
334
+ cmd_regen_makefile = cd $(srcdir); /usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "--toplevel-dir=." -I/Users/eva/graph-cli/examples/basic-event-handlers/node_modules/websocket/build/config.gypi -I/usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi -I/Users/eva/Library/Caches/node-gyp/14.16.0/include/node/common.gypi "--depth=." "-Goutput_dir=." "--generator-output=build" "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/Users/eva/Library/Caches/node-gyp/14.16.0" "-Dnode_gyp_dir=/usr/local/lib/node_modules/npm/node_modules/node-gyp" "-Dnode_lib_file=/Users/eva/Library/Caches/node-gyp/14.16.0/<(target_arch)/node.lib" "-Dmodule_root_dir=/Users/eva/graph-cli/examples/basic-event-handlers/node_modules/websocket" "-Dnode_engine=v8" binding.gyp
335
335
  Makefile: $(srcdir)/../../../../../../../usr/local/lib/node_modules/npm/node_modules/node-gyp/addon.gypi $(srcdir)/build/config.gypi $(srcdir)/binding.gyp $(srcdir)/../../../../../Library/Caches/node-gyp/14.16.0/include/node/common.gypi
336
336
  $(call do_cmd,regen_makefile)
337
337
 
@@ -1,21 +1,21 @@
1
1
  Release/obj.target/bufferutil/src/bufferutil.o: ../src/bufferutil.cc \
2
- /Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node/v8.h \
3
- /Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node/cppgc/common.h \
4
- /Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node/v8config.h \
5
- /Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node/v8-internal.h \
6
- /Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node/v8-version.h \
7
- /Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node/node.h \
8
- /Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node/v8-platform.h \
9
- /Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node/node_version.h \
10
- /Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node/node_buffer.h \
11
- /Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node/node_object_wrap.h \
2
+ /Users/eva/Library/Caches/node-gyp/14.16.0/include/node/v8.h \
3
+ /Users/eva/Library/Caches/node-gyp/14.16.0/include/node/cppgc/common.h \
4
+ /Users/eva/Library/Caches/node-gyp/14.16.0/include/node/v8config.h \
5
+ /Users/eva/Library/Caches/node-gyp/14.16.0/include/node/v8-internal.h \
6
+ /Users/eva/Library/Caches/node-gyp/14.16.0/include/node/v8-version.h \
7
+ /Users/eva/Library/Caches/node-gyp/14.16.0/include/node/node.h \
8
+ /Users/eva/Library/Caches/node-gyp/14.16.0/include/node/v8-platform.h \
9
+ /Users/eva/Library/Caches/node-gyp/14.16.0/include/node/node_version.h \
10
+ /Users/eva/Library/Caches/node-gyp/14.16.0/include/node/node_buffer.h \
11
+ /Users/eva/Library/Caches/node-gyp/14.16.0/include/node/node_object_wrap.h \
12
12
  ../../nan/nan.h \
13
- /Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node/uv.h \
14
- /Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node/uv/errno.h \
15
- /Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node/uv/version.h \
16
- /Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node/uv/unix.h \
17
- /Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node/uv/threadpool.h \
18
- /Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node/uv/darwin.h \
13
+ /Users/eva/Library/Caches/node-gyp/14.16.0/include/node/uv.h \
14
+ /Users/eva/Library/Caches/node-gyp/14.16.0/include/node/uv/errno.h \
15
+ /Users/eva/Library/Caches/node-gyp/14.16.0/include/node/uv/version.h \
16
+ /Users/eva/Library/Caches/node-gyp/14.16.0/include/node/uv/unix.h \
17
+ /Users/eva/Library/Caches/node-gyp/14.16.0/include/node/uv/threadpool.h \
18
+ /Users/eva/Library/Caches/node-gyp/14.16.0/include/node/uv/darwin.h \
19
19
  ../../nan/nan_callbacks.h ../../nan/nan_callbacks_12_inl.h \
20
20
  ../../nan/nan_maybe_43_inl.h ../../nan/nan_converters.h \
21
21
  ../../nan/nan_converters_43_inl.h ../../nan/nan_new.h \
@@ -49,13 +49,13 @@ CFLAGS_OBJC_Debug :=
49
49
  CFLAGS_OBJCC_Debug :=
50
50
 
51
51
  INCS_Debug := \
52
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node \
53
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/src \
54
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/deps/openssl/config \
55
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/deps/openssl/openssl/include \
56
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/deps/uv/include \
57
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/deps/zlib \
58
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/deps/v8/include \
52
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/include/node \
53
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/src \
54
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/deps/openssl/config \
55
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/deps/openssl/openssl/include \
56
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/deps/uv/include \
57
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/deps/zlib \
58
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/deps/v8/include \
59
59
  -I$(srcdir)/../nan
60
60
 
61
61
  DEFS_Release := \
@@ -102,13 +102,13 @@ CFLAGS_OBJC_Release :=
102
102
  CFLAGS_OBJCC_Release :=
103
103
 
104
104
  INCS_Release := \
105
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node \
106
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/src \
107
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/deps/openssl/config \
108
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/deps/openssl/openssl/include \
109
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/deps/uv/include \
110
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/deps/zlib \
111
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/deps/v8/include \
105
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/include/node \
106
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/src \
107
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/deps/openssl/config \
108
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/deps/openssl/openssl/include \
109
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/deps/uv/include \
110
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/deps/zlib \
111
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/deps/v8/include \
112
112
  -I$(srcdir)/../nan
113
113
 
114
114
  OBJS := \
@@ -76,7 +76,7 @@
76
76
  "v8_use_siphash": 1,
77
77
  "want_separate_host_toolset": 0,
78
78
  "xcode_version": "11.0",
79
- "nodedir": "/Users/otaviopace/Library/Caches/node-gyp/14.16.0",
79
+ "nodedir": "/Users/eva/Library/Caches/node-gyp/14.16.0",
80
80
  "standalone_static_library": 1,
81
81
  "version_git_tag": "true",
82
82
  "init_license": "MIT",
@@ -49,13 +49,13 @@ CFLAGS_OBJC_Debug :=
49
49
  CFLAGS_OBJCC_Debug :=
50
50
 
51
51
  INCS_Debug := \
52
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node \
53
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/src \
54
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/deps/openssl/config \
55
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/deps/openssl/openssl/include \
56
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/deps/uv/include \
57
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/deps/zlib \
58
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/deps/v8/include \
52
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/include/node \
53
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/src \
54
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/deps/openssl/config \
55
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/deps/openssl/openssl/include \
56
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/deps/uv/include \
57
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/deps/zlib \
58
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/deps/v8/include \
59
59
  -I$(srcdir)/../nan
60
60
 
61
61
  DEFS_Release := \
@@ -102,13 +102,13 @@ CFLAGS_OBJC_Release :=
102
102
  CFLAGS_OBJCC_Release :=
103
103
 
104
104
  INCS_Release := \
105
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/include/node \
106
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/src \
107
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/deps/openssl/config \
108
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/deps/openssl/openssl/include \
109
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/deps/uv/include \
110
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/deps/zlib \
111
- -I/Users/otaviopace/Library/Caches/node-gyp/14.16.0/deps/v8/include \
105
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/include/node \
106
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/src \
107
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/deps/openssl/config \
108
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/deps/openssl/openssl/include \
109
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/deps/uv/include \
110
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/deps/zlib \
111
+ -I/Users/eva/Library/Caches/node-gyp/14.16.0/deps/v8/include \
112
112
  -I$(srcdir)/../nan
113
113
 
114
114
  OBJS := \
@@ -9,7 +9,7 @@
9
9
  "deploy-test": "../../bin/graph deploy test/basic-event-handlers --version-label v0.0.1 --ipfs http://localhost:15001 --node http://127.0.0.1:18020"
10
10
  },
11
11
  "devDependencies": {
12
- "@graphprotocol/graph-ts": "0.26.0",
12
+ "@graphprotocol/graph-ts": "0.27.0-alpha.1",
13
13
  "apollo-fetch": "^0.7.0"
14
14
  },
15
15
  "dependencies": {
@@ -2,10 +2,10 @@
2
2
  # yarn lockfile v1
3
3
 
4
4
 
5
- "@graphprotocol/graph-ts@0.26.0":
6
- version "0.26.0"
7
- resolved "https://registry.yarnpkg.com/@graphprotocol/graph-ts/-/graph-ts-0.26.0.tgz#576f995531eebaca4374901aeaff499219e382e8"
8
- integrity sha512-GW/emOJl+35MXgmIxTnUK7dJtPCaB9u5aAwoLVqJ8swogC794O92UrXMVrAJsherUriu+yI9bLMGmNPOIi60jw==
5
+ "@graphprotocol/graph-ts@0.27.0-alpha.1":
6
+ version "0.27.0-alpha.1"
7
+ resolved "https://registry.yarnpkg.com/@graphprotocol/graph-ts/-/graph-ts-0.27.0-alpha.1.tgz#1ea72417944820959c6edb24e217b4e37099deaa"
8
+ integrity sha512-zQzbGZnP9SPo3K0y+DqPY0j80KSDAQHzGoPcR3wN8rz9++UF/vTGqWZV4f9RGY+n29SQ4KLzFzDiQaL67hxBsA==
9
9
  dependencies:
10
10
  assemblyscript "0.19.10"
11
11
 
@@ -7,7 +7,7 @@
7
7
  "build-wast": "../../bin/graph build -t wast subgraph.yaml"
8
8
  },
9
9
  "devDependencies": {
10
- "@graphprotocol/graph-ts": "0.26.0"
10
+ "@graphprotocol/graph-ts": "0.27.0-alpha.1"
11
11
  },
12
12
  "resolutions": {
13
13
  "assemblyscript": "0.19.10"
@@ -2,10 +2,10 @@
2
2
  # yarn lockfile v1
3
3
 
4
4
 
5
- "@graphprotocol/graph-ts@0.26.0":
6
- version "0.26.0"
7
- resolved "https://registry.yarnpkg.com/@graphprotocol/graph-ts/-/graph-ts-0.26.0.tgz#576f995531eebaca4374901aeaff499219e382e8"
8
- integrity sha512-GW/emOJl+35MXgmIxTnUK7dJtPCaB9u5aAwoLVqJ8swogC794O92UrXMVrAJsherUriu+yI9bLMGmNPOIi60jw==
5
+ "@graphprotocol/graph-ts@0.27.0-alpha.1":
6
+ version "0.27.0-alpha.1"
7
+ resolved "https://registry.yarnpkg.com/@graphprotocol/graph-ts/-/graph-ts-0.27.0-alpha.1.tgz#1ea72417944820959c6edb24e217b4e37099deaa"
8
+ integrity sha512-zQzbGZnP9SPo3K0y+DqPY0j80KSDAQHzGoPcR3wN8rz9++UF/vTGqWZV4f9RGY+n29SQ4KLzFzDiQaL67hxBsA==
9
9
  dependencies:
10
10
  assemblyscript "0.19.10"
11
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphprotocol/graph-cli",
3
- "version": "0.29.0",
3
+ "version": "0.30.0-alpha.1",
4
4
  "license": "(Apache-2.0 OR MIT)",
5
5
  "description": "CLI for building for and deploying to The Graph",
6
6
  "dependencies": {
@@ -1,7 +1,8 @@
1
1
  version: '3'
2
2
  services:
3
3
  graph-node:
4
- image: graphprotocol/graph-node:2e0dc0b # TODO: change to latest once it has 0.0.5
4
+ # TODO: change to "latest" once it supports apiVersion 0.0.5 and specVersion 0.0.7
5
+ image: graphprotocol/graph-node:4a8e819
5
6
  ports:
6
7
  - '18000:8000'
7
8
  - '18001:8001'
@@ -20,7 +21,8 @@ services:
20
21
  ipfs: 'ipfs:5001'
21
22
  ethereum: 'test:http://ethereum:8545'
22
23
  GRAPH_LOG: trace
23
- GRAPH_MAX_API_VERSION: '0.0.5' # TODO: remove once latest has 0.0.5 by default
24
+ GRAPH_MAX_API_VERSION: '0.0.7' # TODO: remove once "latest" supports apiVersion 0.0.7 by default
25
+ GRAPH_MAX_SPEC_VERSION: '0.0.5' # TODO: remove once "latest" supports specVersion 0.0.5 by default
24
26
  ethereum:
25
27
  image: trufflesuite/ganache-cli:latest
26
28
  ports:
@@ -120,41 +120,6 @@ module.exports = class SchemaCodeGenerator {
120
120
  return klass
121
121
  }
122
122
 
123
- // Fields that are non-nullable get an empty/zero value set in the class constructor.
124
- _generateDefaultFieldValues(fields) {
125
- const indexOfIdField = fields.findIndex(field => field.getIn(['name', 'value']) === 'id')
126
- const fieldsWithoutId = fields.remove(indexOfIdField)
127
-
128
- const fieldsSetCalls = fieldsWithoutId
129
- .map(field => {
130
- const name = field.getIn(['name', 'value'])
131
- const type = this._typeFromGraphQl(field.get('type'), true, true)
132
-
133
- const isNullable = type instanceof tsCodegen.NullableType
134
-
135
- const directives = field.get('directives')
136
- const isDerivedFrom = directives.some(directive => directive.getIn(['name', 'value']) === 'derivedFrom')
137
-
138
- return { name, type, isNullable, isDerivedFrom }
139
- })
140
- // We only call the setter with the default value in the constructor for fields that are:
141
- // - Not nullable, so that AS doesn't break when subgraph developers try to access them before a `set`
142
- // - It doesn't matter if it's primitive or not
143
- // - Not tagged as `derivedFrom`, because they only exist in query time
144
- .filter(({
145
- isNullable,
146
- isDerivedFrom,
147
- }) => !isNullable && !isDerivedFrom)
148
- .map(({ name, type, isNullable }) => {
149
- const fieldTypeString = isNullable ? type.inner.toString() : type.toString()
150
-
151
- return `
152
- this.set('${name}', ${typesCodegen.initializedValueFromAsc(fieldTypeString)})`
153
- })
154
-
155
- return fieldsSetCalls.join('')
156
- }
157
-
158
123
  _generateConstructor(entityName, fields) {
159
124
  const idField = IdField.fromFields(fields)
160
125
  return tsCodegen.method(
@@ -164,7 +129,6 @@ module.exports = class SchemaCodeGenerator {
164
129
  `
165
130
  super()
166
131
  this.set('id', ${idField.tsValueFrom()})
167
- ${this._generateDefaultFieldValues(fields)}
168
132
  `,
169
133
  )
170
134
  }
@@ -313,7 +277,7 @@ Suggestion: add an '!' to the member type of the List, change from '[${baseType}
313
277
  }
314
278
  }
315
279
 
316
- _typeFromGraphQl(gqlType, nullable = true, nullablePrimitive = false) {
280
+ _typeFromGraphQl(gqlType, nullable = true) {
317
281
  if (gqlType.get('kind') === 'NonNullType') {
318
282
  return this._typeFromGraphQl(gqlType.get('type'), false)
319
283
  } else if (gqlType.get('kind') === 'ListType') {
@@ -324,13 +288,8 @@ Suggestion: add an '!' to the member type of the List, change from '[${baseType}
324
288
  let type = tsCodegen.namedType(
325
289
  typesCodegen.ascTypeForValue(this._resolveFieldType(gqlType)),
326
290
  )
327
-
328
- // Will not wrap primitives into NullableType by default.
329
- if (!nullablePrimitive && type.isPrimitive()) {
330
- return type
331
- }
332
-
333
- return nullable ? tsCodegen.nullableType(type) : type
291
+ // In AssemblyScript, primitives cannot be nullable.
292
+ return nullable && !type.isPrimitive() ? tsCodegen.nullableType(type) : type
334
293
  }
335
294
  }
336
295
  }
@@ -114,9 +114,6 @@ describe('Schema code generator', () => {
114
114
  body: `
115
115
  super()
116
116
  this.set('id', Value.fromString(id))
117
-
118
- this.set('name', Value.fromString(''))
119
- this.set('count', Value.fromI32(0))
120
117
  `,
121
118
  },
122
119
  {
@@ -277,9 +274,6 @@ describe('Schema code generator', () => {
277
274
  body: `
278
275
  super()
279
276
  this.set('id', Value.fromString(id))
280
-
281
- this.set('amount', Value.fromBigInt(BigInt.zero()))
282
- this.set('account', Value.fromString(''))
283
277
  `,
284
278
  },
285
279
  {
@@ -188,28 +188,28 @@ const VALUE_TO_ASSEMBLYSCRIPT = [
188
188
  const ASSEMBLYSCRIPT_TO_VALUE = [
189
189
  // Arrays
190
190
 
191
- ['Array<Address>', '[Bytes]', code => `Value.fromBytesArray(${code})`, 'new Array(0)'],
192
- ['Array<Bytes>', '[Bytes]', code => `Value.fromBytesArray(${code})`, 'new Array(0)'],
193
- ['Array<boolean>', '[Boolean]', code => `Value.fromBooleanArray(${code})`, 'new Array(0)'],
194
- ['Array<i32>', '[Int]', code => `Value.fromI32Array(${code})`, 'new Array(0)'],
195
- ['Array<BigInt>', '[BigInt]', code => `Value.fromBigIntArray(${code})`, 'new Array(0)'],
196
- ['Array<string>', '[String]', code => `Value.fromStringArray(${code})`, 'new Array(0)'],
197
- ['Array<string>', '[ID]', code => `Value.fromStringArray(${code})`, 'new Array(0)'],
198
- ['Array<BigDecimal>', '[BigDecimal]', code => `Value.fromBigDecimalArray(${code})`, 'new Array(0)'],
199
- ['Array<string>', /\[.*\]/, code => `Value.fromStringArray(${code})`, 'new Array(0)'],
200
- ['Array<string | null>', null, code => `Value.fromStringArray(${code})`, 'new Array(0)'],
191
+ ['Array<Address>', '[Bytes]', code => `Value.fromBytesArray(${code})`],
192
+ ['Array<Bytes>', '[Bytes]', code => `Value.fromBytesArray(${code})`],
193
+ ['Array<boolean>', '[Boolean]', code => `Value.fromBooleanArray(${code})`],
194
+ ['Array<i32>', '[Int]', code => `Value.fromI32Array(${code})`],
195
+ ['Array<BigInt>', '[BigInt]', code => `Value.fromBigIntArray(${code})`],
196
+ ['Array<string>', '[String]', code => `Value.fromStringArray(${code})`],
197
+ ['Array<string>', '[ID]', code => `Value.fromStringArray(${code})`],
198
+ ['Array<BigDecimal>', '[BigDecimal]', code => `Value.fromBigDecimalArray(${code})`],
199
+ ['Array<string>', /\[.*\]/, code => `Value.fromStringArray(${code})`],
200
+ ['Array<string | null>', null, code => `Value.fromStringArray(${code})`],
201
201
 
202
202
  // Scalar values
203
203
 
204
- ['Address', 'Bytes', code => `Value.fromBytes(${code})`, 'Address.zero()'],
205
- ['Bytes', 'Bytes', code => `Value.fromBytes(${code})`, 'Bytes.empty()'],
206
- ['boolean', 'Boolean', code => `Value.fromBoolean(${code})`, 'false'],
207
- ['i32', 'Int', code => `Value.fromI32(${code})`, '0'],
208
- ['BigInt', 'BigInt', code => `Value.fromBigInt(${code})`, 'BigInt.zero()'],
209
- ['string', 'String', code => `Value.fromString(${code})`, "''"],
210
- ['string', 'ID', code => `Value.fromString(${code})`, "''"],
211
- ['BigDecimal', 'BigDecimal', code => `Value.fromBigDecimal(${code})`, 'BigDecimal.zero()'],
212
- ['string', /.*/, code => `Value.fromString(${code})`, "''"],
204
+ ['Address', 'Bytes', code => `Value.fromBytes(${code})`],
205
+ ['Bytes', 'Bytes', code => `Value.fromBytes(${code})`],
206
+ ['boolean', 'Boolean', code => `Value.fromBoolean(${code})`],
207
+ ['i32', 'Int', code => `Value.fromI32(${code})`],
208
+ ['BigInt', 'BigInt', code => `Value.fromBigInt(${code})`],
209
+ ['string', 'String', code => `Value.fromString(${code})`],
210
+ ['string', 'ID', code => `Value.fromString(${code})`],
211
+ ['BigDecimal', 'BigDecimal', code => `Value.fromBigDecimal(${code})`],
212
+ ['string', /.*/, code => `Value.fromString(${code})`],
213
213
  ]
214
214
 
215
215
  /**
@@ -66,27 +66,6 @@ const findConversionToType = (fromTypeSystem, toTypeSystem, toType) => {
66
66
  return objectifyConversion(fromTypeSystem, toTypeSystem, conversion)
67
67
  }
68
68
 
69
- const findInitializationForType = (fromTypeSystem, toTypeSystem, ascType) => {
70
- const conversions = conversionsForTypeSystems(fromTypeSystem, toTypeSystem)
71
-
72
- const conversion = conversions.find(conversion =>
73
- typeof conversion.get(0) === 'string'
74
- ? conversion.get(0) === ascType
75
- : ascType.match(conversion.get(0)),
76
- )
77
-
78
- if (conversion === undefined) {
79
- throw new Error(
80
- `Conversion from '${fromTypeSystem}' to '${toTypeSystem}' for ` +
81
- `target type '${ascType}' is not supported`,
82
- )
83
- }
84
-
85
- const conversionObj = objectifyConversion(fromTypeSystem, toTypeSystem, conversion)
86
-
87
- return conversionObj.get('convert')(conversion.get(3))
88
- }
89
-
90
69
  // High-level type system API
91
70
 
92
71
  const ascTypeForProtocol = (protocol, protocolType) =>
@@ -120,9 +99,6 @@ const valueToAsc = (code, valueType) =>
120
99
  const valueFromAsc = (code, valueType) =>
121
100
  findConversionToType('AssemblyScript', 'Value', valueType).get('convert')(code)
122
101
 
123
- const initializedValueFromAsc = ascType =>
124
- findInitializationForType('AssemblyScript', 'Value', ascType)
125
-
126
102
  module.exports = {
127
103
  // protocol <-> AssemblyScript
128
104
  ascTypeForProtocol,
@@ -138,5 +114,4 @@ module.exports = {
138
114
  valueTypeForAsc,
139
115
  valueToAsc,
140
116
  valueFromAsc,
141
- initializedValueFromAsc,
142
117
  }
@@ -449,26 +449,4 @@ describe('AssemblyScript -> Value', () => {
449
449
  expect(codegen.valueFromAsc('x', '[String]')).toBe('Value.fromStringArray(x)')
450
450
  expect(codegen.valueTypeForAsc('Array<string>')).toBe('[String]')
451
451
  })
452
-
453
- describe('Initialization for zero/empty values', () => {
454
- test('Array<string>', () => {
455
- expect(codegen.initializedValueFromAsc('Array<string>')).toBe('Value.fromStringArray(new Array(0))')
456
- })
457
-
458
- test('Array<string | null>', () => {
459
- expect(codegen.initializedValueFromAsc('Array<string | null>')).toBe('Value.fromStringArray(new Array(0))')
460
- })
461
-
462
- test('i32', () => {
463
- expect(codegen.initializedValueFromAsc('i32')).toBe('Value.fromI32(0)')
464
- })
465
-
466
- test('string', () => {
467
- expect(codegen.initializedValueFromAsc('string')).toBe("Value.fromString('')")
468
- })
469
-
470
- test('BigInt', () => {
471
- expect(codegen.initializedValueFromAsc('BigInt')).toBe('Value.fromBigInt(BigInt.zero())')
472
- })
473
- })
474
452
  })
@@ -294,7 +294,6 @@ $ graph create --node ${node} ${subgraphName}`)
294
294
  const base = requestUrl.protocol + '//' + requestUrl.hostname
295
295
  let playground = res.playground
296
296
  let queries = res.queries
297
- let subscriptions = res.subscriptions
298
297
 
299
298
  // Add a base URL if graph-node did not return the full URL
300
299
  if (playground.charAt(0) === ':') {
@@ -303,9 +302,6 @@ $ graph create --node ${node} ${subgraphName}`)
303
302
  if (queries.charAt(0) === ':') {
304
303
  queries = base + queries
305
304
  }
306
- if (subscriptions.charAt(0) === ':') {
307
- subscriptions = base + subscriptions
308
- }
309
305
 
310
306
  if (isHostedService) {
311
307
  print.success(
@@ -318,7 +314,6 @@ $ graph create --node ${node} ${subgraphName}`)
318
314
  }
319
315
  print.info('\nSubgraph endpoints:')
320
316
  print.info(`Queries (HTTP): ${queries}`)
321
- print.info(`Subscriptions (WS): ${subscriptions}`)
322
317
  print.info(``)
323
318
  }
324
319
  },
@@ -288,6 +288,7 @@ const getEtherscanLikeAPIUrl = (network) => {
288
288
  case "aurora": return `https://api.aurorascan.dev/api`;
289
289
  case "aurora-testnet": return `https://api-testnet.aurorascan.dev/api`;
290
290
  case "optimism-kovan": return `https://api-kovan-optimistic.etherscan.io/api`;
291
+ case "avalanche": return `https://api.snowtrace.io/api`;
291
292
  default: return `https://api-${network}.etherscan.io/api`;
292
293
  }
293
294
  }