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