OK, so the following code works, but each named query, ‘Vendor’ and ‘Title’, has to be run separately, and it seems to me that there really, really, really should be a way to run them together?
I’m using the GraphiQL app in the browser that is accessible from the ‘apps’ menu.
query Vendor($vendor: String!){
products(first:20, query: $vendor) {
edges {
node {
totalInventory
title
handle
vendor
description
featuredImage {
originalSrc
altText
}
images(first: 3) {
edges {
node {
originalSrc
altText
}
}
}
options {
values
}
variants(first:10) {
edges {
node {
price
}
}
}
}
}
}
}
query Title($title: String!) {
products(first:20, query: $title) {
edges {
node {
totalInventory
title
handle
vendor
description
featuredImage {
originalSrc
altText
}
images(first: 3) {
edges {
node {
originalSrc
altText
}
}
}
options {
values
}
variants(first:10) {
edges {
node {
price
}
}
}
}
}
}
}
Query Variables
{
"vendor": "Liam Fashions",
"title": ""
}
When I click on the ‘run’ arrow I get a drop-down where I have to choose either the ‘Vendor’ or ‘Title’ query. It will not just run both.
I realize there might be a way to do this programmatically, but maybe not, is this a GraphQL limitation? I was hoping I could solve it with aliases, but that did not work.
Also, I cannot, no matter what I try, I cannot filter on variant price, or any other variant property. If there was any other way to flatten this schema, I would just give up on trying to use the variant property altogether. It’s just too aggravating. But I don’t see any other more easily accessible properties that do the same thing???
Why did Shopify make the schema so jiggy jaggy??? And then take away Explorer??? That stupid ‘Docs’ sidebar is almost like not having any help at all! It’s like, “Hey that’s a String! That’s Money!” OK, thanks! How do I use it? No? Not gonna connect those dots whatsoever, eh? Well OK then… ![]()
Sorry. Just frustrated again… ![]()
…
