Hello, I am developing an app for shopify platform. After following tutorial on how to set up node environment, I've tried to make a request to the graphql API. However, the data response were undefined. I am not sure why.
Appollo setup
const client = new ApolloClient({
fetch: fetch,
fetchOptions: {
credentials: "include",
headers: {
'Content-Type': 'application/graphql',
}
},
});
This request actually receive data
query ($ids: [ID!]!) {
nodes(ids: $ids) {
... on Collection {
id
}
}
}
However this returns undefined
query ($ids: [ID!]!) {
nodes(ids: $ids) {
... on Collection {
id
products(first: 10) {
edges {
cursor
node {
id
images(first: 4) {
edges {
cursor
node {
id
src
}
}
pageInfo {
hasNextPage
hasPreviousPage
}
}
}
}
pageInfo {
hasNextPage
hasPreviousPage
}
}
}
... on Product {
id
images(first: 4) {
edges {
cursor
node {
id
src
}
}
pageInfo {
hasNextPage
hasPreviousPage
}
}
}
}
}
Thanks for helping
Solved! Go to the solution
User | Count |
---|---|
28 | |
7 | |
7 | |
6 | |
5 |