@graphql-inspector/core
Advanced tools
Comparing version 6.1.0-alpha-20240530095826-3cfc692931a74de2394cd33de93cd78a58a86627 to 6.1.0-alpha-20240530111110-0e06f7128ed941de13b706fd8684a07cb4bdcab7
@@ -19,4 +19,7 @@ "use strict"; | ||
numQueries: 0, | ||
numCoveredQueries: 0, | ||
numMutations: 0, | ||
numCoveredMutations: 0, | ||
numSubscriptions: 0, | ||
numCoveredSubscriptions: 0, | ||
}, | ||
@@ -39,2 +42,13 @@ }; | ||
const locations = fieldCoverage.locations[sourceName]; | ||
switch (typeCoverage.type.name) { | ||
case 'Query': | ||
coverage.stats.numCoveredQueries++; | ||
break; | ||
case 'Mutation': | ||
coverage.stats.numCoveredMutations++; | ||
break; | ||
case 'Subscription': | ||
coverage.stats.numCoveredSubscriptions++; | ||
break; | ||
} | ||
typeCoverage.hits++; | ||
@@ -71,17 +85,17 @@ fieldCoverage.hits++; | ||
}; | ||
if ((0, graphql_1.isObjectType)(type) || (0, graphql_1.isInterfaceType)(type)) { | ||
switch (type.name) { | ||
case 'Query': | ||
coverage.stats.numQueries++; | ||
break; | ||
case 'Mutation': | ||
coverage.stats.numMutations++; | ||
break; | ||
case 'Subscription': | ||
coverage.stats.numSubscriptions++; | ||
break; | ||
} | ||
} | ||
const fieldMap = type.getFields(); | ||
for (const fieldname in fieldMap) { | ||
if ((0, graphql_1.isObjectType)(type) || (0, graphql_1.isInterfaceType)(type)) { | ||
switch (type.name) { | ||
case 'Query': | ||
coverage.stats.numQueries++; | ||
break; | ||
case 'Mutation': | ||
coverage.stats.numMutations++; | ||
break; | ||
case 'Subscription': | ||
coverage.stats.numSubscriptions++; | ||
break; | ||
} | ||
} | ||
const field = fieldMap[fieldname]; | ||
@@ -88,0 +102,0 @@ typeCoverage.children[field.name] = { |
@@ -16,4 +16,7 @@ import { isInterfaceType, isObjectType, TypeInfo, visit, visitWithTypeInfo, } from 'graphql'; | ||
numQueries: 0, | ||
numCoveredQueries: 0, | ||
numMutations: 0, | ||
numCoveredMutations: 0, | ||
numSubscriptions: 0, | ||
numCoveredSubscriptions: 0, | ||
}, | ||
@@ -36,2 +39,13 @@ }; | ||
const locations = fieldCoverage.locations[sourceName]; | ||
switch (typeCoverage.type.name) { | ||
case 'Query': | ||
coverage.stats.numCoveredQueries++; | ||
break; | ||
case 'Mutation': | ||
coverage.stats.numCoveredMutations++; | ||
break; | ||
case 'Subscription': | ||
coverage.stats.numCoveredSubscriptions++; | ||
break; | ||
} | ||
typeCoverage.hits++; | ||
@@ -68,17 +82,17 @@ fieldCoverage.hits++; | ||
}; | ||
if (isObjectType(type) || isInterfaceType(type)) { | ||
switch (type.name) { | ||
case 'Query': | ||
coverage.stats.numQueries++; | ||
break; | ||
case 'Mutation': | ||
coverage.stats.numMutations++; | ||
break; | ||
case 'Subscription': | ||
coverage.stats.numSubscriptions++; | ||
break; | ||
} | ||
} | ||
const fieldMap = type.getFields(); | ||
for (const fieldname in fieldMap) { | ||
if (isObjectType(type) || isInterfaceType(type)) { | ||
switch (type.name) { | ||
case 'Query': | ||
coverage.stats.numQueries++; | ||
break; | ||
case 'Mutation': | ||
coverage.stats.numMutations++; | ||
break; | ||
case 'Subscription': | ||
coverage.stats.numSubscriptions++; | ||
break; | ||
} | ||
} | ||
const field = fieldMap[fieldname]; | ||
@@ -85,0 +99,0 @@ typeCoverage.children[field.name] = { |
{ | ||
"name": "@graphql-inspector/core", | ||
"version": "6.1.0-alpha-20240530095826-3cfc692931a74de2394cd33de93cd78a58a86627", | ||
"version": "6.1.0-alpha-20240530111110-0e06f7128ed941de13b706fd8684a07cb4bdcab7", | ||
"description": "Tooling for GraphQL. Compare GraphQL Schemas, check documents, find breaking changes, find similar types.", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
@@ -45,4 +45,7 @@ import { GraphQLError, GraphQLNamedType, GraphQLSchema, Source } from 'graphql'; | ||
numQueries: number; | ||
numCoveredQueries: number; | ||
numMutations: number; | ||
numCoveredMutations: number; | ||
numSubscriptions: number; | ||
numCoveredSubscriptions: number; | ||
numFieldsCovered: number; | ||
@@ -49,0 +52,0 @@ numFiledsCovered: number; |
Sorry, the diff of this file is not supported yet
517589
9571