graphql: show enums and interfaces

make scalars not clickable
This commit is contained in:
Igor Stuzhuk (KoHcoJlb)
2021-02-07 19:07:09 +02:00
parent a32ce56295
commit c9e542d6d5
4 changed files with 64 additions and 9 deletions

View File

@@ -364,6 +364,7 @@
<div v-for="type in filteredGraphqlTypes" :key="type.name">
<type
:gqlType="type"
:gqlTypes="graphqlTypes"
:isHighlighted="isGqlTypeHighlighted({ gqlType: type })"
:highlightedFields="getGqlTypeHighlightedFields({ gqlType: type })"
:jumpTypeCallback="handleJumpToType"
@@ -740,14 +741,17 @@ export default {
? schema.getSubscriptionType().name
: ""
for (const type in typeMap) {
for (const typeName in typeMap) {
let type = typeMap[typeName]
if (
!typeMap[type].name.startsWith("__") &&
![queryTypeName, mutationTypeName, subscriptionTypeName].includes(typeMap[type].name) &&
(typeMap[type] instanceof gql.GraphQLObjectType ||
typeMap[type] instanceof gql.GraphQLInputObjectType)
!type.name.startsWith("__") &&
![queryTypeName, mutationTypeName, subscriptionTypeName].includes(type.name) &&
(type instanceof gql.GraphQLObjectType ||
type instanceof gql.GraphQLInputObjectType ||
type instanceof gql.GraphQLEnumType ||
type instanceof gql.GraphQLInterfaceType)
) {
types.push(typeMap[type])
types.push(type)
}
}
this.graphqlTypes = types
@@ -828,7 +832,6 @@ export default {
}
this.$nuxt.$loading.finish()
},
async getSchema() {
const startTime = Date.now()