From 924a7c778ee09ec2ab6ae4a3724f9fdac54a49c6 Mon Sep 17 00:00:00 2001 From: Anwarul Islam Date: Thu, 13 Mar 2025 17:32:14 +0600 Subject: [PATCH] feat: improve graphql query builder (#4742) Co-authored-by: nivedin --- packages/hoppscotch-common/locales/en.json | 2 + .../src/components/graphql/Argument.vue | 31 +++++++----- .../src/components/graphql/Arguments.vue | 22 +++++++-- .../src/components/graphql/DocExplorer.vue | 34 ++++++++----- .../components/graphql/ExplorerSection.vue | 6 ++- .../src/components/graphql/Field.vue | 25 +++------- .../components/graphql/FieldDocumentation.vue | 15 +++--- .../src/components/graphql/FieldLink.vue | 17 ++++--- .../src/components/graphql/Fields.vue | 8 ++- .../src/components/graphql/Query.vue | 2 +- .../graphql/SchemaDocumentation.vue | 12 ++--- .../components/graphql/TypeDocumentation.vue | 13 ++--- .../src/components/graphql/TypeLink.vue | 10 +++- .../src/helpers/graphql/explorer.ts | 3 +- .../src/helpers/graphql/query.ts | 49 ++++++++++++++----- 15 files changed, 157 insertions(+), 92 deletions(-) diff --git a/packages/hoppscotch-common/locales/en.json b/packages/hoppscotch-common/locales/en.json index b4dd917d..cd1c4dff 100644 --- a/packages/hoppscotch-common/locales/en.json +++ b/packages/hoppscotch-common/locales/en.json @@ -536,11 +536,13 @@ "renamed": "Folder renamed" }, "graphql": { + "arguments": "Arguments", "connection_switch_confirm": "Do you want to connect with the latest GraphQL endpoint?", "connection_error_http": "Failed to fetch GraphQL Schema due to network error.", "connection_switch_new_url": "Switching to a tab will disconnected you from the active GraphQL connection. New connection URL is", "connection_switch_url": "You're connected to a GraphQL endpoint the connection URL is", "deprecated": "Deprecated", + "fields": "Fields", "mutation": "Mutation", "mutations": "Mutations", "schema": "Schema", diff --git a/packages/hoppscotch-common/src/components/graphql/Argument.vue b/packages/hoppscotch-common/src/components/graphql/Argument.vue index f94b82d9..e516e439 100644 --- a/packages/hoppscotch-common/src/components/graphql/Argument.vue +++ b/packages/hoppscotch-common/src/components/graphql/Argument.vue @@ -8,20 +8,28 @@
-

+

- - + + - {{ arg.name }} : - - -

+
+ + {{ arg.name }} + + : + + +
+
{{ title }}
diff --git a/packages/hoppscotch-common/src/components/graphql/Field.vue b/packages/hoppscotch-common/src/components/graphql/Field.vue index 17b258d3..d9011748 100644 --- a/packages/hoppscotch-common/src/components/graphql/Field.vue +++ b/packages/hoppscotch-common/src/components/graphql/Field.vue @@ -1,9 +1,11 @@