From ea847d7d32069600c7a12552308166d1d8d01b9f Mon Sep 17 00:00:00 2001 From: Akash K <57758277+amk-dev@users.noreply.github.com> Date: Tue, 4 Apr 2023 04:18:29 +0530 Subject: [PATCH] chore: remove unwanted logs & use new gql generation for selfhosted-web (#65) --- packages/hoppscotch-common/src/components/http/Request.vue | 5 ----- .../hoppscotch-common/src/helpers/collection/collection.ts | 2 -- packages/hoppscotch-selfhost-web/gql-codegen.yml | 5 ++--- packages/hoppscotch-selfhost-web/package.json | 3 ++- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/packages/hoppscotch-common/src/components/http/Request.vue b/packages/hoppscotch-common/src/components/http/Request.vue index ed98b98c..d33740c0 100644 --- a/packages/hoppscotch-common/src/components/http/Request.vue +++ b/packages/hoppscotch-common/src/components/http/Request.vue @@ -352,15 +352,11 @@ const newSendRequest = async () => { ensureMethodInEndpoint() - console.log("Sending request", newEndpoint.value) - loading.value = true // Double calling is because the function returns a TaskEither than should be executed const streamResult = await runRESTRequest$(tab)() - console.log("Stream result", streamResult) - if (isRight(streamResult)) { subscribeToStream( streamResult.right, @@ -449,7 +445,6 @@ const clearContent = () => { const updateRESTResponse = (response: HoppRESTResponse | null) => { tab.value.response = response - console.log("Updating response", response) } const copyLinkIcon = refAutoReset< diff --git a/packages/hoppscotch-common/src/helpers/collection/collection.ts b/packages/hoppscotch-common/src/helpers/collection/collection.ts index 31de08e7..63a90481 100644 --- a/packages/hoppscotch-common/src/helpers/collection/collection.ts +++ b/packages/hoppscotch-common/src/helpers/collection/collection.ts @@ -124,8 +124,6 @@ export function getFoldersByPath( // path will be like this "0/0/1" these are the indexes of the folders const pathArray = path.split("/").map((index) => parseInt(index)) - console.log(pathArray, collections[pathArray[0]]) - let currentCollection = collections[pathArray[0]] if (pathArray.length === 1) { diff --git a/packages/hoppscotch-selfhost-web/gql-codegen.yml b/packages/hoppscotch-selfhost-web/gql-codegen.yml index 6f42fcbe..0237c339 100644 --- a/packages/hoppscotch-selfhost-web/gql-codegen.yml +++ b/packages/hoppscotch-selfhost-web/gql-codegen.yml @@ -1,6 +1,5 @@ overwrite: true -schema: - - ${VITE_BACKEND_GQL_URL} +schema: "../../gql-gen/*.gql" generates: src/api/generated/graphql.ts: documents: "src/**/*.graphql" @@ -14,6 +13,6 @@ generates: - typed-document-node - typescript-urql-graphcache - src/helpers/backend/backend-schema.json: + src/api/generated/backend-schema.json: plugins: - urql-introspection diff --git a/packages/hoppscotch-selfhost-web/package.json b/packages/hoppscotch-selfhost-web/package.json index 7e86b625..44f54c2f 100644 --- a/packages/hoppscotch-selfhost-web/package.json +++ b/packages/hoppscotch-selfhost-web/package.json @@ -17,7 +17,8 @@ "do-lint": "pnpm run prod-lint", "do-typecheck": "pnpm run lint", "do-lintfix": "pnpm run lintfix", - "gql-codegen": "graphql-codegen --require dotenv/config --config gql-codegen.yml dotenv_config_path=\"../../.env\"" + "gql-codegen": "graphql-codegen --require dotenv/config --config gql-codegen.yml dotenv_config_path=\"../../.env\"", + "postinstall": "pnpm run gql-codegen" }, "dependencies": { "@hoppscotch/common": "workspace:^",