From 8e3542863ae583dd1e3a30bf530fd3851a5969b6 Mon Sep 17 00:00:00 2001 From: Andrew Bastin Date: Mon, 18 Nov 2019 21:53:13 -0500 Subject: [PATCH] Filtered unwanted type entries --- pages/graphql.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pages/graphql.vue b/pages/graphql.vue index ff6d3ae52..70a682ce1 100644 --- a/pages/graphql.vue +++ b/pages/graphql.vue @@ -143,8 +143,15 @@ export default { const typeMap = schema.getTypeMap(); const types = []; + + const queryTypeName = schema.getQueryType() ? schema.getQueryType().name : ''; + const mutationTypeName = schema.getMutationType() ? schema.getMutationType().name : ''; + const subscriptionTypeName = schema.getSubscriptionType() ? schema.getSubscriptionType().name : ''; + for (const type in typeMap) { - types.push(typeMap[type]); + if (!typeMap[type].name.startsWith("__") && !(([queryTypeName, mutationTypeName, subscriptionTypeName]).includes(typeMap[type].name)) && typeMap[type] instanceof gql.GraphQLObjectType) { + types.push(typeMap[type]); + } } this.gqlTypes = types; console.log(this.gqlTypes);