From de10cebe4f57f197e853fd40b4dab910c608a91f Mon Sep 17 00:00:00 2001 From: Alex Ni <12097569+nialexsan@users.noreply.github.com> Date: Tue, 17 Sep 2024 13:23:59 -0400 Subject: [PATCH 1/3] update packages and migrate code --- package-lock.json | 639 +++++++++--------- package.json | 12 +- src/api/apollo/client.ts | 27 +- src/api/apollo/resolvers.ts | 10 +- src/components/AccountAvatars.tsx | 2 +- .../CadenceEditor/ControlPanel/index.tsx | 7 +- .../Editor/FileExplorer/MenuList.tsx | 1 - src/providers/Project/index.tsx | 20 +- src/providers/Project/projectHooks.ts | 25 +- src/providers/Project/projectMutator.ts | 56 +- src/types.ts | 1 - 11 files changed, 414 insertions(+), 386 deletions(-) diff --git a/package-lock.json b/package-lock.json index fb85748f..87b45001 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6,7 +6,8 @@ "": { "name": "flow-playground", "dependencies": { - "@apollo/react-hooks": "^3.1.5", + "@apollo/client": "^3.11.8", + "@apollo/react-hooks": "^4.0.0", "@emotion/react": "^11.11.1", "@emotion/styled": "^11.11.0", "@headlessui/react": "^1.7.3", @@ -19,13 +20,8 @@ "@sentry/react": "^7.44.0", "@sentry/tracing": "^7.44.0", "allotment": "^1.17.0", - "apollo-cache-inmemory": "^1.6.6", - "apollo-client": "^2.6.10", - "apollo-link": "^1.2.14", - "apollo-link-debounce": "^2.1.0", - "apollo-link-error": "^1.1.13", - "apollo-link-http": "^1.5.17", - "apollo-link-serialize": "^2.1.0", + "apollo-link-debounce": "^3.0.0", + "apollo-link-serialize": "^4.0.0", "cross-fetch": "^3.1.5", "date-fns": "^2.29.3", "detect-browser": "^5.3.0", @@ -125,24 +121,130 @@ "node": ">=6.0.0" } }, - "node_modules/@apollo/react-common": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/@apollo/react-common/-/react-common-3.1.4.tgz", - "integrity": "sha512-X5Kyro73bthWSCBJUC5XYQqMnG0dLWuDZmVkzog9dynovhfiVCV4kPSdgSIkqnb++cwCzOVuQ4rDKVwo2XRzQA==", + "node_modules/@apollo/client": { + "version": "3.11.8", + "resolved": "https://registry.npmjs.org/@apollo/client/-/client-3.11.8.tgz", + "integrity": "sha512-CgG1wbtMjsV2pRGe/eYITmV5B8lXUCYljB2gB/6jWTFQcrvirUVvKg7qtFdjYkQSFbIffU1IDyxgeaN81eTjbA==", + "dependencies": { + "@graphql-typed-document-node/core": "^3.1.1", + "@wry/caches": "^1.0.0", + "@wry/equality": "^0.5.6", + "@wry/trie": "^0.5.0", + "graphql-tag": "^2.12.6", + "hoist-non-react-statics": "^3.3.2", + "optimism": "^0.18.0", + "prop-types": "^15.7.2", + "rehackt": "^0.1.0", + "response-iterator": "^0.2.6", + "symbol-observable": "^4.0.0", + "ts-invariant": "^0.10.3", + "tslib": "^2.3.0", + "zen-observable-ts": "^1.2.5" + }, + "peerDependencies": { + "graphql": "^15.0.0 || ^16.0.0", + "graphql-ws": "^5.5.5", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc <19.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || >=19.0.0-rc <19.0.0", + "subscriptions-transport-ws": "^0.9.0 || ^0.11.0" + }, + "peerDependenciesMeta": { + "graphql-ws": { + "optional": true + }, + "react": { + "optional": true + }, + "react-dom": { + "optional": true + }, + "subscriptions-transport-ws": { + "optional": true + } + } + }, + "node_modules/@apollo/client/node_modules/@wry/context": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/@wry/context/-/context-0.7.4.tgz", + "integrity": "sha512-jmT7Sb4ZQWI5iyu3lobQxICu2nC/vbUhP0vIdd6tHC9PTfenmRmuIFqktc6GH9cgi+ZHnsLWPvfSvc4DrYmKiQ==", + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@apollo/client/node_modules/@wry/equality": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/@wry/equality/-/equality-0.5.7.tgz", + "integrity": "sha512-BRFORjsTuQv5gxcXsuDXx6oGRhuVsEGwZy6LOzRRfgu+eSfxbhUQ9L9YtSEIuIjY/o7g3iWFjrc5eSY1GXP2Dw==", + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@apollo/client/node_modules/optimism": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/optimism/-/optimism-0.18.0.tgz", + "integrity": "sha512-tGn8+REwLRNFnb9WmcY5IfpOqeX2kpaYJ1s6Ae3mn12AeydLkR3j+jSCmVQFoXqU8D41PAJ1RG1rCRNWmNZVmQ==", "dependencies": { - "ts-invariant": "^0.4.4", - "tslib": "^1.10.0" + "@wry/caches": "^1.0.0", + "@wry/context": "^0.7.0", + "@wry/trie": "^0.4.3", + "tslib": "^2.3.0" + } + }, + "node_modules/@apollo/client/node_modules/optimism/node_modules/@wry/trie": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@wry/trie/-/trie-0.4.3.tgz", + "integrity": "sha512-I6bHwH0fSf6RqQcnnXLJKhkSXG45MFral3GxPaY4uAl0LYDZM+YDVDAiU9bYwjTuysy1S0IeecWtmq1SZA3M1w==", + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@apollo/client/node_modules/symbol-observable": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-4.0.0.tgz", + "integrity": "sha512-b19dMThMV4HVFynSAM1++gBHAbk2Tc/osgLIBZMKsyqh34jb2e8Os7T6ZW/Bt3pJFdBTd2JwAnAAEQV7rSNvcQ==", + "engines": { + "node": ">=0.10" + } + }, + "node_modules/@apollo/client/node_modules/ts-invariant": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.10.3.tgz", + "integrity": "sha512-uivwYcQaxAucv1CzRp2n/QdYPo4ILf9VXgH19zEIjFx2EJufV16P0JtJVpYHy89DItG6Kwj2oIUjrcK5au+4tQ==", + "dependencies": { + "tslib": "^2.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@apollo/client/node_modules/tslib": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==" + }, + "node_modules/@apollo/client/node_modules/zen-observable-ts": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/zen-observable-ts/-/zen-observable-ts-1.2.5.tgz", + "integrity": "sha512-QZWQekv6iB72Naeake9hS1KxHlotfRpe+WGNbNx5/ta+R3DNjVO2bswf63gXlWDcs+EMd7XY8HfVQyP1X6T4Zg==", + "dependencies": { + "zen-observable": "0.8.15" } }, "node_modules/@apollo/react-hooks": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@apollo/react-hooks/-/react-hooks-3.1.5.tgz", - "integrity": "sha512-y0CJ393DLxIIkksRup4nt+vSjxalbZBXnnXxYbviq/woj+zKa431zy0yT4LqyRKpFy9ahMIwxBnBwfwIoupqLQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@apollo/react-hooks/-/react-hooks-4.0.0.tgz", + "integrity": "sha512-fCu0cbne3gbUl0QbA8X4L33iuuFVQbC5Jo2MIKRK8CyawR6PoxDpFdFA1kc6033ODZuZZ9Eo4RdeJFlFIIYcLA==", "dependencies": { - "@apollo/react-common": "^3.1.4", - "@wry/equality": "^0.1.9", - "ts-invariant": "^0.4.4", - "tslib": "^1.10.0" + "@apollo/client": "latest" } }, "node_modules/@ardatan/aggregate-error": { @@ -3998,7 +4100,6 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.2.0.tgz", "integrity": "sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==", - "dev": true, "peerDependencies": { "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" } @@ -5675,7 +5776,8 @@ "node_modules/@types/node": { "version": "16.18.46", "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.46.tgz", - "integrity": "sha512-Mnq3O9Xz52exs3mlxMcQuA7/9VFe/dXcrgAyfjLkABIqxXKOgBRjyazTxUbjsxDa4BP7hhPliyjVTP9RDP14xg==" + "integrity": "sha512-Mnq3O9Xz52exs3mlxMcQuA7/9VFe/dXcrgAyfjLkABIqxXKOgBRjyazTxUbjsxDa4BP7hhPliyjVTP9RDP14xg==", + "dev": true }, "node_modules/@types/parse-json": { "version": "4.0.0", @@ -5865,11 +5967,6 @@ "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", "dev": true }, - "node_modules/@types/zen-observable": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/@types/zen-observable/-/zen-observable-0.8.1.tgz", - "integrity": "sha512-wmk0xQI6Yy7Fs/il4EpOcflG4uonUpYGqvZARESLc2oy4u69fkatFLbJOeW4Q6awO15P4rduAe6xkwHevpXcUQ==" - }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "5.38.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.38.0.tgz", @@ -6357,23 +6454,38 @@ "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", "dev": true }, - "node_modules/@wry/context": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/@wry/context/-/context-0.4.4.tgz", - "integrity": "sha512-LrKVLove/zw6h2Md/KZyWxIkFM6AoyKp71OqpH9Hiip1csjPVoD3tPxlbQUNxEnHENks3UGgNpSBCAfq9KWuag==", + "node_modules/@wry/caches": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@wry/caches/-/caches-1.0.1.tgz", + "integrity": "sha512-bXuaUNLVVkD20wcGBWRyo7j9N3TxePEWFZj2Y+r9OoUzfqmavM84+mFykRicNsBqatba5JLay1t48wxaXaWnlA==", "dependencies": { - "@types/node": ">=6", - "tslib": "^1.9.3" + "tslib": "^2.3.0" + }, + "engines": { + "node": ">=8" } }, - "node_modules/@wry/equality": { - "version": "0.1.11", - "resolved": "https://registry.npmjs.org/@wry/equality/-/equality-0.1.11.tgz", - "integrity": "sha512-mwEVBDUVODlsQQ5dfuLUS5/Tf7jqUKyhKYHmVi4fPB6bDMOfWvUPJmKgS1Z7Za/sOI3vzWt4+O7yCiL/70MogA==", + "node_modules/@wry/caches/node_modules/tslib": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==" + }, + "node_modules/@wry/trie": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@wry/trie/-/trie-0.5.0.tgz", + "integrity": "sha512-FNoYzHawTMk/6KMQoEG5O4PuioX19UbwdQKF44yw0nLfOypfQdjtfZzo/UIJWAJ23sNIFbD1Ug9lbaDGMwbqQA==", "dependencies": { - "tslib": "^1.9.3" + "tslib": "^2.3.0" + }, + "engines": { + "node": ">=8" } }, + "node_modules/@wry/trie/node_modules/tslib": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==" + }, "node_modules/@xtuc/ieee754": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", @@ -6608,112 +6720,23 @@ "node": ">= 8" } }, - "node_modules/apollo-cache": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/apollo-cache/-/apollo-cache-1.3.5.tgz", - "integrity": "sha512-1XoDy8kJnyWY/i/+gLTEbYLnoiVtS8y7ikBr/IfmML4Qb+CM7dEEbIUOjnY716WqmZ/UpXIxTfJsY7rMcqiCXA==", - "dependencies": { - "apollo-utilities": "^1.3.4", - "tslib": "^1.10.0" - } - }, - "node_modules/apollo-cache-inmemory": { - "version": "1.6.6", - "resolved": "https://registry.npmjs.org/apollo-cache-inmemory/-/apollo-cache-inmemory-1.6.6.tgz", - "integrity": "sha512-L8pToTW/+Xru2FFAhkZ1OA9q4V4nuvfoPecBM34DecAugUZEBhI2Hmpgnzq2hTKZ60LAMrlqiASm0aqAY6F8/A==", - "dependencies": { - "apollo-cache": "^1.3.5", - "apollo-utilities": "^1.3.4", - "optimism": "^0.10.0", - "ts-invariant": "^0.4.0", - "tslib": "^1.10.0" - } - }, - "node_modules/apollo-client": { - "version": "2.6.10", - "resolved": "https://registry.npmjs.org/apollo-client/-/apollo-client-2.6.10.tgz", - "integrity": "sha512-jiPlMTN6/5CjZpJOkGeUV0mb4zxx33uXWdj/xQCfAMkuNAC3HN7CvYDyMHHEzmcQ5GV12LszWoQ/VlxET24CtA==", - "dependencies": { - "@types/zen-observable": "^0.8.0", - "apollo-cache": "1.3.5", - "apollo-link": "^1.0.0", - "apollo-utilities": "1.3.4", - "symbol-observable": "^1.0.2", - "ts-invariant": "^0.4.0", - "tslib": "^1.10.0", - "zen-observable": "^0.8.0" - } - }, - "node_modules/apollo-link": { - "version": "1.2.14", - "resolved": "https://registry.npmjs.org/apollo-link/-/apollo-link-1.2.14.tgz", - "integrity": "sha512-p67CMEFP7kOG1JZ0ZkYZwRDa369w5PIjtMjvrQd/HnIV8FRsHRqLqK+oAZQnFa1DDdZtOtHTi+aMIW6EatC2jg==", - "dependencies": { - "apollo-utilities": "^1.3.0", - "ts-invariant": "^0.4.0", - "tslib": "^1.9.3", - "zen-observable-ts": "^0.8.21" - } - }, "node_modules/apollo-link-debounce": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/apollo-link-debounce/-/apollo-link-debounce-2.1.0.tgz", - "integrity": "sha512-tpAb3558SoZVKL8Y5N1pyrw4ko9eYWGpveKCp1fjfDz8bA4977fyfR4OZdrxwBtTjhYf5wNq2N9YTtKaq3OZIg==", - "dependencies": { - "apollo-link": "^1.2.2", - "zen-observable-ts": "^0.8.9" - } - }, - "node_modules/apollo-link-error": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/apollo-link-error/-/apollo-link-error-1.1.13.tgz", - "integrity": "sha512-jAZOOahJU6bwSqb2ZyskEK1XdgUY9nkmeclCrW7Gddh1uasHVqmoYc4CKdb0/H0Y1J9lvaXKle2Wsw/Zx1AyUg==", - "dependencies": { - "apollo-link": "^1.2.14", - "apollo-link-http-common": "^0.2.16", - "tslib": "^1.9.3" - } - }, - "node_modules/apollo-link-http": { - "version": "1.5.17", - "resolved": "https://registry.npmjs.org/apollo-link-http/-/apollo-link-http-1.5.17.tgz", - "integrity": "sha512-uWcqAotbwDEU/9+Dm9e1/clO7hTB2kQ/94JYcGouBVLjoKmTeJTUPQKcJGpPwUjZcSqgYicbFqQSoJIW0yrFvg==", - "dependencies": { - "apollo-link": "^1.2.14", - "apollo-link-http-common": "^0.2.16", - "tslib": "^1.9.3" - } - }, - "node_modules/apollo-link-http-common": { - "version": "0.2.16", - "resolved": "https://registry.npmjs.org/apollo-link-http-common/-/apollo-link-http-common-0.2.16.tgz", - "integrity": "sha512-2tIhOIrnaF4UbQHf7kjeQA/EmSorB7+HyJIIrUjJOKBgnXwuexi8aMecRlqTIDWcyVXCeqLhUnztMa6bOH/jTg==", - "dependencies": { - "apollo-link": "^1.2.14", - "ts-invariant": "^0.4.0", - "tslib": "^1.9.3" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/apollo-link-debounce/-/apollo-link-debounce-3.0.0.tgz", + "integrity": "sha512-Ytig2Ml41T2bovBIoKkStPKoIh0r/kTK1dSM9Gpvo5W3BAPxt1WguAkeaPLJqeuvrNJIjQ/Pl38/14VVA0hdYg==", + "peerDependencies": { + "@apollo/client": "^3.0.0" } }, "node_modules/apollo-link-serialize": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/apollo-link-serialize/-/apollo-link-serialize-2.1.0.tgz", - "integrity": "sha512-JkTs63KdQe+8ttBInv6G+vI/Nv3CwW1gsbv6hLkf6Cb+I0s+P+upOze0mUWJeMCrbxXhHw99s7tG+jqbRSLdCw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/apollo-link-serialize/-/apollo-link-serialize-4.0.0.tgz", + "integrity": "sha512-GQJkwj1Fm/OQyte5+y64GsWBIL89AaALlJGc4plMzTttfMxMREXIttXdaP4BzU5xvC/PwVP0khKS/5CbEX8pjw==", "dependencies": { - "apollo-link": "^1.2.4", + "@apollo/client": "^3.3.20", "zen-observable-ts": "^0.8.11" } }, - "node_modules/apollo-utilities": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/apollo-utilities/-/apollo-utilities-1.3.4.tgz", - "integrity": "sha512-pk2hiWrCXMAy2fRPwEyhvka+mqwzeP60Jr1tRYi5xru+3ko94HI9o6lK0CT33/w4RDlxWchmdhDCrvdr+pHCig==", - "dependencies": { - "@wry/equality": "^0.1.2", - "fast-json-stable-stringify": "^2.0.0", - "ts-invariant": "^0.4.0", - "tslib": "^1.10.0" - } - }, "node_modules/arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", @@ -9818,7 +9841,8 @@ "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true }, "node_modules/fast-levenshtein": { "version": "2.0.6", @@ -10497,7 +10521,7 @@ "version": "5.12.1", "resolved": "https://registry.npmjs.org/graphql-ws/-/graphql-ws-5.12.1.tgz", "integrity": "sha512-umt4f5NnMK46ChM2coO36PTFhHouBrK9stWWBczERguwYrGnPNxJ9dimU6IyOBfOkC6Izhkg4H8+F51W/8CYDg==", - "dev": true, + "devOptional": true, "engines": { "node": ">=10" }, @@ -14443,14 +14467,6 @@ "opener": "bin/opener-bin.js" } }, - "node_modules/optimism": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/optimism/-/optimism-0.10.3.tgz", - "integrity": "sha512-9A5pqGoQk49H6Vhjb9kPgAeeECfUDF6aIICbMDL23kDLStBn1MWk3YvcZ4xWF9CsSf6XEgvRLkXy4xof/56vVw==", - "dependencies": { - "@wry/context": "^0.4.0" - } - }, "node_modules/ora": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", @@ -15464,6 +15480,23 @@ "jsesc": "bin/jsesc" } }, + "node_modules/rehackt": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/rehackt/-/rehackt-0.1.0.tgz", + "integrity": "sha512-7kRDOuLHB87D/JESKxQoRwv4DzbIdwkAGQ7p6QKGdVlY1IZheUnVhlk/4UZlNUVxdAXpyxikE3URsG067ybVzw==", + "peerDependencies": { + "@types/react": "*", + "react": "*" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "react": { + "optional": true + } + } + }, "node_modules/relateurl": { "version": "0.2.7", "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz", @@ -15599,6 +15632,14 @@ "node": ">=10" } }, + "node_modules/response-iterator": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/response-iterator/-/response-iterator-0.2.6.tgz", + "integrity": "sha512-pVzEEzrsg23Sh053rmDUvLSkGXluZio0qu8VT6ukrYuvtjVfCbDZH9d6PGXb8HZfzdNZt8feXv/jvUzlhRgLnw==", + "engines": { + "node": ">=0.8" + } + }, "node_modules/restore-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", @@ -16589,14 +16630,6 @@ "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", "dev": true }, - "node_modules/symbol-observable": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", - "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==", - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/tapable": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", @@ -16851,14 +16884,6 @@ "tree-kill": "cli.js" } }, - "node_modules/ts-invariant": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.4.4.tgz", - "integrity": "sha512-uEtWkFM/sdZvRNNDL3Ehu4WVpwaulhwQszV8mrtcdeE8nN00BV9mAmQ88RkrBhFgl9gMgvjJLAQcZbnPXI9mlA==", - "dependencies": { - "tslib": "^1.9.3" - } - }, "node_modules/ts-loader": { "version": "9.4.1", "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.1.tgz", @@ -18340,24 +18365,98 @@ "@jridgewell/trace-mapping": "^0.3.9" } }, - "@apollo/react-common": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/@apollo/react-common/-/react-common-3.1.4.tgz", - "integrity": "sha512-X5Kyro73bthWSCBJUC5XYQqMnG0dLWuDZmVkzog9dynovhfiVCV4kPSdgSIkqnb++cwCzOVuQ4rDKVwo2XRzQA==", + "@apollo/client": { + "version": "3.11.8", + "resolved": "https://registry.npmjs.org/@apollo/client/-/client-3.11.8.tgz", + "integrity": "sha512-CgG1wbtMjsV2pRGe/eYITmV5B8lXUCYljB2gB/6jWTFQcrvirUVvKg7qtFdjYkQSFbIffU1IDyxgeaN81eTjbA==", "requires": { - "ts-invariant": "^0.4.4", - "tslib": "^1.10.0" + "@graphql-typed-document-node/core": "^3.1.1", + "@wry/caches": "^1.0.0", + "@wry/equality": "^0.5.6", + "@wry/trie": "^0.5.0", + "graphql-tag": "^2.12.6", + "hoist-non-react-statics": "^3.3.2", + "optimism": "^0.18.0", + "prop-types": "^15.7.2", + "rehackt": "^0.1.0", + "response-iterator": "^0.2.6", + "symbol-observable": "^4.0.0", + "ts-invariant": "^0.10.3", + "tslib": "^2.3.0", + "zen-observable-ts": "^1.2.5" + }, + "dependencies": { + "@wry/context": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/@wry/context/-/context-0.7.4.tgz", + "integrity": "sha512-jmT7Sb4ZQWI5iyu3lobQxICu2nC/vbUhP0vIdd6tHC9PTfenmRmuIFqktc6GH9cgi+ZHnsLWPvfSvc4DrYmKiQ==", + "requires": { + "tslib": "^2.3.0" + } + }, + "@wry/equality": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/@wry/equality/-/equality-0.5.7.tgz", + "integrity": "sha512-BRFORjsTuQv5gxcXsuDXx6oGRhuVsEGwZy6LOzRRfgu+eSfxbhUQ9L9YtSEIuIjY/o7g3iWFjrc5eSY1GXP2Dw==", + "requires": { + "tslib": "^2.3.0" + } + }, + "optimism": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/optimism/-/optimism-0.18.0.tgz", + "integrity": "sha512-tGn8+REwLRNFnb9WmcY5IfpOqeX2kpaYJ1s6Ae3mn12AeydLkR3j+jSCmVQFoXqU8D41PAJ1RG1rCRNWmNZVmQ==", + "requires": { + "@wry/caches": "^1.0.0", + "@wry/context": "^0.7.0", + "@wry/trie": "^0.4.3", + "tslib": "^2.3.0" + }, + "dependencies": { + "@wry/trie": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@wry/trie/-/trie-0.4.3.tgz", + "integrity": "sha512-I6bHwH0fSf6RqQcnnXLJKhkSXG45MFral3GxPaY4uAl0LYDZM+YDVDAiU9bYwjTuysy1S0IeecWtmq1SZA3M1w==", + "requires": { + "tslib": "^2.3.0" + } + } + } + }, + "symbol-observable": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-4.0.0.tgz", + "integrity": "sha512-b19dMThMV4HVFynSAM1++gBHAbk2Tc/osgLIBZMKsyqh34jb2e8Os7T6ZW/Bt3pJFdBTd2JwAnAAEQV7rSNvcQ==" + }, + "ts-invariant": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.10.3.tgz", + "integrity": "sha512-uivwYcQaxAucv1CzRp2n/QdYPo4ILf9VXgH19zEIjFx2EJufV16P0JtJVpYHy89DItG6Kwj2oIUjrcK5au+4tQ==", + "requires": { + "tslib": "^2.1.0" + } + }, + "tslib": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==" + }, + "zen-observable-ts": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/zen-observable-ts/-/zen-observable-ts-1.2.5.tgz", + "integrity": "sha512-QZWQekv6iB72Naeake9hS1KxHlotfRpe+WGNbNx5/ta+R3DNjVO2bswf63gXlWDcs+EMd7XY8HfVQyP1X6T4Zg==", + "requires": { + "zen-observable": "0.8.15" + } + } } }, "@apollo/react-hooks": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/@apollo/react-hooks/-/react-hooks-3.1.5.tgz", - "integrity": "sha512-y0CJ393DLxIIkksRup4nt+vSjxalbZBXnnXxYbviq/woj+zKa431zy0yT4LqyRKpFy9ahMIwxBnBwfwIoupqLQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@apollo/react-hooks/-/react-hooks-4.0.0.tgz", + "integrity": "sha512-fCu0cbne3gbUl0QbA8X4L33iuuFVQbC5Jo2MIKRK8CyawR6PoxDpFdFA1kc6033ODZuZZ9Eo4RdeJFlFIIYcLA==", "requires": { - "@apollo/react-common": "^3.1.4", - "@wry/equality": "^0.1.9", - "ts-invariant": "^0.4.4", - "tslib": "^1.10.0" + "@apollo/client": "latest" } }, "@ardatan/aggregate-error": { @@ -21328,7 +21427,6 @@ "version": "3.2.0", "resolved": "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.2.0.tgz", "integrity": "sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==", - "dev": true, "requires": {} }, "@headlessui/react": { @@ -22744,7 +22842,8 @@ "@types/node": { "version": "16.18.46", "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.46.tgz", - "integrity": "sha512-Mnq3O9Xz52exs3mlxMcQuA7/9VFe/dXcrgAyfjLkABIqxXKOgBRjyazTxUbjsxDa4BP7hhPliyjVTP9RDP14xg==" + "integrity": "sha512-Mnq3O9Xz52exs3mlxMcQuA7/9VFe/dXcrgAyfjLkABIqxXKOgBRjyazTxUbjsxDa4BP7hhPliyjVTP9RDP14xg==", + "dev": true }, "@types/parse-json": { "version": "4.0.0", @@ -22934,11 +23033,6 @@ "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==", "dev": true }, - "@types/zen-observable": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/@types/zen-observable/-/zen-observable-0.8.1.tgz", - "integrity": "sha512-wmk0xQI6Yy7Fs/il4EpOcflG4uonUpYGqvZARESLc2oy4u69fkatFLbJOeW4Q6awO15P4rduAe6xkwHevpXcUQ==" - }, "@typescript-eslint/eslint-plugin": { "version": "5.38.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.38.0.tgz", @@ -23300,21 +23394,34 @@ } } }, - "@wry/context": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/@wry/context/-/context-0.4.4.tgz", - "integrity": "sha512-LrKVLove/zw6h2Md/KZyWxIkFM6AoyKp71OqpH9Hiip1csjPVoD3tPxlbQUNxEnHENks3UGgNpSBCAfq9KWuag==", + "@wry/caches": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@wry/caches/-/caches-1.0.1.tgz", + "integrity": "sha512-bXuaUNLVVkD20wcGBWRyo7j9N3TxePEWFZj2Y+r9OoUzfqmavM84+mFykRicNsBqatba5JLay1t48wxaXaWnlA==", "requires": { - "@types/node": ">=6", - "tslib": "^1.9.3" + "tslib": "^2.3.0" + }, + "dependencies": { + "tslib": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==" + } } }, - "@wry/equality": { - "version": "0.1.11", - "resolved": "https://registry.npmjs.org/@wry/equality/-/equality-0.1.11.tgz", - "integrity": "sha512-mwEVBDUVODlsQQ5dfuLUS5/Tf7jqUKyhKYHmVi4fPB6bDMOfWvUPJmKgS1Z7Za/sOI3vzWt4+O7yCiL/70MogA==", + "@wry/trie": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@wry/trie/-/trie-0.5.0.tgz", + "integrity": "sha512-FNoYzHawTMk/6KMQoEG5O4PuioX19UbwdQKF44yw0nLfOypfQdjtfZzo/UIJWAJ23sNIFbD1Ug9lbaDGMwbqQA==", "requires": { - "tslib": "^1.9.3" + "tslib": "^2.3.0" + }, + "dependencies": { + "tslib": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==" + } } }, "@xtuc/ieee754": { @@ -23494,112 +23601,21 @@ "picomatch": "^2.0.4" } }, - "apollo-cache": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/apollo-cache/-/apollo-cache-1.3.5.tgz", - "integrity": "sha512-1XoDy8kJnyWY/i/+gLTEbYLnoiVtS8y7ikBr/IfmML4Qb+CM7dEEbIUOjnY716WqmZ/UpXIxTfJsY7rMcqiCXA==", - "requires": { - "apollo-utilities": "^1.3.4", - "tslib": "^1.10.0" - } - }, - "apollo-cache-inmemory": { - "version": "1.6.6", - "resolved": "https://registry.npmjs.org/apollo-cache-inmemory/-/apollo-cache-inmemory-1.6.6.tgz", - "integrity": "sha512-L8pToTW/+Xru2FFAhkZ1OA9q4V4nuvfoPecBM34DecAugUZEBhI2Hmpgnzq2hTKZ60LAMrlqiASm0aqAY6F8/A==", - "requires": { - "apollo-cache": "^1.3.5", - "apollo-utilities": "^1.3.4", - "optimism": "^0.10.0", - "ts-invariant": "^0.4.0", - "tslib": "^1.10.0" - } - }, - "apollo-client": { - "version": "2.6.10", - "resolved": "https://registry.npmjs.org/apollo-client/-/apollo-client-2.6.10.tgz", - "integrity": "sha512-jiPlMTN6/5CjZpJOkGeUV0mb4zxx33uXWdj/xQCfAMkuNAC3HN7CvYDyMHHEzmcQ5GV12LszWoQ/VlxET24CtA==", - "requires": { - "@types/zen-observable": "^0.8.0", - "apollo-cache": "1.3.5", - "apollo-link": "^1.0.0", - "apollo-utilities": "1.3.4", - "symbol-observable": "^1.0.2", - "ts-invariant": "^0.4.0", - "tslib": "^1.10.0", - "zen-observable": "^0.8.0" - } - }, - "apollo-link": { - "version": "1.2.14", - "resolved": "https://registry.npmjs.org/apollo-link/-/apollo-link-1.2.14.tgz", - "integrity": "sha512-p67CMEFP7kOG1JZ0ZkYZwRDa369w5PIjtMjvrQd/HnIV8FRsHRqLqK+oAZQnFa1DDdZtOtHTi+aMIW6EatC2jg==", - "requires": { - "apollo-utilities": "^1.3.0", - "ts-invariant": "^0.4.0", - "tslib": "^1.9.3", - "zen-observable-ts": "^0.8.21" - } - }, "apollo-link-debounce": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/apollo-link-debounce/-/apollo-link-debounce-2.1.0.tgz", - "integrity": "sha512-tpAb3558SoZVKL8Y5N1pyrw4ko9eYWGpveKCp1fjfDz8bA4977fyfR4OZdrxwBtTjhYf5wNq2N9YTtKaq3OZIg==", - "requires": { - "apollo-link": "^1.2.2", - "zen-observable-ts": "^0.8.9" - } - }, - "apollo-link-error": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/apollo-link-error/-/apollo-link-error-1.1.13.tgz", - "integrity": "sha512-jAZOOahJU6bwSqb2ZyskEK1XdgUY9nkmeclCrW7Gddh1uasHVqmoYc4CKdb0/H0Y1J9lvaXKle2Wsw/Zx1AyUg==", - "requires": { - "apollo-link": "^1.2.14", - "apollo-link-http-common": "^0.2.16", - "tslib": "^1.9.3" - } - }, - "apollo-link-http": { - "version": "1.5.17", - "resolved": "https://registry.npmjs.org/apollo-link-http/-/apollo-link-http-1.5.17.tgz", - "integrity": "sha512-uWcqAotbwDEU/9+Dm9e1/clO7hTB2kQ/94JYcGouBVLjoKmTeJTUPQKcJGpPwUjZcSqgYicbFqQSoJIW0yrFvg==", - "requires": { - "apollo-link": "^1.2.14", - "apollo-link-http-common": "^0.2.16", - "tslib": "^1.9.3" - } - }, - "apollo-link-http-common": { - "version": "0.2.16", - "resolved": "https://registry.npmjs.org/apollo-link-http-common/-/apollo-link-http-common-0.2.16.tgz", - "integrity": "sha512-2tIhOIrnaF4UbQHf7kjeQA/EmSorB7+HyJIIrUjJOKBgnXwuexi8aMecRlqTIDWcyVXCeqLhUnztMa6bOH/jTg==", - "requires": { - "apollo-link": "^1.2.14", - "ts-invariant": "^0.4.0", - "tslib": "^1.9.3" - } + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/apollo-link-debounce/-/apollo-link-debounce-3.0.0.tgz", + "integrity": "sha512-Ytig2Ml41T2bovBIoKkStPKoIh0r/kTK1dSM9Gpvo5W3BAPxt1WguAkeaPLJqeuvrNJIjQ/Pl38/14VVA0hdYg==", + "requires": {} }, "apollo-link-serialize": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/apollo-link-serialize/-/apollo-link-serialize-2.1.0.tgz", - "integrity": "sha512-JkTs63KdQe+8ttBInv6G+vI/Nv3CwW1gsbv6hLkf6Cb+I0s+P+upOze0mUWJeMCrbxXhHw99s7tG+jqbRSLdCw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/apollo-link-serialize/-/apollo-link-serialize-4.0.0.tgz", + "integrity": "sha512-GQJkwj1Fm/OQyte5+y64GsWBIL89AaALlJGc4plMzTttfMxMREXIttXdaP4BzU5xvC/PwVP0khKS/5CbEX8pjw==", "requires": { - "apollo-link": "^1.2.4", + "@apollo/client": "^3.3.20", "zen-observable-ts": "^0.8.11" } }, - "apollo-utilities": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/apollo-utilities/-/apollo-utilities-1.3.4.tgz", - "integrity": "sha512-pk2hiWrCXMAy2fRPwEyhvka+mqwzeP60Jr1tRYi5xru+3ko94HI9o6lK0CT33/w4RDlxWchmdhDCrvdr+pHCig==", - "requires": { - "@wry/equality": "^0.1.2", - "fast-json-stable-stringify": "^2.0.0", - "ts-invariant": "^0.4.0", - "tslib": "^1.10.0" - } - }, "arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", @@ -25980,7 +25996,8 @@ "fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true }, "fast-levenshtein": { "version": "2.0.6", @@ -26512,7 +26529,7 @@ "version": "5.12.1", "resolved": "https://registry.npmjs.org/graphql-ws/-/graphql-ws-5.12.1.tgz", "integrity": "sha512-umt4f5NnMK46ChM2coO36PTFhHouBrK9stWWBczERguwYrGnPNxJ9dimU6IyOBfOkC6Izhkg4H8+F51W/8CYDg==", - "dev": true, + "devOptional": true, "requires": {} }, "gud": { @@ -29405,14 +29422,6 @@ "integrity": "sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==", "dev": true }, - "optimism": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/optimism/-/optimism-0.10.3.tgz", - "integrity": "sha512-9A5pqGoQk49H6Vhjb9kPgAeeECfUDF6aIICbMDL23kDLStBn1MWk3YvcZ4xWF9CsSf6XEgvRLkXy4xof/56vVw==", - "requires": { - "@wry/context": "^0.4.0" - } - }, "ora": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", @@ -30208,6 +30217,12 @@ } } }, + "rehackt": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/rehackt/-/rehackt-0.1.0.tgz", + "integrity": "sha512-7kRDOuLHB87D/JESKxQoRwv4DzbIdwkAGQ7p6QKGdVlY1IZheUnVhlk/4UZlNUVxdAXpyxikE3URsG067ybVzw==", + "requires": {} + }, "relateurl": { "version": "0.2.7", "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz", @@ -30316,6 +30331,11 @@ "integrity": "sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ==", "dev": true }, + "response-iterator": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/response-iterator/-/response-iterator-0.2.6.tgz", + "integrity": "sha512-pVzEEzrsg23Sh053rmDUvLSkGXluZio0qu8VT6ukrYuvtjVfCbDZH9d6PGXb8HZfzdNZt8feXv/jvUzlhRgLnw==" + }, "restore-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", @@ -31146,11 +31166,6 @@ } } }, - "symbol-observable": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", - "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==" - }, "tapable": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", @@ -31336,14 +31351,6 @@ "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", "dev": true }, - "ts-invariant": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/ts-invariant/-/ts-invariant-0.4.4.tgz", - "integrity": "sha512-uEtWkFM/sdZvRNNDL3Ehu4WVpwaulhwQszV8mrtcdeE8nN00BV9mAmQ88RkrBhFgl9gMgvjJLAQcZbnPXI9mlA==", - "requires": { - "tslib": "^1.9.3" - } - }, "ts-loader": { "version": "9.4.1", "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.1.tgz", diff --git a/package.json b/package.json index 35fd60e4..d2316694 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,8 @@ "ci:check": "npm run format:check:app && npm run lint && npm run types" }, "dependencies": { - "@apollo/react-hooks": "^3.1.5", + "@apollo/client": "^3.11.8", + "@apollo/react-hooks": "^4.0.0", "@emotion/react": "^11.11.1", "@emotion/styled": "^11.11.0", "@headlessui/react": "^1.7.3", @@ -31,13 +32,8 @@ "@sentry/react": "^7.44.0", "@sentry/tracing": "^7.44.0", "allotment": "^1.17.0", - "apollo-cache-inmemory": "^1.6.6", - "apollo-client": "^2.6.10", - "apollo-link": "^1.2.14", - "apollo-link-debounce": "^2.1.0", - "apollo-link-error": "^1.1.13", - "apollo-link-http": "^1.5.17", - "apollo-link-serialize": "^2.1.0", + "apollo-link-debounce": "^3.0.0", + "apollo-link-serialize": "^4.0.0", "cross-fetch": "^3.1.5", "date-fns": "^2.29.3", "detect-browser": "^5.3.0", diff --git a/src/api/apollo/client.ts b/src/api/apollo/client.ts index 2e960a32..a1296a25 100644 --- a/src/api/apollo/client.ts +++ b/src/api/apollo/client.ts @@ -1,16 +1,13 @@ -import { InMemoryCache } from 'apollo-cache-inmemory'; -import { ApolloClient } from 'apollo-client'; -import { ApolloLink } from 'apollo-link'; +import { ApolloClient, InMemoryCache, ApolloLink, HttpLink, gql } from '@apollo/client'; import DebounceLink from 'apollo-link-debounce'; -import { HttpLink } from 'apollo-link-http'; import SerializingLink from 'apollo-link-serialize'; import fetch from 'cross-fetch'; import { ResultType } from './generated/graphql'; import localResolvers from './resolvers'; -import { onError } from 'apollo-link-error'; +import { onError } from '@apollo/client/link/error'; import { GET_APPLICATION_ERRORS } from './queries'; import * as Sentry from '@sentry/react'; -import { GraphQLError, GraphQLErrorExtensions } from 'graphql'; +import { GraphQLErrorExtensions, GraphQLFormattedError } from 'graphql'; const PLAYGROUND_API = process.env.PLAYGROUND_API; const DEFAULT_DEBOUNCE_TIMEOUT = 1200; // Debounce time in ms const { detect } = require('detect-browser'); @@ -23,7 +20,7 @@ const client = new ApolloClient({ onError(({ graphQLErrors, networkError }) => { let errorMessage: string, extensions: GraphQLErrorExtensions = { code: '' }, - gqlError: GraphQLError; + gqlError: GraphQLFormattedError; if (graphQLErrors) { gqlError = graphQLErrors[0]; @@ -84,7 +81,21 @@ const client = new ApolloClient({ resolvers: localResolvers, }); -cache.writeData({ +cache.writeQuery({ + query: gql` + query InitValues { + localProject + activeProjectId + activeProject + errorMessage + cachedExecutionResults { + id + ${ResultType.Transaction} + ${ResultType.Script} + ${ResultType.Contract} + } + } + `, data: { localProject: null, activeProjectId: null, diff --git a/src/api/apollo/resolvers.ts b/src/api/apollo/resolvers.ts index 70a224ba..e2657ec8 100644 --- a/src/api/apollo/resolvers.ts +++ b/src/api/apollo/resolvers.ts @@ -1,5 +1,4 @@ -import { InMemoryCache } from 'apollo-cache-inmemory'; -import gql from 'graphql-tag'; +import { InMemoryCache, gql } from '@apollo/client'; import { normalizeInteractionResponse } from 'util/normalize-interaction-response'; import { ClearExecutionResultsMutationVariables, @@ -152,7 +151,12 @@ const localResolvers = { { id }: any, { cache }: { cache: InMemoryCache }, ): any => { - cache.writeData({ + cache.writeQuery({ + query: gql` + query GetActiveProject { + activeProjectId + } + `, data: { activeProjectId: id, }, diff --git a/src/components/AccountAvatars.tsx b/src/components/AccountAvatars.tsx index 2bb0d6e7..a6288ffc 100644 --- a/src/components/AccountAvatars.tsx +++ b/src/components/AccountAvatars.tsx @@ -55,7 +55,7 @@ export const AvatarList = ({ children }: ChildProps) => { flex: '1 1 auto', alignItems: 'center', justifyContent: 'space-between', - overflowX: 'scroll', + overflowX: 'auto', }} > {children} diff --git a/src/components/Editor/CadenceEditor/ControlPanel/index.tsx b/src/components/Editor/CadenceEditor/ControlPanel/index.tsx index 83cb8fbe..d8012a37 100644 --- a/src/components/Editor/CadenceEditor/ControlPanel/index.tsx +++ b/src/components/Editor/CadenceEditor/ControlPanel/index.tsx @@ -54,12 +54,12 @@ import { StatusMessage, } from './Arguments/styles'; import { SignersPanel } from 'components/Editor/CadenceEditor/ControlPanel/SignersPanel'; -import { Template } from 'src/types'; import DismissiblePopup from 'components/DismissiblePopup'; import { userModalKeys } from 'util/localstorage'; import { addressToAccount } from 'util/accounts'; import { Argument } from './Arguments/types'; import { useThemeUI } from 'theme-ui'; +import { getContractName } from 'util/generator'; const ButtonActionLabels = { [String(EntityType.TransactionTemplate)]: 'Send', @@ -252,7 +252,8 @@ const ControlPanel: React.FC = (props) => { const user = selectedAccounts[0]; const acct = accounts[user]; const template = project.contractTemplates[activeIndex]; - const templateContract = (template as Template)?.name; + console.log(template) + const templateContract = getContractName(template.script); return (acct?.deployedContracts || []).includes(templateContract); }; @@ -283,7 +284,7 @@ const ControlPanel: React.FC = (props) => { // determine if other contracts will need to be redeployed and prompt user const template = project.contractTemplates[active.index]; - const contractName = (template as Template)?.name; + const contractName = getContractName(template.script); if (!contractName) return send(true); const deployment = project.contractDeployments.find( diff --git a/src/components/Editor/FileExplorer/MenuList.tsx b/src/components/Editor/FileExplorer/MenuList.tsx index 05c142b9..28d03fdd 100644 --- a/src/components/Editor/FileExplorer/MenuList.tsx +++ b/src/components/Editor/FileExplorer/MenuList.tsx @@ -168,7 +168,6 @@ const MenuList: React.FC = ({ let _editing = [...editing]; _editing.splice(_editing.indexOf(i), 1); setEditing(_editing); - items[i].title = newTitle; onUpdate(items[i].id, items[i].script, newTitle); return; } diff --git a/src/providers/Project/index.tsx b/src/providers/Project/index.tsx index a32900ec..09f1e643 100644 --- a/src/providers/Project/index.tsx +++ b/src/providers/Project/index.tsx @@ -5,7 +5,7 @@ import { Project, } from 'api/apollo/generated/graphql'; import React, { createContext, useEffect, useState } from 'react'; -import { ChildProps, Template } from 'src/types'; +import { ChildProps } from 'src/types'; import { getHashLineNumber, getParams, LOCAL_PROJECT_ID } from 'util/url'; import ProjectMutator from './projectMutator'; import { storageMapByAddress } from 'util/accounts'; @@ -334,9 +334,6 @@ export const ProjectProvider: React.FC = ({ title, active.index, ); - template.script = script; - template.title = title; - (template as Template).name = getContractName(script); } catch (e) { console.error(e); checkAppErrors(); @@ -358,8 +355,6 @@ export const ProjectProvider: React.FC = ({ contractTemplate.title, active.index, ); - contractTemplate.script = script; - (contractTemplate as Template).name = getContractName(script); } catch (e) { console.error(e); checkAppErrors(); @@ -379,9 +374,6 @@ export const ProjectProvider: React.FC = ({ let res; try { res = await mutator.updateScriptTemplate(templateId, script, title); - const template = project.scriptTemplates.find((t) => t.id === templateId); - template.script = script; - template.title = title; } catch (e) { console.error(e); checkAppErrors(); @@ -411,11 +403,6 @@ export const ProjectProvider: React.FC = ({ let res; try { res = await mutator.updateTransactionTemplate(templateId, script, title); - const template = project.transactionTemplates.find( - (t) => t.id === templateId, - ); - template.script = script; - template.title = title; } catch (e) { console.error(e); checkAppErrors(); @@ -429,8 +416,6 @@ export const ProjectProvider: React.FC = ({ const updateActiveScriptTemplate = async (script: string) => { setIsSaving(true); let res; - const template = project.scriptTemplates[active.index]; - template.script = script; try { res = await mutator.updateScriptTemplate( project.scriptTemplates[active.index].id, @@ -450,8 +435,6 @@ export const ProjectProvider: React.FC = ({ const updateActiveTransactionTemplate = async (script: string) => { setIsSaving(true); let res; - const template = project.transactionTemplates[active.index]; - template.script = script; try { res = await mutator.updateTransactionTemplate( project.transactionTemplates[active.index].id, @@ -815,7 +798,6 @@ export const ProjectProvider: React.FC = ({ }); const template = project.contractTemplates[templateIndex]; const templateId = template.id; - (template as Template).name = getContractName(template.script); return ( ) { const defaultProject = createDefaultProject(); - client.writeData({ + client.writeQuery({ + query: gql` + query InitValues { + activeProject + localProject + } + `, data: { activeProject: true, localProject: defaultProject, @@ -29,7 +36,7 @@ function writeDefaultProject(client: any) { }); } -function cloneProject(client: any, project: Project) { +function cloneProject(client: ApolloClient, project: Project) { const localProject = createLocalProject( project.id, project.seed, @@ -53,7 +60,13 @@ function cloneProject(client: any, project: Project) { title: tpl.title, })), ); - client.writeData({ + client.writeQuery({ + query: gql` + query InitValues { + activeProject + localProject + } + `, data: { activeProject: true, localProject: localProject, @@ -62,7 +75,7 @@ function cloneProject(client: any, project: Project) { } export default function useGetProject( - client: any, + client: ApolloClient, projectId: string | null, isActiveProject: boolean, ): { @@ -136,7 +149,7 @@ export function useProject(): ProjectContextValue { return useContext(ProjectContext); } -function readLocalProject(client: any): any { +function readLocalProject(client: ApolloClient): any { const { project } = client.readQuery({ query: GET_LOCAL_PROJECT }); return project; } diff --git a/src/providers/Project/projectMutator.ts b/src/providers/Project/projectMutator.ts index c75e8ba7..30e84de5 100644 --- a/src/providers/Project/projectMutator.ts +++ b/src/providers/Project/projectMutator.ts @@ -1,4 +1,4 @@ -import ApolloClient from 'apollo-client'; +import { ApolloClient, gql } from '@apollo/client'; import { navigate } from '@reach/router'; import { @@ -41,6 +41,7 @@ import { import { createDefaultProject, DEFAULT_ACCOUNT_STATE } from './projectDefault'; import { UrlRewritter, FILE_TYPE_NAME } from 'util/urlRewritter'; import { Template } from 'src/types'; +import { getContractName } from 'util/generator'; // TODO: Switch to directives for serialization keys after upgrading to the newest Apollo/apollo-link-serialize export const PROJECT_SERIALIZATION_KEY = 'PROJECT_SERIALIZATION_KEY'; @@ -222,22 +223,16 @@ export default class ProjectMutator { description: string, readme: string, ) { - const project = this.client.readQuery({ - query: GET_LOCAL_PROJECT, - }).project; - - project.title = title || project.title; - project.description = description || project.description; - project.readme = readme || project.readme; - project.updatedAt = null; - project.contractDeployments = []; - - this.client.writeQuery({ - query: GET_PROJECT, - variables: { - projectId: project.id, - }, - data: { project }, + this.client.writeFragment({ + id: `Project:${this.projectId}`, + fragment: gql` + fragment ProjectFields on Project { + title + description + readme + } + `, + data: { title, description, readme }, }); } @@ -250,8 +245,16 @@ export default class ProjectMutator { const key = ['SAVE_PROJECT', this.projectId]; - this.client.writeData({ + this.client.writeFragment({ id: `Project:${this.projectId}`, + fragment: gql` + fragment ProjectFields on Project { + title + description + readme + persist + } + `, data: { title, description, @@ -352,8 +355,14 @@ export default class ProjectMutator { script: string, title: string, ) { - this.client.writeData({ + this.client.writeFragment({ id: `TransactionTemplate:${templateId}`, + fragment: gql` + fragment TransactionTemplateFields on TransactionTemplate { + script + title + } + `, data: { script, title, @@ -480,8 +489,14 @@ export default class ProjectMutator { script: string, title: string, ) { - this.client.writeData({ + this.client.writeFragment({ id: `ScriptTemplate:${templateId}`, + fragment: gql` + fragment ScriptTemplateFields on ScriptTemplate { + script + title + } + `, data: { script: script, title: title, @@ -754,6 +769,7 @@ export default class ProjectMutator { script: script, index, projectId: this.projectId, + name: getContractName(script), }, refetchQueries: [ { diff --git a/src/types.ts b/src/types.ts index b6d7f435..5f35c6da 100644 --- a/src/types.ts +++ b/src/types.ts @@ -30,7 +30,6 @@ export type Template = { script: string; title: string; index: number; - name?: string; }; export interface ThemedComponentProps { From 7d3a840aeb16fc3d52de6f4725db932c7f4b406b Mon Sep 17 00:00:00 2001 From: Alex Ni <12097569+nialexsan@users.noreply.github.com> Date: Tue, 17 Sep 2024 13:48:33 -0400 Subject: [PATCH 2/3] lint --- src/api/apollo/client.ts | 8 +++++++- .../Editor/CadenceEditor/ControlPanel/index.tsx | 1 - src/providers/Project/projectDefault.ts | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/api/apollo/client.ts b/src/api/apollo/client.ts index a1296a25..37173789 100644 --- a/src/api/apollo/client.ts +++ b/src/api/apollo/client.ts @@ -1,4 +1,10 @@ -import { ApolloClient, InMemoryCache, ApolloLink, HttpLink, gql } from '@apollo/client'; +import { + ApolloClient, + InMemoryCache, + ApolloLink, + HttpLink, + gql, +} from '@apollo/client'; import DebounceLink from 'apollo-link-debounce'; import SerializingLink from 'apollo-link-serialize'; import fetch from 'cross-fetch'; diff --git a/src/components/Editor/CadenceEditor/ControlPanel/index.tsx b/src/components/Editor/CadenceEditor/ControlPanel/index.tsx index d8012a37..87b81a80 100644 --- a/src/components/Editor/CadenceEditor/ControlPanel/index.tsx +++ b/src/components/Editor/CadenceEditor/ControlPanel/index.tsx @@ -252,7 +252,6 @@ const ControlPanel: React.FC = (props) => { const user = selectedAccounts[0]; const acct = accounts[user]; const template = project.contractTemplates[activeIndex]; - console.log(template) const templateContract = getContractName(template.script); return (acct?.deployedContracts || []).includes(templateContract); }; diff --git a/src/providers/Project/projectDefault.ts b/src/providers/Project/projectDefault.ts index 0272c069..e13d9cc0 100644 --- a/src/providers/Project/projectDefault.ts +++ b/src/providers/Project/projectDefault.ts @@ -111,7 +111,7 @@ export function createLocalProject( const accountEntities: Account[] = accounts.map((_account) => { return { __typename: 'Account', - address: _account.padStart(16, "0"), + address: _account.padStart(16, '0'), deployedContracts: [], state: DEFAULT_ACCOUNT_STATE, }; From 937ac67cf222208c0abe740297d595a5e784e871 Mon Sep 17 00:00:00 2001 From: Alex Ni <12097569+nialexsan@users.noreply.github.com> Date: Tue, 17 Sep 2024 15:11:32 -0400 Subject: [PATCH 3/3] update graphql codegen --- src/api/apollo/client.ts | 49 ++-- src/api/apollo/generated/graphql.tsx | 395 +++++++++++++++------------ src/api/apollo/local.graphql | 4 + src/api/apollo/resolvers.ts | 2 +- src/providers/Project/index.tsx | 22 -- 5 files changed, 254 insertions(+), 218 deletions(-) diff --git a/src/api/apollo/client.ts b/src/api/apollo/client.ts index 37173789..62650330 100644 --- a/src/api/apollo/client.ts +++ b/src/api/apollo/client.ts @@ -4,6 +4,7 @@ import { ApolloLink, HttpLink, gql, + makeVar, } from '@apollo/client'; import DebounceLink from 'apollo-link-debounce'; import SerializingLink from 'apollo-link-serialize'; @@ -17,7 +18,20 @@ import { GraphQLErrorExtensions, GraphQLFormattedError } from 'graphql'; const PLAYGROUND_API = process.env.PLAYGROUND_API; const DEFAULT_DEBOUNCE_TIMEOUT = 1200; // Debounce time in ms const { detect } = require('detect-browser'); -const cache = new InMemoryCache(); +export const errorMessageVar = makeVar(''); +const cache = new InMemoryCache({ + typePolicies: { + Query: { + fields: { + errorMessage: { + read() { + return errorMessageVar(); + }, + }, + }, + }, + }, +}); const client = new ApolloClient({ cache: cache, link: ApolloLink.from([ @@ -90,30 +104,29 @@ const client = new ApolloClient({ cache.writeQuery({ query: gql` query InitValues { - localProject activeProjectId activeProject - errorMessage - cachedExecutionResults { - id - ${ResultType.Transaction} - ${ResultType.Script} - ${ResultType.Contract} - } } `, data: { - localProject: null, activeProjectId: null, activeProject: false, - errorMessage: '', - cachedExecutionResults: { - id: '0', - __typename: 'ExecutionResults', - [ResultType.Transaction]: [], - [ResultType.Script]: [], - [ResultType.Contract]: [], - }, + }, +}); + +cache.writeFragment({ + id: 'ExecutionResults:0', + fragment: gql` + fragment ExecutionResultFields on ExecutionResult { + ${ResultType.Transaction} + ${ResultType.Script} + ${ResultType.Contract} + } + `, + data: { + [ResultType.Transaction]: [], + [ResultType.Script]: [], + [ResultType.Contract]: [], }, }); diff --git a/src/api/apollo/generated/graphql.tsx b/src/api/apollo/generated/graphql.tsx index 5446a007..ea7aad47 100644 --- a/src/api/apollo/generated/graphql.tsx +++ b/src/api/apollo/generated/graphql.tsx @@ -1,7 +1,5 @@ -import gql from 'graphql-tag'; -import * as ApolloReactCommon from '@apollo/react-common'; -import * as ApolloReactHooks from '@apollo/react-hooks'; - +import { gql } from '@apollo/client'; +import * as Apollo from '@apollo/client'; export type Maybe = T | null; export type Exact = { [K in keyof T]: T[K] }; export type MakeOptional = Omit & { [SubKey in K]?: Maybe }; @@ -331,6 +329,7 @@ export type Query = { activeProjectId?: Maybe; cachedExecutionResults: Array>; contractTemplate: ContractTemplate; + errorMessage?: Maybe; flowJson: Scalars['String']; localProject?: Maybe; playgroundInfo: PlaygroundInfo; @@ -795,19 +794,6 @@ export type GetProjectsQuery = ( & { projects?: Maybe - & { contractTemplates?: Maybe - )>>, transactionTemplates?: Maybe - )>>, scriptTemplates?: Maybe - )>>, contractDeployments?: Maybe - )>> } )>> } ) } ); @@ -901,6 +887,14 @@ export type GetCachedExecutionResultsQuery = ( )>> } ); +export type GetApplicationErrorsQueryVariables = Exact<{ [key: string]: never; }>; + + +export type GetApplicationErrorsQuery = ( + { __typename?: 'Query' } + & Pick +); + export type GetPlaygroundInfoQueryVariables = Exact<{ [key: string]: never; }>; @@ -976,6 +970,14 @@ export type GetResultsQuery = ( )>> } ); +export type GetActiveProjectIdQueryVariables = Exact<{ [key: string]: never; }>; + + +export type GetActiveProjectIdQuery = ( + { __typename?: 'Query' } + & Pick +); + export const ExecutionResultDetailsFragmentDoc = gql` fragment ExecutionResultDetails on ExecutionResult { timestamp @@ -1050,7 +1052,7 @@ export const CreateProjectDocument = gql` } } `; -export type CreateProjectMutationFn = ApolloReactCommon.MutationFunction; +export type CreateProjectMutationFn = Apollo.MutationFunction; /** * __useCreateProjectMutation__ @@ -1077,13 +1079,13 @@ export type CreateProjectMutationFn = ApolloReactCommon.MutationFunction) { +export function useCreateProjectMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useMutation(CreateProjectDocument, options); + return Apollo.useMutation(CreateProjectDocument, options); } export type CreateProjectMutationHookResult = ReturnType; -export type CreateProjectMutationResult = ApolloReactCommon.MutationResult; -export type CreateProjectMutationOptions = ApolloReactCommon.BaseMutationOptions; +export type CreateProjectMutationResult = Apollo.MutationResult; +export type CreateProjectMutationOptions = Apollo.BaseMutationOptions; export const UpdateProjectDocument = gql` mutation UpdateProject($projectId: UUID!, $title: String!, $description: String!, $readme: String!) { updateProject( @@ -1097,7 +1099,7 @@ export const UpdateProjectDocument = gql` } } `; -export type UpdateProjectMutationFn = ApolloReactCommon.MutationFunction; +export type UpdateProjectMutationFn = Apollo.MutationFunction; /** * __useUpdateProjectMutation__ @@ -1119,19 +1121,19 @@ export type UpdateProjectMutationFn = ApolloReactCommon.MutationFunction) { +export function useUpdateProjectMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useMutation(UpdateProjectDocument, options); + return Apollo.useMutation(UpdateProjectDocument, options); } export type UpdateProjectMutationHookResult = ReturnType; -export type UpdateProjectMutationResult = ApolloReactCommon.MutationResult; -export type UpdateProjectMutationOptions = ApolloReactCommon.BaseMutationOptions; +export type UpdateProjectMutationResult = Apollo.MutationResult; +export type UpdateProjectMutationOptions = Apollo.BaseMutationOptions; export const SetActiveProjectDocument = gql` mutation SetActiveProject($id: Int!) { setActiveProjectId(id: $id) @client } `; -export type SetActiveProjectMutationFn = ApolloReactCommon.MutationFunction; +export type SetActiveProjectMutationFn = Apollo.MutationFunction; /** * __useSetActiveProjectMutation__ @@ -1150,13 +1152,13 @@ export type SetActiveProjectMutationFn = ApolloReactCommon.MutationFunction) { +export function useSetActiveProjectMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useMutation(SetActiveProjectDocument, options); + return Apollo.useMutation(SetActiveProjectDocument, options); } export type SetActiveProjectMutationHookResult = ReturnType; -export type SetActiveProjectMutationResult = ApolloReactCommon.MutationResult; -export type SetActiveProjectMutationOptions = ApolloReactCommon.BaseMutationOptions; +export type SetActiveProjectMutationResult = Apollo.MutationResult; +export type SetActiveProjectMutationOptions = Apollo.BaseMutationOptions; export const CreateContractTemplateDocument = gql` mutation CreateContractTemplate($projectId: UUID!, $script: String!, $title: String!) { createContractTemplate( @@ -1168,7 +1170,7 @@ export const CreateContractTemplateDocument = gql` } } `; -export type CreateContractTemplateMutationFn = ApolloReactCommon.MutationFunction; +export type CreateContractTemplateMutationFn = Apollo.MutationFunction; /** * __useCreateContractTemplateMutation__ @@ -1189,13 +1191,13 @@ export type CreateContractTemplateMutationFn = ApolloReactCommon.MutationFunctio * }, * }); */ -export function useCreateContractTemplateMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { +export function useCreateContractTemplateMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useMutation(CreateContractTemplateDocument, options); + return Apollo.useMutation(CreateContractTemplateDocument, options); } export type CreateContractTemplateMutationHookResult = ReturnType; -export type CreateContractTemplateMutationResult = ApolloReactCommon.MutationResult; -export type CreateContractTemplateMutationOptions = ApolloReactCommon.BaseMutationOptions; +export type CreateContractTemplateMutationResult = Apollo.MutationResult; +export type CreateContractTemplateMutationOptions = Apollo.BaseMutationOptions; export const UpdateContractTemplateDocument = gql` mutation UpdateContractTemplate($projectId: UUID!, $templateId: UUID!, $script: String!, $title: String) { updateContractTemplate( @@ -1208,7 +1210,7 @@ export const UpdateContractTemplateDocument = gql` } } `; -export type UpdateContractTemplateMutationFn = ApolloReactCommon.MutationFunction; +export type UpdateContractTemplateMutationFn = Apollo.MutationFunction; /** * __useUpdateContractTemplateMutation__ @@ -1230,19 +1232,19 @@ export type UpdateContractTemplateMutationFn = ApolloReactCommon.MutationFunctio * }, * }); */ -export function useUpdateContractTemplateMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { +export function useUpdateContractTemplateMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useMutation(UpdateContractTemplateDocument, options); + return Apollo.useMutation(UpdateContractTemplateDocument, options); } export type UpdateContractTemplateMutationHookResult = ReturnType; -export type UpdateContractTemplateMutationResult = ApolloReactCommon.MutationResult; -export type UpdateContractTemplateMutationOptions = ApolloReactCommon.BaseMutationOptions; +export type UpdateContractTemplateMutationResult = Apollo.MutationResult; +export type UpdateContractTemplateMutationOptions = Apollo.BaseMutationOptions; export const DeleteContractTemplateDocument = gql` mutation DeleteContractTemplate($projectId: UUID!, $templateId: UUID!) { deleteContractTemplate(id: $templateId, projectId: $projectId) } `; -export type DeleteContractTemplateMutationFn = ApolloReactCommon.MutationFunction; +export type DeleteContractTemplateMutationFn = Apollo.MutationFunction; /** * __useDeleteContractTemplateMutation__ @@ -1262,13 +1264,13 @@ export type DeleteContractTemplateMutationFn = ApolloReactCommon.MutationFunctio * }, * }); */ -export function useDeleteContractTemplateMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { +export function useDeleteContractTemplateMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useMutation(DeleteContractTemplateDocument, options); + return Apollo.useMutation(DeleteContractTemplateDocument, options); } export type DeleteContractTemplateMutationHookResult = ReturnType; -export type DeleteContractTemplateMutationResult = ApolloReactCommon.MutationResult; -export type DeleteContractTemplateMutationOptions = ApolloReactCommon.BaseMutationOptions; +export type DeleteContractTemplateMutationResult = Apollo.MutationResult; +export type DeleteContractTemplateMutationOptions = Apollo.BaseMutationOptions; export const CreateContractDeploymentDocument = gql` mutation CreateContractDeployment($projectId: UUID!, $script: String!, $signer: Address!, $arguments: [String!]) { createContractDeployment( @@ -1297,7 +1299,7 @@ export const CreateContractDeploymentDocument = gql` } } `; -export type CreateContractDeploymentMutationFn = ApolloReactCommon.MutationFunction; +export type CreateContractDeploymentMutationFn = Apollo.MutationFunction; /** * __useCreateContractDeploymentMutation__ @@ -1319,13 +1321,13 @@ export type CreateContractDeploymentMutationFn = ApolloReactCommon.MutationFunct * }, * }); */ -export function useCreateContractDeploymentMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { +export function useCreateContractDeploymentMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useMutation(CreateContractDeploymentDocument, options); + return Apollo.useMutation(CreateContractDeploymentDocument, options); } export type CreateContractDeploymentMutationHookResult = ReturnType; -export type CreateContractDeploymentMutationResult = ApolloReactCommon.MutationResult; -export type CreateContractDeploymentMutationOptions = ApolloReactCommon.BaseMutationOptions; +export type CreateContractDeploymentMutationResult = Apollo.MutationResult; +export type CreateContractDeploymentMutationOptions = Apollo.BaseMutationOptions; export const UpdateTransactionTemplateDocument = gql` mutation UpdateTransactionTemplate($projectId: UUID!, $templateId: UUID!, $script: String!, $title: String) { updateTransactionTemplate( @@ -1338,7 +1340,7 @@ export const UpdateTransactionTemplateDocument = gql` } } `; -export type UpdateTransactionTemplateMutationFn = ApolloReactCommon.MutationFunction; +export type UpdateTransactionTemplateMutationFn = Apollo.MutationFunction; /** * __useUpdateTransactionTemplateMutation__ @@ -1360,13 +1362,13 @@ export type UpdateTransactionTemplateMutationFn = ApolloReactCommon.MutationFunc * }, * }); */ -export function useUpdateTransactionTemplateMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { +export function useUpdateTransactionTemplateMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useMutation(UpdateTransactionTemplateDocument, options); + return Apollo.useMutation(UpdateTransactionTemplateDocument, options); } export type UpdateTransactionTemplateMutationHookResult = ReturnType; -export type UpdateTransactionTemplateMutationResult = ApolloReactCommon.MutationResult; -export type UpdateTransactionTemplateMutationOptions = ApolloReactCommon.BaseMutationOptions; +export type UpdateTransactionTemplateMutationResult = Apollo.MutationResult; +export type UpdateTransactionTemplateMutationOptions = Apollo.BaseMutationOptions; export const CreateTransactionTemplateDocument = gql` mutation CreateTransactionTemplate($projectId: UUID!, $script: String!, $title: String!) { createTransactionTemplate( @@ -1378,7 +1380,7 @@ export const CreateTransactionTemplateDocument = gql` } } `; -export type CreateTransactionTemplateMutationFn = ApolloReactCommon.MutationFunction; +export type CreateTransactionTemplateMutationFn = Apollo.MutationFunction; /** * __useCreateTransactionTemplateMutation__ @@ -1399,19 +1401,19 @@ export type CreateTransactionTemplateMutationFn = ApolloReactCommon.MutationFunc * }, * }); */ -export function useCreateTransactionTemplateMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { +export function useCreateTransactionTemplateMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useMutation(CreateTransactionTemplateDocument, options); + return Apollo.useMutation(CreateTransactionTemplateDocument, options); } export type CreateTransactionTemplateMutationHookResult = ReturnType; -export type CreateTransactionTemplateMutationResult = ApolloReactCommon.MutationResult; -export type CreateTransactionTemplateMutationOptions = ApolloReactCommon.BaseMutationOptions; +export type CreateTransactionTemplateMutationResult = Apollo.MutationResult; +export type CreateTransactionTemplateMutationOptions = Apollo.BaseMutationOptions; export const DeleteTransactionTemplateDocument = gql` mutation DeleteTransactionTemplate($projectId: UUID!, $templateId: UUID!) { deleteTransactionTemplate(id: $templateId, projectId: $projectId) } `; -export type DeleteTransactionTemplateMutationFn = ApolloReactCommon.MutationFunction; +export type DeleteTransactionTemplateMutationFn = Apollo.MutationFunction; /** * __useDeleteTransactionTemplateMutation__ @@ -1431,13 +1433,13 @@ export type DeleteTransactionTemplateMutationFn = ApolloReactCommon.MutationFunc * }, * }); */ -export function useDeleteTransactionTemplateMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { +export function useDeleteTransactionTemplateMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useMutation(DeleteTransactionTemplateDocument, options); + return Apollo.useMutation(DeleteTransactionTemplateDocument, options); } export type DeleteTransactionTemplateMutationHookResult = ReturnType; -export type DeleteTransactionTemplateMutationResult = ApolloReactCommon.MutationResult; -export type DeleteTransactionTemplateMutationOptions = ApolloReactCommon.BaseMutationOptions; +export type DeleteTransactionTemplateMutationResult = Apollo.MutationResult; +export type DeleteTransactionTemplateMutationOptions = Apollo.BaseMutationOptions; export const CreateTransactionExecutionDocument = gql` mutation CreateTransactionExecution($projectId: UUID!, $script: String!, $signers: [Address!], $arguments: [String!]) { createTransactionExecution( @@ -1466,7 +1468,7 @@ export const CreateTransactionExecutionDocument = gql` } } `; -export type CreateTransactionExecutionMutationFn = ApolloReactCommon.MutationFunction; +export type CreateTransactionExecutionMutationFn = Apollo.MutationFunction; /** * __useCreateTransactionExecutionMutation__ @@ -1488,13 +1490,13 @@ export type CreateTransactionExecutionMutationFn = ApolloReactCommon.MutationFun * }, * }); */ -export function useCreateTransactionExecutionMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { +export function useCreateTransactionExecutionMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useMutation(CreateTransactionExecutionDocument, options); + return Apollo.useMutation(CreateTransactionExecutionDocument, options); } export type CreateTransactionExecutionMutationHookResult = ReturnType; -export type CreateTransactionExecutionMutationResult = ApolloReactCommon.MutationResult; -export type CreateTransactionExecutionMutationOptions = ApolloReactCommon.BaseMutationOptions; +export type CreateTransactionExecutionMutationResult = Apollo.MutationResult; +export type CreateTransactionExecutionMutationOptions = Apollo.BaseMutationOptions; export const UpdateScripTemplateDocument = gql` mutation UpdateScripTemplate($projectId: UUID!, $templateId: UUID!, $script: String!, $title: String) { updateScriptTemplate( @@ -1507,7 +1509,7 @@ export const UpdateScripTemplateDocument = gql` } } `; -export type UpdateScripTemplateMutationFn = ApolloReactCommon.MutationFunction; +export type UpdateScripTemplateMutationFn = Apollo.MutationFunction; /** * __useUpdateScripTemplateMutation__ @@ -1529,13 +1531,13 @@ export type UpdateScripTemplateMutationFn = ApolloReactCommon.MutationFunction) { +export function useUpdateScripTemplateMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useMutation(UpdateScripTemplateDocument, options); + return Apollo.useMutation(UpdateScripTemplateDocument, options); } export type UpdateScripTemplateMutationHookResult = ReturnType; -export type UpdateScripTemplateMutationResult = ApolloReactCommon.MutationResult; -export type UpdateScripTemplateMutationOptions = ApolloReactCommon.BaseMutationOptions; +export type UpdateScripTemplateMutationResult = Apollo.MutationResult; +export type UpdateScripTemplateMutationOptions = Apollo.BaseMutationOptions; export const CreateScriptTemplateDocument = gql` mutation CreateScriptTemplate($projectId: UUID!, $script: String!, $title: String!) { createScriptTemplate( @@ -1547,7 +1549,7 @@ export const CreateScriptTemplateDocument = gql` } } `; -export type CreateScriptTemplateMutationFn = ApolloReactCommon.MutationFunction; +export type CreateScriptTemplateMutationFn = Apollo.MutationFunction; /** * __useCreateScriptTemplateMutation__ @@ -1568,19 +1570,19 @@ export type CreateScriptTemplateMutationFn = ApolloReactCommon.MutationFunction< * }, * }); */ -export function useCreateScriptTemplateMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { +export function useCreateScriptTemplateMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useMutation(CreateScriptTemplateDocument, options); + return Apollo.useMutation(CreateScriptTemplateDocument, options); } export type CreateScriptTemplateMutationHookResult = ReturnType; -export type CreateScriptTemplateMutationResult = ApolloReactCommon.MutationResult; -export type CreateScriptTemplateMutationOptions = ApolloReactCommon.BaseMutationOptions; +export type CreateScriptTemplateMutationResult = Apollo.MutationResult; +export type CreateScriptTemplateMutationOptions = Apollo.BaseMutationOptions; export const DeleteScriptTemplateDocument = gql` mutation DeleteScriptTemplate($projectId: UUID!, $templateId: UUID!) { deleteScriptTemplate(id: $templateId, projectId: $projectId) } `; -export type DeleteScriptTemplateMutationFn = ApolloReactCommon.MutationFunction; +export type DeleteScriptTemplateMutationFn = Apollo.MutationFunction; /** * __useDeleteScriptTemplateMutation__ @@ -1600,13 +1602,13 @@ export type DeleteScriptTemplateMutationFn = ApolloReactCommon.MutationFunction< * }, * }); */ -export function useDeleteScriptTemplateMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { +export function useDeleteScriptTemplateMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useMutation(DeleteScriptTemplateDocument, options); + return Apollo.useMutation(DeleteScriptTemplateDocument, options); } export type DeleteScriptTemplateMutationHookResult = ReturnType; -export type DeleteScriptTemplateMutationResult = ApolloReactCommon.MutationResult; -export type DeleteScriptTemplateMutationOptions = ApolloReactCommon.BaseMutationOptions; +export type DeleteScriptTemplateMutationResult = Apollo.MutationResult; +export type DeleteScriptTemplateMutationOptions = Apollo.BaseMutationOptions; export const CreateScriptExecutionDocument = gql` mutation CreateScriptExecution($projectId: UUID!, $script: String!, $arguments: [String!]) { createScriptExecution( @@ -1632,7 +1634,7 @@ export const CreateScriptExecutionDocument = gql` } } `; -export type CreateScriptExecutionMutationFn = ApolloReactCommon.MutationFunction; +export type CreateScriptExecutionMutationFn = Apollo.MutationFunction; /** * __useCreateScriptExecutionMutation__ @@ -1653,19 +1655,19 @@ export type CreateScriptExecutionMutationFn = ApolloReactCommon.MutationFunction * }, * }); */ -export function useCreateScriptExecutionMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { +export function useCreateScriptExecutionMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useMutation(CreateScriptExecutionDocument, options); + return Apollo.useMutation(CreateScriptExecutionDocument, options); } export type CreateScriptExecutionMutationHookResult = ReturnType; -export type CreateScriptExecutionMutationResult = ApolloReactCommon.MutationResult; -export type CreateScriptExecutionMutationOptions = ApolloReactCommon.BaseMutationOptions; +export type CreateScriptExecutionMutationResult = Apollo.MutationResult; +export type CreateScriptExecutionMutationOptions = Apollo.BaseMutationOptions; export const DeleteProjectDocument = gql` mutation DeleteProject($projectId: UUID!) { deleteProject(projectId: $projectId) } `; -export type DeleteProjectMutationFn = ApolloReactCommon.MutationFunction; +export type DeleteProjectMutationFn = Apollo.MutationFunction; /** * __useDeleteProjectMutation__ @@ -1684,19 +1686,19 @@ export type DeleteProjectMutationFn = ApolloReactCommon.MutationFunction) { +export function useDeleteProjectMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useMutation(DeleteProjectDocument, options); + return Apollo.useMutation(DeleteProjectDocument, options); } export type DeleteProjectMutationHookResult = ReturnType; -export type DeleteProjectMutationResult = ApolloReactCommon.MutationResult; -export type DeleteProjectMutationOptions = ApolloReactCommon.BaseMutationOptions; +export type DeleteProjectMutationResult = Apollo.MutationResult; +export type DeleteProjectMutationOptions = Apollo.BaseMutationOptions; export const ResetProjectDocument = gql` mutation ResetProject($projectId: UUID!) { resetProjectState(projectId: $projectId) } `; -export type ResetProjectMutationFn = ApolloReactCommon.MutationFunction; +export type ResetProjectMutationFn = Apollo.MutationFunction; /** * __useResetProjectMutation__ @@ -1715,13 +1717,13 @@ export type ResetProjectMutationFn = ApolloReactCommon.MutationFunction) { +export function useResetProjectMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useMutation(ResetProjectDocument, options); + return Apollo.useMutation(ResetProjectDocument, options); } export type ResetProjectMutationHookResult = ReturnType; -export type ResetProjectMutationResult = ApolloReactCommon.MutationResult; -export type ResetProjectMutationOptions = ApolloReactCommon.BaseMutationOptions; +export type ResetProjectMutationResult = Apollo.MutationResult; +export type ResetProjectMutationOptions = Apollo.BaseMutationOptions; export const SetExecutionResultsDocument = gql` mutation SetExecutionResults($resultType: ResultType!, $rawResult: RawExecutionResult!, $label: String) { updateCachedExecutionResults( @@ -1731,7 +1733,7 @@ export const SetExecutionResultsDocument = gql` ) @client } `; -export type SetExecutionResultsMutationFn = ApolloReactCommon.MutationFunction; +export type SetExecutionResultsMutationFn = Apollo.MutationFunction; /** * __useSetExecutionResultsMutation__ @@ -1752,19 +1754,19 @@ export type SetExecutionResultsMutationFn = ApolloReactCommon.MutationFunction) { +export function useSetExecutionResultsMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useMutation(SetExecutionResultsDocument, options); + return Apollo.useMutation(SetExecutionResultsDocument, options); } export type SetExecutionResultsMutationHookResult = ReturnType; -export type SetExecutionResultsMutationResult = ApolloReactCommon.MutationResult; -export type SetExecutionResultsMutationOptions = ApolloReactCommon.BaseMutationOptions; +export type SetExecutionResultsMutationResult = Apollo.MutationResult; +export type SetExecutionResultsMutationOptions = Apollo.BaseMutationOptions; export const ClearExecutionResultsDocument = gql` mutation ClearExecutionResults($resultType: ResultType!) { clearCachedExecutionResults(resultType: $resultType) @client } `; -export type ClearExecutionResultsMutationFn = ApolloReactCommon.MutationFunction; +export type ClearExecutionResultsMutationFn = Apollo.MutationFunction; /** * __useClearExecutionResultsMutation__ @@ -1783,13 +1785,13 @@ export type ClearExecutionResultsMutationFn = ApolloReactCommon.MutationFunction * }, * }); */ -export function useClearExecutionResultsMutation(baseOptions?: ApolloReactHooks.MutationHookOptions) { +export function useClearExecutionResultsMutation(baseOptions?: Apollo.MutationHookOptions) { const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useMutation(ClearExecutionResultsDocument, options); + return Apollo.useMutation(ClearExecutionResultsDocument, options); } export type ClearExecutionResultsMutationHookResult = ReturnType; -export type ClearExecutionResultsMutationResult = ApolloReactCommon.MutationResult; -export type ClearExecutionResultsMutationOptions = ApolloReactCommon.BaseMutationOptions; +export type ClearExecutionResultsMutationResult = Apollo.MutationResult; +export type ClearExecutionResultsMutationOptions = Apollo.BaseMutationOptions; export const GetProjectsDocument = gql` query GetProjects { projectList { @@ -1797,31 +1799,6 @@ export const GetProjectsDocument = gql` id updatedAt title - contractTemplates { - id - script - title - index - } - transactionTemplates { - id - script - title - index - } - scriptTemplates { - id - script - title - index - } - contractDeployments { - id - script - title - address - blockHeight - } } } } @@ -1842,17 +1819,17 @@ export const GetProjectsDocument = gql` * }, * }); */ -export function useGetProjectsQuery(baseOptions?: ApolloReactHooks.QueryHookOptions) { +export function useGetProjectsQuery(baseOptions?: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useQuery(GetProjectsDocument, options); + return Apollo.useQuery(GetProjectsDocument, options); } -export function useGetProjectsLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions) { +export function useGetProjectsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useLazyQuery(GetProjectsDocument, options); + return Apollo.useLazyQuery(GetProjectsDocument, options); } export type GetProjectsQueryHookResult = ReturnType; export type GetProjectsLazyQueryHookResult = ReturnType; -export type GetProjectsQueryResult = ApolloReactCommon.QueryResult; +export type GetProjectsQueryResult = Apollo.QueryResult; export const GetProjectDocument = gql` query GetProject($projectId: UUID!) { project(id: $projectId) { @@ -1922,17 +1899,17 @@ export const GetProjectDocument = gql` * }, * }); */ -export function useGetProjectQuery(baseOptions: ApolloReactHooks.QueryHookOptions) { +export function useGetProjectQuery(baseOptions: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useQuery(GetProjectDocument, options); + return Apollo.useQuery(GetProjectDocument, options); } -export function useGetProjectLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions) { +export function useGetProjectLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useLazyQuery(GetProjectDocument, options); + return Apollo.useLazyQuery(GetProjectDocument, options); } export type GetProjectQueryHookResult = ReturnType; export type GetProjectLazyQueryHookResult = ReturnType; -export type GetProjectQueryResult = ApolloReactCommon.QueryResult; +export type GetProjectQueryResult = Apollo.QueryResult; export const GetLocalProjectDocument = gql` query GetLocalProject { project: localProject @client { @@ -1986,17 +1963,17 @@ export const GetLocalProjectDocument = gql` * }, * }); */ -export function useGetLocalProjectQuery(baseOptions?: ApolloReactHooks.QueryHookOptions) { +export function useGetLocalProjectQuery(baseOptions?: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useQuery(GetLocalProjectDocument, options); + return Apollo.useQuery(GetLocalProjectDocument, options); } -export function useGetLocalProjectLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions) { +export function useGetLocalProjectLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useLazyQuery(GetLocalProjectDocument, options); + return Apollo.useLazyQuery(GetLocalProjectDocument, options); } export type GetLocalProjectQueryHookResult = ReturnType; export type GetLocalProjectLazyQueryHookResult = ReturnType; -export type GetLocalProjectQueryResult = ApolloReactCommon.QueryResult; +export type GetLocalProjectQueryResult = Apollo.QueryResult; export const GetActiveProjectDocument = gql` query GetActiveProject { activeProjectId @client @@ -2019,17 +1996,17 @@ export const GetActiveProjectDocument = gql` * }, * }); */ -export function useGetActiveProjectQuery(baseOptions?: ApolloReactHooks.QueryHookOptions) { +export function useGetActiveProjectQuery(baseOptions?: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useQuery(GetActiveProjectDocument, options); + return Apollo.useQuery(GetActiveProjectDocument, options); } -export function useGetActiveProjectLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions) { +export function useGetActiveProjectLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useLazyQuery(GetActiveProjectDocument, options); + return Apollo.useLazyQuery(GetActiveProjectDocument, options); } export type GetActiveProjectQueryHookResult = ReturnType; export type GetActiveProjectLazyQueryHookResult = ReturnType; -export type GetActiveProjectQueryResult = ApolloReactCommon.QueryResult; +export type GetActiveProjectQueryResult = Apollo.QueryResult; export const GetCachedExecutionResultsDocument = gql` query GetCachedExecutionResults { cachedExecutionResults @client { @@ -2061,17 +2038,49 @@ export const GetCachedExecutionResultsDocument = gql` * }, * }); */ -export function useGetCachedExecutionResultsQuery(baseOptions?: ApolloReactHooks.QueryHookOptions) { +export function useGetCachedExecutionResultsQuery(baseOptions?: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useQuery(GetCachedExecutionResultsDocument, options); + return Apollo.useQuery(GetCachedExecutionResultsDocument, options); } -export function useGetCachedExecutionResultsLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions) { +export function useGetCachedExecutionResultsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useLazyQuery(GetCachedExecutionResultsDocument, options); + return Apollo.useLazyQuery(GetCachedExecutionResultsDocument, options); } export type GetCachedExecutionResultsQueryHookResult = ReturnType; export type GetCachedExecutionResultsLazyQueryHookResult = ReturnType; -export type GetCachedExecutionResultsQueryResult = ApolloReactCommon.QueryResult; +export type GetCachedExecutionResultsQueryResult = Apollo.QueryResult; +export const GetApplicationErrorsDocument = gql` + query GetApplicationErrors { + errorMessage @client +} + `; + +/** + * __useGetApplicationErrorsQuery__ + * + * To run a query within a React component, call `useGetApplicationErrorsQuery` and pass it any options that fit your needs. + * When your component renders, `useGetApplicationErrorsQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useGetApplicationErrorsQuery({ + * variables: { + * }, + * }); + */ +export function useGetApplicationErrorsQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetApplicationErrorsDocument, options); + } +export function useGetApplicationErrorsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetApplicationErrorsDocument, options); + } +export type GetApplicationErrorsQueryHookResult = ReturnType; +export type GetApplicationErrorsLazyQueryHookResult = ReturnType; +export type GetApplicationErrorsQueryResult = Apollo.QueryResult; export const GetPlaygroundInfoDocument = gql` query GetPlaygroundInfo { playgroundInfo { @@ -2097,17 +2106,17 @@ export const GetPlaygroundInfoDocument = gql` * }, * }); */ -export function useGetPlaygroundInfoQuery(baseOptions?: ApolloReactHooks.QueryHookOptions) { +export function useGetPlaygroundInfoQuery(baseOptions?: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useQuery(GetPlaygroundInfoDocument, options); + return Apollo.useQuery(GetPlaygroundInfoDocument, options); } -export function useGetPlaygroundInfoLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions) { +export function useGetPlaygroundInfoLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useLazyQuery(GetPlaygroundInfoDocument, options); + return Apollo.useLazyQuery(GetPlaygroundInfoDocument, options); } export type GetPlaygroundInfoQueryHookResult = ReturnType; export type GetPlaygroundInfoLazyQueryHookResult = ReturnType; -export type GetPlaygroundInfoQueryResult = ApolloReactCommon.QueryResult; +export type GetPlaygroundInfoQueryResult = Apollo.QueryResult; export const GetExecutionResultsDocument = gql` query GetExecutionResults { cachedExecutionResults { @@ -2148,17 +2157,17 @@ export const GetExecutionResultsDocument = gql` * }, * }); */ -export function useGetExecutionResultsQuery(baseOptions?: ApolloReactHooks.QueryHookOptions) { +export function useGetExecutionResultsQuery(baseOptions?: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useQuery(GetExecutionResultsDocument, options); + return Apollo.useQuery(GetExecutionResultsDocument, options); } -export function useGetExecutionResultsLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions) { +export function useGetExecutionResultsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useLazyQuery(GetExecutionResultsDocument, options); + return Apollo.useLazyQuery(GetExecutionResultsDocument, options); } export type GetExecutionResultsQueryHookResult = ReturnType; export type GetExecutionResultsLazyQueryHookResult = ReturnType; -export type GetExecutionResultsQueryResult = ApolloReactCommon.QueryResult; +export type GetExecutionResultsQueryResult = Apollo.QueryResult; export const GetResultsDocument = gql` query GetResults { cachedExecutionResults { @@ -2199,17 +2208,49 @@ export const GetResultsDocument = gql` * }, * }); */ -export function useGetResultsQuery(baseOptions?: ApolloReactHooks.QueryHookOptions) { +export function useGetResultsQuery(baseOptions?: Apollo.QueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useQuery(GetResultsDocument, options); + return Apollo.useQuery(GetResultsDocument, options); } -export function useGetResultsLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions) { +export function useGetResultsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { const options = {...defaultOptions, ...baseOptions} - return ApolloReactHooks.useLazyQuery(GetResultsDocument, options); + return Apollo.useLazyQuery(GetResultsDocument, options); } export type GetResultsQueryHookResult = ReturnType; export type GetResultsLazyQueryHookResult = ReturnType; -export type GetResultsQueryResult = ApolloReactCommon.QueryResult; +export type GetResultsQueryResult = Apollo.QueryResult; +export const GetActiveProjectIdDocument = gql` + query GetActiveProjectId { + activeProjectId +} + `; + +/** + * __useGetActiveProjectIdQuery__ + * + * To run a query within a React component, call `useGetActiveProjectIdQuery` and pass it any options that fit your needs. + * When your component renders, `useGetActiveProjectIdQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useGetActiveProjectIdQuery({ + * variables: { + * }, + * }); + */ +export function useGetActiveProjectIdQuery(baseOptions?: Apollo.QueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(GetActiveProjectIdDocument, options); + } +export function useGetActiveProjectIdLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(GetActiveProjectIdDocument, options); + } +export type GetActiveProjectIdQueryHookResult = ReturnType; +export type GetActiveProjectIdLazyQueryHookResult = ReturnType; +export type GetActiveProjectIdQueryResult = Apollo.QueryResult; export interface IntrospectionResultData { __schema: { diff --git a/src/api/apollo/local.graphql b/src/api/apollo/local.graphql index 5dc93676..ac2ea007 100644 --- a/src/api/apollo/local.graphql +++ b/src/api/apollo/local.graphql @@ -42,3 +42,7 @@ type Mutation { ): Boolean clearCachedExecutionResults(resultType: ResultType!): Boolean } + +extend type Query { + errorMessage: String +} diff --git a/src/api/apollo/resolvers.ts b/src/api/apollo/resolvers.ts index e2657ec8..3d2cf57e 100644 --- a/src/api/apollo/resolvers.ts +++ b/src/api/apollo/resolvers.ts @@ -153,7 +153,7 @@ const localResolvers = { ): any => { cache.writeQuery({ query: gql` - query GetActiveProject { + query GetActiveProjectId { activeProjectId } `, diff --git a/src/providers/Project/index.tsx b/src/providers/Project/index.tsx index 09f1e643..b4273c85 100644 --- a/src/providers/Project/index.tsx +++ b/src/providers/Project/index.tsx @@ -301,28 +301,6 @@ export const ProjectProvider: React.FC = ({ return res; }; - const stripComments = (code: string) => { - const commentsRegExp = /(\/\*[\s\S]*?\*\/)|(\/\/.*)/g; - return code.replace(commentsRegExp, ''); - }; - - const getContractName = (cadenceCode: string): string => { - if (cadenceCode === '') return null; - const complexMatcher = /(resource|struct)\s+\w+\s*{[\s\S]+?}/g; - const noCommentsCode = stripComments(cadenceCode); - const noComplex = noCommentsCode.replace(complexMatcher, ''); - const pattern = - /(?:access\(\w+\)|pub)\s+contract\s+(?:interface)*\s*(\w*)[:\s\w]*(\s*{[.\s\S]*init\s*\((.*?)\)[.\s\S]*})?/g; - // Search for the pattern in the Cadence code - const match = pattern.exec(noComplex); - if (!match) { - console.log('Could not get contract name'); - setApplicationErrorMessage('Could not parse contract name'); - } - // Return the contract name if found, otherwise return null - return match ? match[1] : null; - }; - const updateContractTemplate = async (script: string, title: string) => { setIsSaving(true); let res;