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