Skip to content

Commit

Permalink
fix: wrap fragment parse & serialize as uncurried
Browse files Browse the repository at this point in the history
resolves #296

the module signature was not wrapped, and the implementation was wrapped
in another fun that prevented the match in wrap_as_uncurried_fn from
working as intended

I also fixed a warning 53 with the @@tailcall attribute I was getting
for ocaml 5.1.1, maybe I ended up with different versions of something?

re-run tests
  • Loading branch information
illusionalsagacity committed Oct 16, 2024
1 parent bde4c9c commit 24dc054
Show file tree
Hide file tree
Showing 61 changed files with 3,504 additions and 3,918 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ _esy
.merlin
node_modules
_build
_opam
_release
*.byte
*.native
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,60 +49,56 @@ lastname

}
"
let parse = (
(value): t => {
user: {
let value = (value: Raw.t).user
(
{
id: {
let value = (value: Raw.t_user).id
value
},
firstname: {
let value = (value: Raw.t_user).firstname
switch Js.toOption(value) {
| Some(value) => Some(value)
| None => None
}
},
lastname: {
let value = (value: Raw.t_user).lastname
value
},
}: t_user
)
},
}: Raw.t => t
)
let serialize = (
(value): Raw.t => {
let user = {
let value = (value: t).user
(
{
let lastname = {
let value = (value: t_user).lastname
value
let parse = (value): t => {
user: {
let value = (value: Raw.t).user
(
{
id: {
let value = (value: Raw.t_user).id
value
},
firstname: {
let value = (value: Raw.t_user).firstname
switch Js.toOption(value) {
| Some(value) => Some(value)
| None => None
}
and firstname = {
let value = (value: t_user).firstname
switch value {
| Some(value) => Js.Nullable.return(value)
| None => Js.Nullable.null
}
}
and id = {
let value = (value: t_user).id
value
},
lastname: {
let value = (value: Raw.t_user).lastname
value
},
}: t_user
)
},
}
let serialize = (value): Raw.t => {
let user = {
let value = (value: t).user
(
{
let lastname = {
let value = (value: t_user).lastname
value
}
and firstname = {
let value = (value: t_user).firstname
switch value {
| Some(value) => Js.Nullable.return(value)
| None => Js.Nullable.null
}
{id, firstname, lastname}
}: Raw.t_user
)
}
{user: user}
}: t => Raw.t
)
}
and id = {
let value = (value: t_user).id
value
}
{id, firstname, lastname}
}: Raw.t_user
)
}
{user: user}
}
let verifyArgsAndParse = (
~userId as _userId: [#NonNull_String],
~fragmentName as _UserData: [#UserData],
Expand Down
Loading

0 comments on commit 24dc054

Please sign in to comment.