@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
|
@@ -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 =
|
|
30
|
-
|
|
31
|
-
|
|
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',
|
package/dist/scaffold/schema.js
CHANGED
|
@@ -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
|
-
|
|
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}`;
|
package/oclif.manifest.json
CHANGED
package/package.json
CHANGED