@graphprotocol/graph-cli 0.43.0-alpha-20230320101423-3c6b0a4 → 0.43.0-alpha-20230320183828-3d019eb

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,6 +1,6 @@
1
1
  # @graphprotocol/graph-cli
2
2
 
3
- ## 0.43.0-alpha-20230320101423-3c6b0a4
3
+ ## 0.43.0-alpha-20230320183828-3d019eb
4
4
 
5
5
  ### Minor Changes
6
6
 
@@ -26,10 +26,9 @@ exports.allowedStudioNetworks = [
26
26
  ];
27
27
  const validateStudioNetwork = ({ studio, product, network, }) => {
28
28
  const isStudio = studio || product === 'subgraph-studio';
29
- const isAllowedNetwork = !network ||
30
- exports.allowedStudioNetworks.includes(
31
- // @ts-expect-error we're checking if the network is allowed
32
- network);
29
+ const isAllowedNetwork = exports.allowedStudioNetworks.includes(
30
+ // @ts-expect-error we're checking if the network is allowed
31
+ network);
33
32
  if (isStudio && !isAllowedNetwork) {
34
33
  throw new Error(`The Subgraph Studio only allows subgraphs for these networks: ${exports.allowedStudioNetworks.join(', ')}`);
35
34
  }
@@ -16,12 +16,6 @@ describe('Version Command Helpers', () => {
16
16
  network: 'gnosis',
17
17
  })).not.toThrow(new Error(`The Subgraph Studio only allows subgraphs for these networks: ${studio_1.allowedStudioNetworks.join(', ')}`));
18
18
  });
19
- test('And no network is passed', () => {
20
- expect(() => (0, studio_1.validateStudioNetwork)({
21
- studio: true,
22
- network: undefined,
23
- })).not.toThrow(new Error(`The Subgraph Studio only allows subgraphs for these networks: ${studio_1.allowedStudioNetworks.join(', ')}`));
24
- });
25
19
  test("And it's NOT an allowed network", () => {
26
20
  expect(() => (0, studio_1.validateStudioNetwork)({
27
21
  product: 'subgraph-studio',
@@ -39,7 +39,13 @@ function abiEvents(abi) {
39
39
  exports.abiEvents = abiEvents;
40
40
  const protocolTypeToGraphQL = (protocol, name) => {
41
41
  const ascType = (0, types_1.ascTypeForProtocol)(protocol, name);
42
- return (0, types_1.valueTypeForAsc)(ascType);
42
+ // TODO: we need to figure out how to improve types
43
+ // but for now this always is returning a string
44
+ const convertedType = (0, types_1.valueTypeForAsc)(ascType);
45
+ // TODO: this is a hack to make array type non-nullable
46
+ // We should refactor the way we convert the Values from ASC to GraphQL
47
+ // For arrays we always want non-nullable children
48
+ return convertedType.endsWith(']') ? convertedType.replace(']', '!]') : convertedType;
43
49
  };
44
50
  exports.protocolTypeToGraphQL = protocolTypeToGraphQL;
45
51
  const generateField = ({ name, type, protocolName, }) => `${name}: ${(0, exports.protocolTypeToGraphQL)(protocolName, type)}! # ${type}`;
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.43.0-alpha-20230320101423-3c6b0a4",
2
+ "version": "0.43.0-alpha-20230320183828-3d019eb",
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.43.0-alpha-20230320101423-3c6b0a4",
3
+ "version": "0.43.0-alpha-20230320183828-3d019eb",
4
4
  "description": "CLI for building for and deploying to The Graph",
5
5
  "license": "(Apache-2.0 OR MIT)",
6
6
  "engines": {