Skip to content

Commit

Permalink
Merge pull request #495 from Shopify/fix_gql_client_build_issue
Browse files Browse the repository at this point in the history
Fix bug in GraphQL query method argument name
  • Loading branch information
paulomarg authored Nov 21, 2023
2 parents 2c63d18 + 73085f2 commit 2dec481
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/calm-rocks-accept.md
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
});
Expand Down

0 comments on commit 2dec481

Please sign in to comment.