Filtered unwanted type entries
This commit is contained in:
@@ -143,9 +143,16 @@ export default {
|
|||||||
|
|
||||||
const typeMap = schema.getTypeMap();
|
const typeMap = schema.getTypeMap();
|
||||||
const types = [];
|
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) {
|
for (const type in typeMap) {
|
||||||
|
if (!typeMap[type].name.startsWith("__") && !(([queryTypeName, mutationTypeName, subscriptionTypeName]).includes(typeMap[type].name)) && typeMap[type] instanceof gql.GraphQLObjectType) {
|
||||||
types.push(typeMap[type]);
|
types.push(typeMap[type]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
this.gqlTypes = types;
|
this.gqlTypes = types;
|
||||||
console.log(this.gqlTypes);
|
console.log(this.gqlTypes);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user