0
I’m new to Apollo Client and I want to test API endpoint to fetch the data.
const client = new ApolloClient({
cache: new InMemoryCache(),
link: new HttpLink({
uri: "https://api.thecatapi.com/v1/breeds",
useGETForQueries: true
}),
});
client
.query({
query: gql`
{
id
name
}
`,
})
.then((result) => console.log(result))
In data
field I keep getting undefined. I know that the problem is somewhere in the query but I can’t figure out how I should structure it.