I have a embeded using the turbolinks template, I am using shopify_app gem 20.1 and I am trying to filter the products from shopify by the product title (I am basically doing a typeahead search so I want to get products that matches an specific term in the product title), long time ago (with shopify-app gem ‘12.0.7’) I was able to do that by calling:
Product.where(title: query)
But looks like that’s not possible anymore, and I have to use GraphQL, so I tried this (taken from https://shopify.github.io/shopify-api-ruby/usage/graphql.html ![]()
session = ShopifyAPI::Utils::SessionUtils.load_current_session(
auth_header: request.headers["Authorization"],
cookies: request.headers['cookies'],
is_online: true
)
client = ShopifyAPI::Clients::Graphql::Admin.new(session: session)
query = <<~QUERY
{
products(first: 10, query: "title: *'Test'*") {
edges {
node {
id
productType
title
vendor
featuredImage {
src
}
images(first: 1) {
edges {
node {
src
}
}
}
}
}
}
}
QUERY
I am able to see the results of the query, meaning it all wente well, but on a next attempt I get the following error:
ShopifyApp::JWT] Failed to validate JWT: [JWT::ExpiredSignature] Signature has expired
Any idea why is this?