From cc396aecd3fe7201802ecb6e390840d16f1ebbe9 Mon Sep 17 00:00:00 2001 From: Andrew Bastin Date: Thu, 9 Jan 2020 13:32:38 -0500 Subject: [PATCH] Updated field, type and graphql page to use the new argument and typelink components --- components/graphql/field.vue | 33 +++++++++++++++++++++++++++++++-- components/graphql/type.vue | 6 ++++-- pages/graphql.vue | 28 +++++++++++++++++++++++----- 3 files changed, 58 insertions(+), 9 deletions(-) diff --git a/components/graphql/field.vue b/components/graphql/field.vue index b5acb1b54..e717cca2c 100644 --- a/components/graphql/field.vue +++ b/components/graphql/field.vue @@ -1,6 +1,18 @@ @@ -36,9 +49,17 @@ diff --git a/pages/graphql.vue b/pages/graphql.vue index f6c201d94..2ebd97f0c 100644 --- a/pages/graphql.vue +++ b/pages/graphql.vue @@ -288,7 +288,7 @@
- +
@@ -304,7 +304,7 @@
- +
@@ -320,7 +320,7 @@
- +
@@ -335,8 +335,8 @@ {{ $t("types") }}
-
- +
+
@@ -563,6 +563,24 @@ export default { } }, methods: { + handleJumpToType(type) { + const typesTab = document.getElementById("gqltypes-tab"); + typesTab.checked = true; + + const rootTypeName = this.resolveRootType(type).name; + + const target = document.getElementById(`type_${rootTypeName}`); + if (target) { + target.scrollIntoView({ + behavior: 'smooth' + }); + } + }, + resolveRootType(type) { + let t = type; + while (t.ofType != null) t = t.ofType; + return t; + }, copySchema() { this.$refs.copySchemaCode.innerHTML = this.doneButton; const aux = document.createElement("textarea");