Skip to content

Commit

Permalink
snapshot differences
Browse files Browse the repository at this point in the history
  • Loading branch information
jfrolich committed May 17, 2024
1 parent 293f248 commit 1557796
Show file tree
Hide file tree
Showing 95 changed files with 3,440 additions and 3,130 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ argNamedQuery(query: $query)
}
{argNamedQuery: argNamedQuery}
}
let serializeVariables: t_variables => Raw.t_variables = inp => {
query: (a => a)((inp: t_variables).query),
}
let serializeVariables: t_variables => Raw.t_variables = (
inp => {query: (a => a)((inp: t_variables).query)}: t_variables => Raw.t_variables
)
let makeVariables = (~query, ()): t_variables => {query: query}
external unsafe_fromJson: Js.Json.t => Raw.t = "%identity"
external toJson: Raw.t => Js.Json.t = "%identity"
Expand Down Expand Up @@ -95,9 +95,9 @@ argNamedQuery(query: $query)
}
{argNamedQuery: argNamedQuery}
}
let serializeVariables: t_variables => Raw.t_variables = inp => {
query: (a => a)((inp: t_variables).query),
}
let serializeVariables: t_variables => Raw.t_variables = (
inp => {query: (a => a)((inp: t_variables).query)}: t_variables => Raw.t_variables
)
let makeVariables = (~query, ()): t_variables => {query: query}
external unsafe_fromJson: Js.Json.t => Raw.t = "%identity"
external toJson: Raw.t => Js.Json.t = "%identity"
Expand Down Expand Up @@ -147,9 +147,9 @@ argNamedQuery(query: $query)
}
{argNamedQuery: argNamedQuery}
}
let serializeVariables: t_variables => Raw.t_variables = inp => {
query: (a => a)((inp: t_variables).query),
}
let serializeVariables: t_variables => Raw.t_variables = (
inp => {query: (a => a)((inp: t_variables).query)}: t_variables => Raw.t_variables
)
let makeVariables = (~query, ()): t_variables => {query: query}
external unsafe_fromJson: Js.Json.t => Raw.t = "%identity"
external toJson: Raw.t => Js.Json.t = "%identity"
Expand Down
184 changes: 95 additions & 89 deletions snapshot_tests/operations/expected/apollo/generate/comment.res.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,95 +90,101 @@ nonrecursiveInput(arg: $arg)
}
{nonrecursiveInput: nonrecursiveInput}
}
let rec serializeVariables: t_variables => Raw.t_variables = inp => {
arg: (a => serializeInputObjectNonrecursiveInput(a))((inp: t_variables).arg),
}
and serializeInputObjectNonrecursiveInput: t_variables_NonrecursiveInput => Raw.t_variables_NonrecursiveInput = inp => {
nonNullableField: (a => a)((inp: t_variables_NonrecursiveInput).nonNullableField),
nullableArray: (
a =>
switch a {
| None => Js.Nullable.undefined
| Some(b) =>
Js.Nullable.return(
(
a =>
Js.Array2.map(a, b =>
(
a =>
switch a {
| None => Js.Nullable.undefined
| Some(b) => Js.Nullable.return((a => a)(b))
}
)(b)
)
)(b),
)
}
)((inp: t_variables_NonrecursiveInput).nullableArray),
field: (
a =>
switch a {
| None => Js.Nullable.undefined
| Some(b) => Js.Nullable.return((a => a)(b))
}
)((inp: t_variables_NonrecursiveInput).field),
enum: (
a =>
switch a {
| None => Js.Nullable.undefined
| Some(b) =>
Js.Nullable.return(
(
a =>
switch a {
| #FIRST => "FIRST"
| #SECOND => "SECOND"
| #THIRD => "THIRD"
}
)(b),
)
}
)((inp: t_variables_NonrecursiveInput).enum),
embeddedInput: (
a =>
switch a {
| None => Js.Nullable.undefined
| Some(b) =>
Js.Nullable.return(
(
a =>
Js.Array2.map(a, b =>
(
a =>
switch a {
| None => Js.Nullable.undefined
| Some(b) =>
Js.Nullable.return((a => serializeInputObjectEmbeddedInput(a))(b))
}
)(b)
)
)(b),
)
}
)((inp: t_variables_NonrecursiveInput).embeddedInput),
custom: (
a =>
switch a {
| None => Js.Nullable.undefined
| Some(b) => Js.Nullable.return((a => a)(b))
}
)((inp: t_variables_NonrecursiveInput).custom),
}
and serializeInputObjectEmbeddedInput: t_variables_EmbeddedInput => Raw.t_variables_EmbeddedInput = inp => {
field: (
a =>
switch a {
| None => Js.Nullable.undefined
| Some(b) => Js.Nullable.return((a => a)(b))
}
)((inp: t_variables_EmbeddedInput).field),
}
let rec serializeVariables: t_variables => Raw.t_variables = (
inp => {
arg: (a => serializeInputObjectNonrecursiveInput(a))((inp: t_variables).arg),
}: t_variables => Raw.t_variables
)
and serializeInputObjectNonrecursiveInput: t_variables_NonrecursiveInput => Raw.t_variables_NonrecursiveInput = (
inp => {
nonNullableField: (a => a)((inp: t_variables_NonrecursiveInput).nonNullableField),
nullableArray: (
a =>
switch a {
| None => Js.Nullable.undefined
| Some(b) =>
Js.Nullable.return(
(
a =>
Js.Array2.map(a, b =>
(
a =>
switch a {
| None => Js.Nullable.undefined
| Some(b) => Js.Nullable.return((a => a)(b))
}
)(b)
)
)(b),
)
}
)((inp: t_variables_NonrecursiveInput).nullableArray),
field: (
a =>
switch a {
| None => Js.Nullable.undefined
| Some(b) => Js.Nullable.return((a => a)(b))
}
)((inp: t_variables_NonrecursiveInput).field),
enum: (
a =>
switch a {
| None => Js.Nullable.undefined
| Some(b) =>
Js.Nullable.return(
(
a =>
switch a {
| #FIRST => "FIRST"
| #SECOND => "SECOND"
| #THIRD => "THIRD"
}
)(b),
)
}
)((inp: t_variables_NonrecursiveInput).enum),
embeddedInput: (
a =>
switch a {
| None => Js.Nullable.undefined
| Some(b) =>
Js.Nullable.return(
(
a =>
Js.Array2.map(a, b =>
(
a =>
switch a {
| None => Js.Nullable.undefined
| Some(b) =>
Js.Nullable.return((a => serializeInputObjectEmbeddedInput(a))(b))
}
)(b)
)
)(b),
)
}
)((inp: t_variables_NonrecursiveInput).embeddedInput),
custom: (
a =>
switch a {
| None => Js.Nullable.undefined
| Some(b) => Js.Nullable.return((a => a)(b))
}
)((inp: t_variables_NonrecursiveInput).custom),
}: t_variables_NonrecursiveInput => Raw.t_variables_NonrecursiveInput
)
and serializeInputObjectEmbeddedInput: t_variables_EmbeddedInput => Raw.t_variables_EmbeddedInput = (
inp => {
field: (
a =>
switch a {
| None => Js.Nullable.undefined
| Some(b) => Js.Nullable.return((a => a)(b))
}
)((inp: t_variables_EmbeddedInput).field),
}: t_variables_EmbeddedInput => Raw.t_variables_EmbeddedInput
)
let makeVariables = (~arg, ()): t_variables => {arg: arg}
and makeInputObjectNonrecursiveInput = (
~nonNullableField,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,18 @@ nonNullable
}
{customScalarField: customScalarField}
}
let serializeVariables: t_variables => Raw.t_variables = inp => {
opt: (
a =>
switch a {
| None => Js.Nullable.undefined
| Some(b) => Js.Nullable.return((a => a)(b))
}
)((inp: t_variables).opt),
req: (a => a)((inp: t_variables).req),
}
let serializeVariables: t_variables => Raw.t_variables = (
inp => {
opt: (
a =>
switch a {
| None => Js.Nullable.undefined
| Some(b) => Js.Nullable.return((a => a)(b))
}
)((inp: t_variables).opt),
req: (a => a)((inp: t_variables).req),
}: t_variables => Raw.t_variables
)
let makeVariables = (~opt=?, ~req, ()): t_variables => {opt, req}
external unsafe_fromJson: Js.Json.t => Raw.t = "%identity"
external toJson: Raw.t => Js.Json.t = "%identity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,25 @@ module NullableString = {
| Red
| Green
| Blue
let parse: option<string> => t = color =>
switch color {
| Some("green") => Green
| Some("blue") => Blue
| Some("red") => Red
| Some(_)
| None =>
Red
}
let serialize: t => option<string> = color =>
switch color {
| Red => Some("red")
| Green => Some("green")
| Blue => Some("blue")
}
let parse: option<string> => t = (
color =>
switch color {
| Some("green") => Green
| Some("blue") => Blue
| Some("red") => Red
| Some(_)
| None =>
Red
}: option<string> => t
)
let serialize: t => option<string> = (
color =>
switch color {
| Red => Some("red")
| Green => Some("green")
| Blue => Some("blue")
}: t => option<string>
)
}

module DateTime = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,18 @@ enumInput(arg: $arg)
}
{enumInput: enumInput}
}
let serializeVariables: t_variables => Raw.t_variables = inp => {
arg: (
a =>
switch a {
| #FIRST => "FIRST"
| #SECOND => "SECOND"
| #THIRD => "THIRD"
}
)((inp: t_variables).arg),
}
let serializeVariables: t_variables => Raw.t_variables = (
inp => {
arg: (
a =>
switch a {
| #FIRST => "FIRST"
| #SECOND => "SECOND"
| #THIRD => "THIRD"
}
)((inp: t_variables).arg),
}: t_variables => Raw.t_variables
)
let makeVariables = (~arg, ()): t_variables => {arg: arg}
external unsafe_fromJson: Js.Json.t => Raw.t = "%identity"
external toJson: Raw.t => Js.Json.t = "%identity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -709,15 +709,17 @@ l5: lists {
}
{l1, l2, l3, l4, l5}
}
let serializeVariables: t_variables => Raw.t_variables = inp => {
arg1: (
a =>
switch a {
| None => Js.Nullable.undefined
| Some(b) => Js.Nullable.return((a => a)(b))
}
)((inp: t_variables).arg1),
}
let serializeVariables: t_variables => Raw.t_variables = (
inp => {
arg1: (
a =>
switch a {
| None => Js.Nullable.undefined
| Some(b) => Js.Nullable.return((a => a)(b))
}
)((inp: t_variables).arg1),
}: t_variables => Raw.t_variables
)
let makeVariables = (~arg1=?, ()): t_variables => {arg1: arg1}
let makeDefaultVariables = () => makeVariables()
external unsafe_fromJson: Js.Json.t => Raw.t = "%identity"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
module Graphql_ppx_runtime = {
// mock
let assign_typename: (
Js.Json.t,
string,
) => Js.Json.t = %raw(` (obj, typename) => { obj.__typename = typename; return obj } `)
let assign_typename: (Js.Json.t, string) => Js.Json.t = (
%raw(` (obj, typename) => { obj.__typename = typename; return obj } `): (
Js.Json.t,
string,
) => Js.Json.t
)
}
module DogFragment: {
@@ocaml.warning("-32-30")
Expand Down
Loading

0 comments on commit 1557796

Please sign in to comment.