diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+# v1.2.4
+
+* Fix ambiguous field name error with same argument name in multiple queries ([#86](https://github.com/brandonchinn178/graphql-client/issues/86))
+
 # v1.2.3
 
 * Add support for GHC 9.8
diff --git a/graphql-client.cabal b/graphql-client.cabal
--- a/graphql-client.cabal
+++ b/graphql-client.cabal
@@ -5,7 +5,7 @@
 -- see: https://github.com/sol/hpack
 
 name:           graphql-client
-version:        1.2.3
+version:        1.2.4
 synopsis:       A client for Haskell programs to query a GraphQL API
 description:    A client for Haskell programs to query a GraphQL API.
 category:       Graphql
@@ -19,6 +19,12 @@
 extra-source-files:
     README.md
     CHANGELOG.md
+    test/Data/GraphQL/Test/Generation/run.sh
+    test/Data/GraphQL/Test/Generation/src/Example/Scalars.hs
+    test/Data/GraphQL/Test/Generation/queries/basic.graphql
+    test/Data/GraphQL/Test/Generation/queries/duplicate-names.graphql
+    test/Data/GraphQL/Test/Generation/schema.graphql
+    test/Data/GraphQL/Test/Generation/codegen.yml
     ./js/graphql-codegen-haskell.js
     ./js/graphql-codegen-haskell-fallback.js
     ./js/mocks/__utils.js
@@ -64,11 +70,11 @@
   ghc-options: -Wall -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wnoncanonical-monad-instances -Wunused-packages
   build-depends:
       base <5
-    , bytestring <0.12
+    , bytestring <0.13
     , file-embed <0.1
     , optparse-applicative <0.19
     , path <0.10
-    , path-io <2
+    , path-io >=1.3.3 && <2
     , template-haskell <3
     , typed-process <0.3
   default-language: Haskell2010
@@ -77,6 +83,7 @@
   type: exitcode-stdio-1.0
   main-is: Main.hs
   other-modules:
+      Data.GraphQL.Test.Generation.TestGeneration
       Data.GraphQL.Test.Monad.Class
       Data.GraphQL.Test.TestQuery
       Data.GraphQL.Test.TestUtils
@@ -90,6 +97,7 @@
     , base
     , graphql-client
     , mtl
+    , process
     , tasty
     , tasty-hunit
   default-language: Haskell2010
diff --git a/js/graphql-codegen-haskell.js b/js/graphql-codegen-haskell.js
--- a/js/graphql-codegen-haskell.js
+++ b/js/graphql-codegen-haskell.js
@@ -53376,7 +53376,7 @@
 })));
 });
 
-var template = "{- This file was automatically generated and should not be edited. -}\n\n{-# LANGUAGE DataKinds #-}\n{-# LANGUAGE DuplicateRecordFields #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE QuasiQuotes #-}\n{-# LANGUAGE TypeFamilies #-}\n{-# OPTIONS_GHC -w #-}\n\nmodule {{apiModule}} where\n\nimport Data.GraphQL\nimport Data.GraphQL.Bootstrap\n\nimport {{scalarsModule}}\n{{#enumModules}}\nimport {{.}}\n{{/enumModules}}\n\n{{#operations}}\n{-----------------------------------------------------------------------------\n-- {{name}}\n\n-- result :: Object {{schemaType}}; throws a GraphQL exception on errors\nresult <- runQuery {{queryName}}\n  {{#overArgs}}\n  { _{{arg}} = ...\n  {{/overArgs}}\n  }\n\n-- result :: GraphQLResult (Object {{schemaType}})\nresult <- runQuerySafe {{queryName}}\n  {{#overArgs}}\n  { _{{arg}} = ...\n  {{/overArgs}}\n  }\n-----------------------------------------------------------------------------}\n\ndata {{queryName}} = {{queryName}}\n  {{#overArgs}}\n  { _{{arg}} :: {{type}}\n  {{/overArgs}}\n  }\n  deriving (Show)\n\ntype {{schemaType}} = [schema|\n  {{schema}}\n|]\n\ninstance GraphQLQuery {{queryName}} where\n  type ResultSchema {{queryName}} = {{schemaType}}\n\n  getQueryName _ = \"{{name}}\"\n\n  getQueryText _ = [query|\n    {{queryText}}\n  |]\n\n  getArgs query = object\n    {{#overArgs}}\n    [ \"{{arg}}\" .= _{{arg}} (query :: {{queryName}})\n    {{/overArgs}}\n    ]\n\n{{/operations}}\n";
+var template = "{- This file was automatically generated and should not be edited. -}\n\n{-# LANGUAGE DataKinds #-}\n{-# LANGUAGE DuplicateRecordFields #-}\n{-# LANGUAGE OverloadedStrings #-}\n{-# LANGUAGE QuasiQuotes #-}\n{-# LANGUAGE RecordWildCards #-}\n{-# LANGUAGE TypeFamilies #-}\n{-# OPTIONS_GHC -w #-}\n\nmodule {{apiModule}} where\n\nimport Data.GraphQL\nimport Data.GraphQL.Bootstrap\n\nimport {{scalarsModule}}\n{{#enumModules}}\nimport {{.}}\n{{/enumModules}}\n\n{{#operations}}\n{-----------------------------------------------------------------------------\n-- {{name}}\n\n-- result :: Object {{schemaType}}; throws a GraphQL exception on errors\nresult <- runQuery {{queryName}}\n  {{#overArgs}}\n  { _{{arg}} = ...\n  {{/overArgs}}\n  }\n\n-- result :: GraphQLResult (Object {{schemaType}})\nresult <- runQuerySafe {{queryName}}\n  {{#overArgs}}\n  { _{{arg}} = ...\n  {{/overArgs}}\n  }\n-----------------------------------------------------------------------------}\n\ndata {{queryName}} = {{queryName}}\n  {{#overArgs}}\n  { _{{arg}} :: {{type}}\n  {{/overArgs}}\n  }\n  deriving (Show)\n\ntype {{schemaType}} = [schema|\n  {{schema}}\n|]\n\ninstance GraphQLQuery {{queryName}} where\n  type ResultSchema {{queryName}} = {{schemaType}}\n\n  getQueryName _ = \"{{name}}\"\n\n  getQueryText _ = [query|\n    {{queryText}}\n  |]\n\n  getArgs {{queryName}}{{argsRecordSyntax}} = object\n    {{#overArgs}}\n    [ \"{{arg}}\" .= _{{arg}}\n    {{/overArgs}}\n    ]\n\n{{/operations}}\n";
 
 // globally disable html-escaping
 mustache.escape = function (x) { return x; };
@@ -53392,7 +53392,10 @@
                 return function (text) {
                     return templateOverList(text, _this.args, { context: _this });
                 };
-            } })); }) }));
+            }, 
+            // `X{..}` is not valid in GHC < 9.8 if constructor has no fields
+            // https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0496-empty-record-wildcards.rst
+            argsRecordSyntax: operation.args.length === 0 ? '{}' : '{..}' })); }) }));
 };
 var renderHaskellType = function (type) {
     var baseType = type.list
diff --git a/test/Data/GraphQL/Test/Generation/TestGeneration.hs b/test/Data/GraphQL/Test/Generation/TestGeneration.hs
new file mode 100644
--- /dev/null
+++ b/test/Data/GraphQL/Test/Generation/TestGeneration.hs
@@ -0,0 +1,18 @@
+module Data.GraphQL.Test.Generation.TestGeneration (testGeneration) where
+
+import System.Exit (ExitCode (..))
+import System.Process (readProcessWithExitCode)
+import Test.Tasty
+import Test.Tasty.HUnit
+
+testGeneration :: TestTree
+testGeneration =
+  testCase "Test generated code" $ do
+    (code, _, _) <- readProcessWithExitCode "bash" ["test/Data/GraphQL/Test/Generation/run.sh", logFile] ""
+    case code of
+      ExitSuccess -> pure ()
+      ExitFailure _ -> do
+        output <- readFile logFile
+        assertFailure $ "===== Test failed. Output: =====\n" <> output
+  where
+    logFile = "/tmp/graphql-client-generation-test.log"
diff --git a/test/Data/GraphQL/Test/Generation/codegen.yml b/test/Data/GraphQL/Test/Generation/codegen.yml
new file mode 100644
--- /dev/null
+++ b/test/Data/GraphQL/Test/Generation/codegen.yml
@@ -0,0 +1,7 @@
+schema: schema.graphql
+documents: queries/*.graphql
+
+hsSourceDir: gen/
+apiModule: Example.API
+enumsModule: Example.Enums
+scalarsModule: Example.Scalars
diff --git a/test/Data/GraphQL/Test/Generation/queries/basic.graphql b/test/Data/GraphQL/Test/Generation/queries/basic.graphql
new file mode 100644
--- /dev/null
+++ b/test/Data/GraphQL/Test/Generation/queries/basic.graphql
@@ -0,0 +1,8 @@
+query getUsers {
+  users {
+    id
+    name
+    age
+    gender
+  }
+}
diff --git a/test/Data/GraphQL/Test/Generation/queries/duplicate-names.graphql b/test/Data/GraphQL/Test/Generation/queries/duplicate-names.graphql
new file mode 100644
--- /dev/null
+++ b/test/Data/GraphQL/Test/Generation/queries/duplicate-names.graphql
@@ -0,0 +1,11 @@
+query getAge($name: String!) {
+  userByName(name: $name) {
+    age
+  }
+}
+
+query getGender($name: String!) {
+  userByName(name: $name) {
+    gender
+  }
+}
diff --git a/test/Data/GraphQL/Test/Generation/run.sh b/test/Data/GraphQL/Test/Generation/run.sh
new file mode 100644
--- /dev/null
+++ b/test/Data/GraphQL/Test/Generation/run.sh
@@ -0,0 +1,24 @@
+#!/usr/bin/env bash
+#
+# Run the test, called in TestGeneration.hs
+
+set -eux -o pipefail
+
+builtin cd "$(dirname "${BASH_SOURCE}")"
+
+LOG_FILE=$1
+exec &> "${LOG_FILE}"
+
+graphql-codegen
+
+cat "${GHC_ENVIRONMENT}"
+
+ghc \
+    -v \
+    --make \
+    -odir gen/out/ \
+    -hidir gen/out/ \
+    -isrc:gen \
+    Example.Scalars \
+    Example.Enums.Gender \
+    Example.API
diff --git a/test/Data/GraphQL/Test/Generation/schema.graphql b/test/Data/GraphQL/Test/Generation/schema.graphql
new file mode 100644
--- /dev/null
+++ b/test/Data/GraphQL/Test/Generation/schema.graphql
@@ -0,0 +1,20 @@
+type Query {
+    users: [User]
+    user(id: ID!): User
+    userByName(name: String!): User
+}
+
+type User {
+  id: ID!
+  name: String!
+  age: Age
+  gender: Gender
+}
+
+scalar Age
+
+enum Gender {
+  MALE
+  FEMALE
+  OTHER
+}
diff --git a/test/Data/GraphQL/Test/Generation/src/Example/Scalars.hs b/test/Data/GraphQL/Test/Generation/src/Example/Scalars.hs
new file mode 100644
--- /dev/null
+++ b/test/Data/GraphQL/Test/Generation/src/Example/Scalars.hs
@@ -0,0 +1,16 @@
+module Example.Scalars where
+
+import Control.Monad (guard)
+import Data.Aeson (FromJSON (..), ToJSON (..))
+
+newtype Age = Age Int
+  deriving (Show)
+
+instance FromJSON Age where
+  parseJSON v = do
+    n <- parseJSON v
+    guard $ n >= 0
+    pure $ Age n
+
+instance ToJSON Age where
+  toJSON (Age n) = toJSON n
diff --git a/test/Main.hs b/test/Main.hs
--- a/test/Main.hs
+++ b/test/Main.hs
@@ -1,5 +1,6 @@
 import Test.Tasty (defaultMain, testGroup)
 
+import Data.GraphQL.Test.Generation.TestGeneration
 import Data.GraphQL.Test.Monad.Class
 import Data.GraphQL.Test.TestUtils
 
@@ -10,4 +11,5 @@
       "graphql-client"
       [ testRunQuery
       , testTestUtils
+      , testGeneration
       ]
