You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When i make a GraphQL query to retrieve orders with a query filter on tag, it returns no results. Using the same query in the Shopify GraphQL app in the store returns results. Removing the query:"tag:Ship" from query results in orders being returned.
importexpressfrom"express";importshopifyfrom"../shopify.js";constORDERS_QUERY=`query { orders(first:100, query:"tag:Ship") { edges { node { id name tags } } }} `;exportdefaultfunctionapplyOrdersApiEndpoints(app){app.use(express.json());app.get("/api/weekorders",async(req,res)=>{constclient=newshopify.api.clients.Graphql({session: res.locals.shopify.session,});constorders=awaitclient.query({data: {query: ORDERS_QUERY},});res.send(orders.body.data);});}
app setup in shopify.js (unchanged from QR Code example app):
import{LATEST_API_VERSION}from"@shopify/shopify-api";import{shopifyApp}from"@shopify/shopify-app-express";import{LogSeverity}from"@shopify/shopify-api"import{SQLiteSessionStorage}from"@shopify/shopify-app-session-storage-sqlite";import{restResources}from"@shopify/shopify-api/rest/admin/2023-01";importsqlite3from"sqlite3";import{join}from"path";import{QRCodesDB}from"./qr-codes-db.js";constdatabase=newsqlite3.Database(join(process.cwd(),"database.sqlite"));// Initialize SQLite DBQRCodesDB.db=database;QRCodesDB.init();constshopify=shopifyApp({api: {apiVersion: LATEST_API_VERSION,
restResources,billing: undefined,// or replace with billingConfig above to enable example billinglogger: {level: LogSeverity.Debug,httpRequests: true,// if the error seems to be related to requests}},auth: {path: "/api/auth",callbackPath: "/api/auth/callback",},webhooks: {path: "/api/webhooks",},sessionStorage: newSQLiteSessionStorage(database),});exportdefaultshopify;
Issue summary
When i make a GraphQL query to retrieve orders with a query filter on tag, it returns no results. Using the same query in the Shopify GraphQL app in the store returns results. Removing the
query:"tag:Ship"
from query results in orders being returned.My code was adapted from the QR Code example app - https://shopify.dev/docs/apps/getting-started/build-app-example
My code adds a new endpoint middleware to express and makes a simple graphql query -
app setup in
shopify.js
(unchanged from QR Code example app):@shopify/shopify-app-*
package and version:Expected behavior
The GraphQL query should return orders tagged with 'Ship'
Actual behavior
No results are returned
Steps to reproduce the problem
Run the query above using the GraphQL client as shown above
The text was updated successfully, but these errors were encountered: