UNPKG

430 BJavaScriptView Raw
1import get from 'lodash.get';
2export default function getErrorDetail(error) {
3 const graphQLErrors = get(error, 'graphQLErrors', []);
4 const codes = graphQLErrors
5 .map(error => get(error, 'extensions.code'))
6 .filter(Boolean);
7 const data = graphQLErrors
8 .map(error => get(error, 'extensions.data'))
9 .filter(Boolean);
10 return { codes, data };
11}
12//# sourceMappingURL=getErrorDetail.js.map
\No newline at end of file