Capture GraphQL errors and handle them accordingly.
Nuxt Apollo provides a nuxt hook named apollo:error which captures errors encountered by apollo client(s).
export default defineNuxtPlugin((nuxtApp) => {
nuxtApp.hook('apollo:error', (error) => {
console.error(error)
// Handle different error cases
})
})