UNPKG

graphql-mocks

Version:

Tools for setting up graphql test resolvers

17 lines (16 loc) 696 B
import { isTypeReference } from './is-type-reference.mjs'; import { isFieldReference } from './is-field-reference.mjs'; function getTypeForReference(schema, reference) { if (isTypeReference(reference)) { var _schema$getType; return (_schema$getType = schema.getType(reference)) !== null && _schema$getType !== void 0 ? _schema$getType : undefined; } if (isFieldReference(reference)) { var _schema$getType2; var [typeName] = reference; return (_schema$getType2 = schema.getType(typeName)) !== null && _schema$getType2 !== void 0 ? _schema$getType2 : undefined; } return undefined; } export { getTypeForReference }; //# sourceMappingURL=get-type-for-reference.mjs.map