I’m trying to look up an order by name, this is my code
# Get an order by order name field
query = ShopifyAPI::GraphQL.client.parse <<-'GRAPHQL'
query($query: String) {
orders(first: 1, query: $query) {
edges {
node {
id
name
createdAt
}
}
}
}
GRAPHQL
variables = {
query: "name:2456"
}
result = ShopifyAPI::GraphQL.client.query(query)
It should return the order passed in the variables, but instead returns the very first order in the database.
What am I doing wrong here?