graphql-mocks
Version:
Tools for setting up graphql test resolvers
14 lines (12 loc) • 515 B
JavaScript
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
;