function formatError(error) {
  !error ? (0, _invariant2.default)(0, 'Received null or undefined error.') : void 0;
  return {
    message: error.message,
    locations: error.locations,
    path: error.path
  };
}
Given a GraphQLError, format it according to the rules described by the
Response Format, Errors section of the GraphQL Specification.