A problem was encountered with not sending the request
It looks like the page is cached. Even though the console.log print was able to print the GQL statement, no request was sent, and the backend received no data, but the data returned
Solution:
const defaultOptions: DefaultOptions = {
watchQuery: {
fetchPolicy: 'no-cache',
errorPolicy: 'ignore'
},
query: {
fetchPolicy: 'no-cache',
errorPolicy: 'all'
}
}
const applloClient = new ApolloClient({
cache: new InMemoryCache(),
defaultOptions: defaultOptions,
uri: 'http://localhost:3001/graphql'
})
Copy the code