UNPKG

graphql-mocks

Version:
21 lines (15 loc) 454 B
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); function getFieldForReference(schema, reference) { const [typeName, fieldName] = reference; const type = schema.getType(typeName); if (type && 'getFields' in type) { const fields = type.getFields(); return fields[fieldName]; } return undefined; } exports.getFieldForReference = getFieldForReference; //# sourceMappingURL=get-field-for-reference.js.map