From d8f843657e6fb9419843f89ebc44c8e6ad12cf71 Mon Sep 17 00:00:00 2001 From: Paulo Margarido <64600052+paulomarg@users.noreply.github.com> Date: Wed, 24 Jan 2024 10:38:29 -0500 Subject: [PATCH] Replace query() call with request() --- .changeset/polite-birds-unite.md | 5 +++++ .../src/middlewares/has-valid-access-token.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/polite-birds-unite.md diff --git a/.changeset/polite-birds-unite.md b/.changeset/polite-birds-unite.md new file mode 100644 index 0000000000..abe6780eff --- /dev/null +++ b/.changeset/polite-birds-unite.md @@ -0,0 +1,5 @@ +--- +'@shopify/shopify-app-express': patch +--- + +Replaced query() internal call in the GraphQL client with request() diff --git a/packages/shopify-app-express/src/middlewares/has-valid-access-token.ts b/packages/shopify-app-express/src/middlewares/has-valid-access-token.ts index 795e71f6de..a033cf3500 100644 --- a/packages/shopify-app-express/src/middlewares/has-valid-access-token.ts +++ b/packages/shopify-app-express/src/middlewares/has-valid-access-token.ts @@ -12,7 +12,7 @@ export async function hasValidAccessToken( ): Promise { try { const client = new api.clients.Graphql({session}); - await client.query({data: TEST_GRAPHQL_QUERY}); + await client.request(TEST_GRAPHQL_QUERY); return true; } catch (error) { if (error instanceof HttpResponseError && error.response.code === 401) {