| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | 3x 1x 2x 1x 2x | import buildResolvers from './buildResolvers';
import resolveObject from './resolveObject';
export default function Resolver(mapping) {
if (typeof mapping !== 'object' || mapping === null) {
throw new Error('You must provide a mapping object');
}
const resolvers = buildResolvers(mapping);
function Resolve(values, context) {
return resolveObject(resolvers, values, context);
}
return Resolve;
}
|