-
Couldn't load subscription status.
- Fork 2.7k
Closed
Labels
Description
I'm experiencing a slight breaking change from 0.5.10 to 0.5.26. Basically, errors thrown from graphql-client are instances of ApolloError at the first, but not at the later.
Here goes a code to reproduce this issue:
import React, { Component } from 'react'
import { ApolloError } from 'apollo-client/errors/ApolloError'
import { graphql } from 'react-apollo'
import gql from 'graphql-tag'
class MyContainer extends Component {
save () {
this.props.mutate()
.catch(error => {
if (error instanceof ApolloError) {
// This works in 0.5.10
// This does not work in 0.5.26
alert('Error is an instance of ApolloError')
}
})
}
render () {
return (
<button onClick={ this.save }>Save</button>
)
}
}
const query = gql`
mutation MutationName
mutate {
resultingField
}
}
`
export default graphql(query)(MyContainer)I found this problem doing error normalization using the previous version, but once I've update the module, the code stopped working.