I have aproblem when test Apollo.When I try query with apollo and graphql, i want response return error and partical data, so I set property errorPolicy:'all'. But its not work. I don't no why? Help please! Here my code:
query { animal { name age }, school { name numberfd } } `
const { loading,data,error} = useQuery(GET_DASHBOARD_DATA, { errorPolicy:'all', onCompleted: (res) => {console.log("complete",res)}, onError : (res,data) => {console.log("ERRRR",res,data)}, })
and i want to receive:
{ error:[...], data:[animal:[...]] }
but its only response error.Here is Apollo's doc: https://www.apollographql.com/docs/react/data/error-handling/
onErrortype isonError?: (error: ApolloError) => void;. You don't havedatainsideonErrorcallback. AfteruseQueryyou can add: