Closed wukong1995 closed 4 years ago
when I in server set status code is 403, and throw error
I get result in chrome network
data: { xxx: null } errors: [{xxxx}]
when I use client.query, I get graphqlError
// data.js const getData = () => return client.query(xxxx) // apollo.util.js const errorLink = onError(({ networkError, graphQLErrors }) => { console.log(graphQLErrors, networkError) // output: {data: xxx, errors: xxxx}, undefined })
when I use graphql hoc, I get networkError
// data.js const getData = graphql(xxxxx) // apollo.util.js const errorLink = onError(({ networkError, graphQLErrors }) => { console.log(graphQLErrors, networkError) // output: undefined, { statusCode: 403, result: xxxx, ...} })
Version
"apollo-cache-inmemory": "^1.6.6", "apollo-client": "^2.6.10", "apollo-link-context": "^1.0.20", "apollo-link-error": "^1.1.13", "apollo-link-http": "^1.5.17", "graphql": "^15.3.0", "graphql-tag": "^2.10.3", "react-apollo": "^2.5.8",
I try upgrade v3
i find Deprecated React Apollo HOC API, so i close this issue.
when I in server set status code is 403, and throw error
I get result in chrome network
when I use client.query, I get graphqlError
when I use graphql hoc, I get networkError
Version