From 34be6ce7956ab5b838c30f01647a8ab6ace467b4 Mon Sep 17 00:00:00 2001 From: Andrew Bastin Date: Mon, 18 Nov 2019 15:17:33 -0500 Subject: [PATCH] Added GraphQL types section in docs --- pages/graphql.vue | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/pages/graphql.vue b/pages/graphql.vue index ac7e8a5ee..ff6d3ae52 100644 --- a/pages/graphql.vue +++ b/pages/graphql.vue @@ -58,6 +58,13 @@ + + +
+
+ +
+
@@ -74,6 +81,7 @@ export default { components: { "pw-section": () => import("../components/section"), "gql-field": () => import("../components/graphql/field"), + "gql-type": () => import("../components/graphql/type"), Editor: AceEditor }, data() { @@ -82,7 +90,8 @@ export default { schemaString: "", queryFields: [], mutationFields: [], - subscriptionFields: [] + subscriptionFields: [], + gqlTypes: [] }; }, methods: { @@ -132,6 +141,14 @@ export default { this.subscriptionFields = sFields; } + const typeMap = schema.getTypeMap(); + const types = []; + for (const type in typeMap) { + types.push(typeMap[type]); + } + this.gqlTypes = types; + console.log(this.gqlTypes); + this.$nuxt.$loading.finish(); const duration = Date.now() - startTime; this.$toast.info(`Finished in ${duration}ms`, {