-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No field of name "pageInfo" found on type "Product" in schema #864
Comments
I'm seeing the same error when trying to retrieve a metafield. const metafieldQuery = client.graphQLClient.query((root) => {
root.addConnection(
'product',
{ args: { handle: 'myHandle' } },
(product) => {
product.addConnection(
'metafield',
{ args: { key: 'has_textfield', namespace: 'my_fields' } },
(metafield) => {
metafield.add('value')
}
)
}
)
})
client.graphQLClient
.send(metafieldQuery)
.then(({ model, data }) => {
console.log(model, data)
}) @Luca8991 any luck yet? |
@riccardolardi nope... |
@Luca8991 I worked around it by querying for const metafieldQuery = client.graphQLClient.query((root) => {
root.addConnection('products', { args: { first: 249 } }, (product) => {
product.add('handle')
product.addConnection(
'metafields',
{ args: { first: 249 } },
(metafield) => {
metafield.add('key')
metafield.add('value')
}
)
})
})
const metafieldQueryResult = await client.graphQLClient.send(
metafieldQuery
) See more about it here #168 |
Have same error when query |
I’m trying to fetch the stock of a single product; having the same issue with this error message and same code. How are we supposed to query a single product if not like this? Handle or ID would both work great for me; but I ideally don’t want to have to loop through 1000+ products every-time I need to check the stock of just one. |
@simonhrogers were you able to sort out this query? |
@danieladarve Nope, sorry! Low budget / tight deadline affair so I’ve had to settle for querying all products until someone else can resolve this. As far as I can tell its an issue with the current version of the buy SDK. |
@simonhrogers Maybe this will help you. While you can retrieve a product using the js-buy-sdk
In my case the SDK it doesn't return tags and metafields. So here is what I ended up doing at the end: Created a graphQL Apollo cllient
|
I have run into this issue too. It looks like this issue is present when trying to query for any singular object and on at least the customer mutations. I am trying the use the customerAccessTokenCreate mutation, but can't get past this error.
|
After a few hours of trial & error (mostly error) here's the latest and greatest version of product metafield & tag fetching.
It would be nice to include it as an example on the README to save other people's time. |
resurfacing this - any idea what the timeline may be to resolve the issue and retrieve metadata/metadatas from SDK? |
or we can have additional fields such as metafield/metafields and tags etc to flow through into the optimized version of .fetch and .fetchAll, rather the optimized graphQLClient |
crap i have the same problem. glad I spent hours trying to debug it when there's been a bug report open for 2 years 😛 trying to do the same thing as @simonhrogers, trying to get the I ended up doing what @riccardolardi suggested, which is just querying lots of products and filtering them. seems like a huge waste, but that's on you shopify. async function getProductsGraphql4(productId) {
const productsQuery = client.graphQLClient.query((root) => {
root.addConnection('products', { args: { first: 250 } }, (product) => {
product.add('title');
product.add('totalInventory');
});
});
let result = await client.graphQLClient.send(productsQuery)
return result.data.products.edges.find(p => p.node.id === productId).node;
} This of course only works if you have less than 250 products. If you had more you'd have to loop through multiple requests and use the cursor to get additional pages (which would be even more ridiculous for getting a single value of a single product). So uhh... fix this please shopify.... |
@Luca8991, change
|
Bug details
Describe the bug
Trying to get a product with graphQLClient (from
index.unoptimized.umd
) fails.To Reproduce
Expected behavior
Function should return the Product element.
Environment (please complete the following information):
Bug Report Checklist
The text was updated successfully, but these errors were encountered: