UNPKG

graphql-mocks

Version:

Tools for setting up graphql test resolvers

14 lines (12 loc) 534 B
'use strict'; function isRootMutationType(schema, type) { var _schema$getMutationTy; if (typeof type !== 'string' && !('name' in type)) { return false; } const rootQueryTypeName = (_schema$getMutationTy = schema.getMutationType()) === null || _schema$getMutationTy === void 0 ? void 0 : _schema$getMutationTy.name; const typeName = typeof type === 'string' ? type : type.name; return typeName === rootQueryTypeName; } exports.isRootMutationType = isRootMutationType; //# sourceMappingURL=is-root-mutation-type.js.map