UNPKG

graphql-mocks

Version:

Tools for setting up graphql test resolvers

14 lines (12 loc) 385 B
'use strict'; 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