diff --git a/.changeset/calm-rocks-accept.md b/.changeset/calm-rocks-accept.md new file mode 100644 index 0000000000..8fe9a7e7d2 --- /dev/null +++ b/.changeset/calm-rocks-accept.md @@ -0,0 +1,5 @@ +--- +'@shopify/shopify-app-remix': patch +--- + +Fixing a bug in the GraphQL client that could cause specific builds to fail, because we used `query` for both the function and argument names. diff --git a/packages/shopify-app-remix/src/server/clients/admin/graphql.ts b/packages/shopify-app-remix/src/server/clients/admin/graphql.ts index aa0c16df6a..13ea7ee35c 100644 --- a/packages/shopify-app-remix/src/server/clients/admin/graphql.ts +++ b/packages/shopify-app-remix/src/server/clients/admin/graphql.ts @@ -18,7 +18,7 @@ export function graphqlClientFactory({ handleClientError, session, }: AdminClientOptions): GraphQLClient { - return async function query(query, options) { + return async function query(operation, options) { const client = new params.api.clients.Graphql({ session, apiVersion: options?.apiVersion, @@ -27,7 +27,7 @@ export function graphqlClientFactory({ try { // We convert the incoming response to a Response object to bring this client closer to the Remix client. const apiResponse = await client.query({ - data: {query, variables: options?.variables}, + data: {query: operation, variables: options?.variables}, tries: options?.tries, extraHeaders: options?.headers, });