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