From 475d9c98e8281e62e3566671bb6ddb1d028b543f Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 21 Aug 2023 10:47:38 +0100 Subject: [PATCH] fix(Shopify Node): Fix pagination when using options (#6972) --- .../nodes-base/nodes/Shopify/GenericFunctions.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/nodes-base/nodes/Shopify/GenericFunctions.ts b/packages/nodes-base/nodes/Shopify/GenericFunctions.ts index 5224665e7b..36bdc03fa3 100644 --- a/packages/nodes-base/nodes/Shopify/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Shopify/GenericFunctions.ts @@ -64,6 +64,20 @@ export async function shopifyApiRequest( delete options.qs; } + // Only limit and fields are allowed for page_info links + // https://shopify.dev/docs/api/usage/pagination-rest#limitations-and-considerations + if (uri && uri.includes('page_info')) { + options.qs = {}; + + if (query.limit) { + options.qs.limit = query.limit; + } + + if (query.fields) { + options.qs.fields = query.fields; + } + } + return this.helpers.requestWithAuthentication.call(this, credentialType, options, { oauth2: oAuth2Options, });