All files Resolver.js

100% Statements 5/5
100% Branches 4/4
100% Functions 2/2
100% Lines 5/5
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;
}