src/query/query.js
function getIdFetcher(graffitiModels) {
  return function idFetcher(obj, { id: globalId }, context, info) {
    const { type, id } = fromGlobalId(globalId);

    if (type === 'Viewer') {
      return viewer;
    } else if (graffitiModels[type]) {
      const Collection = graffitiModels[type].model;
      return getOne(Collection, { id }, context, info);
    }

    return null;
  };
}
function getIdFetcher(graffitiModels) {
  return function idFetcher(obj, { id: globalId }, context, info) {
    const { type, id } = fromGlobalId(globalId);

    if (type === 'Viewer') {
      return viewer;
    } else if (graffitiModels[type]) {
      const Collection = graffitiModels[type].model;
      return getOne(Collection, { id }, context, info);
    }

    return null;
  };
}
function getIdFetcher ( graffitiModels ) { return function idFetcher ( obj , { id : globalId } , context , info ) { const { type , id } = fromGlobalId ( globalId ) ; if ( type === 'Viewer' ) { return viewer ; } else if ( graffitiModels [ type ] ) { const Collection = graffitiModels [ type ] . model ; return getOne ( Collection , { id } , context , info ) ; } return null ; } ; }
Returns an idFetcher function, that can resolve
an object based on a global id
Returns an idFetcher function that can resolve an object based on a global id