graphql-mocks
Version:
Tools for setting up graphql test resolvers
15 lines (11 loc) • 484 B
JavaScript
function isRootQueryType(schema, type) {
var _schema$getQueryType;
if (typeof type !== 'string' && !('name' in type)) {
return false;
}
var rootQueryTypeName = (_schema$getQueryType = schema.getQueryType()) === null || _schema$getQueryType === void 0 ? void 0 : _schema$getQueryType.name;
var typeName = typeof type === 'string' ? type : type.name;
return typeName === rootQueryTypeName;
}
export { isRootQueryType };
//# sourceMappingURL=is-root-query-type.js.map