in my local http://localhost:3000/graphql query is working like below...
but when I am querying through apollo client its response coming empty
import {InMemoryCache, gql, ApolloClient, HttpLink} from 'apollo-boost';
const cache = new InMemoryCache();
const client = new ApolloClient({
cache,
link: new HttpLink({
uri: 'http://localhost:3000/graphql',
credentials: 'same-origin',
}),
},
});
client
.query({
query: gql`
{
brands {
_id
}
}
`,
})
.then(data => console.log(data))
.catch(error => {
// its coming in this section
console.log(error);
});
Don't know what I am missing. Any help is appreciated Thanks !!!
below are the screenshots, when I am trying to query from frontend side