Fix breaking change in errorHandler

This commit is contained in:
Robert Schäfer 2019-08-02 00:10:14 +02:00
parent 246a2f690f
commit 15559dedfc
2 changed files with 10 additions and 8 deletions

View File

@ -165,14 +165,7 @@ module.exports = {
tokenExpires: 3, // optional, default: 7 (days)
// includeNodeModules: true, // optional, default: false (this includes graphql-tag for node_modules folder)
// optional
errorHandler(error) {
/* eslint-disable-next-line no-console */
console.log(
'%cError',
'background: red; color: white; padding: 2px 4px; border-radius: 3px; font-weight: bold;',
error.message,
)
},
errorHandler: '~/plugins/apollo-error-handler.js',
// Watch loading state for all queries
// See 'Smart Query > options > watchLoading' for detail

View File

@ -0,0 +1,9 @@
export default (error, context) => {
/* eslint-disable-next-line no-console */
console.log(
'%cError',
'background: red; color: white; padding: 2px 4px; border-radius: 3px; font-weight: bold;',
error.message,
)
context.error({ statusCode: 304, message: 'Server error' })
}