Skip to content

Commit df525b0

Browse files
authored
Merge pull request #159 from OxfordAbstracts/var-type-checking-158
check var types
2 parents 81d2c4c + 48f9624 commit df525b0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/GraphQL/Client/Variables.purs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ class VarsTypeChecked schema query where
213213
instance varsTypeCheckedWithVars ::
214214
( GetGqlQueryVars schema query { | gqlVars }
215215
, HFoldlWithIndex (CombineVarsProp { | gqlVars }) GqlQueryVarsN { | vars } GqlQueryVarsN
216+
, GetVar query {| vars}
216217
) =>
217218
VarsTypeChecked schema (WithVars query { | vars }) where
218219
getVarsJson _ (WithVars encode _ vars) = encode vars

test/GraphQL/Client/Variable.Test.purs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,15 @@ spec =
3434
, orders:
3535
{ name: Var :: Var "nameVar" String } =>>
3636

37-
{ user_id: Var :: Var "myOtherVar" Int }
37+
{ user_id: unit }
3838
}
3939
getVarsTypeNames testSchemaProxy
4040
( q `withVars`
4141
{ myVar: 1
4242
, nameVar: "name"
43-
, myOtherVar: 2
4443
}
4544
) `shouldEqual`
46-
"($nameVar: Name!, $myVar: customId!, $myOtherVar: UserId!)"
45+
"($nameVar: Name!, $myVar: customId!)"
4746

4847
it "should return vars for a query with vars in arrays in arguments" do
4948
let

0 commit comments

Comments
 (0)