Generate Records › hasuraRepro.re › output [@ocaml.ppx.context { tool_name: \"migrate_driver\", include_dirs: [], load_path: [], open_modules: [], for_package: None, debug: false, use_threads: false, use_vmthreads: false, recursive_types: false, principal: false, transparent_modules: false, unboxed_types: false, unsafe_string: false, cookies: [], } ]; module Dog: { [@ocaml.warning \"-32\"]; module Raw: { type t = {name: string}; type nonrec t_Dog = t; }; type t = {name: string}; type nonrec t_Dog = t; /** the GraphQL fragment */ let query: string; /** Parse the raw JSON-compatible GraphQL data into ReasonML data types */ let parse: Raw.t => t; /** Serialize the ReasonML GraphQL data that was parsed using the parse function back to the original JSON-compatible data */ let serialize: t => Raw.t; let verifyArgsAndParse: (~fragmentName: [ | `Dog], Raw.t) => t; let verifyName: [ | `Dog] => unit; external unsafe_fromJson: Js.Json.t => Raw.t = \"%identity\"; external toJson: Raw.t => Js.Json.t = \"%identity\"; } = { [@ocaml.warning \"-32\"]; module Raw = { type t = {name: string}; type nonrec t_Dog = t; }; type t = {name: string}; type nonrec t_Dog = t; let query = \"fragment Dog on Dog {\\nname \\n}\\n\"; let parse: Raw.t => t = (value) => ( { name: { let value = (value: Raw.t).name; value; }, }: t ); let serialize: t => Raw.t = (value) => ( { let name = { let value = (value: t).name; value; }; {name: name}; }: Raw.t ); let verifyArgsAndParse = (~fragmentName as _Dog: [ | `Dog], value: Raw.t) => parse(value); let verifyName = fun | `Dog => (); external unsafe_fromJson: Js.Json.t => Raw.t = \"%identity\"; external toJson: Raw.t => Js.Json.t = \"%identity\"; }; module HasuraRepro: { module Raw: { type t = {hasuraRepro: Dog.Raw.t}; type t_variables = { blockNumber: Js.Nullable.t(int), [@bs.as \"type\"] type_: Js.Nullable.t(string), }; }; type t = {hasuraRepro: Dog.t}; type t_variables = { blockNumber: option(int), [@bs.as \"type\"] type_: option(string), }; /** The GraphQL query */ let query: string; /** Parse the JSON-compatible GraphQL data to ReasonML data types */ let parse: Raw.t => t; /** Serialize the ReasonML GraphQL data that was parsed using the parse function back to the original JSON compatible data */ let serialize: t => Raw.t; let serializeVariables: t_variables => Raw.t_variables; let makeVariables: (~blockNumber: int=?, ~type_: string=?, unit) => t_variables; let makeDefaultVariables: unit => t_variables; external unsafe_fromJson: Js.Json.t => Raw.t = \"%identity\"; external toJson: Raw.t => Js.Json.t = \"%identity\"; external variablesToJson: Raw.t_variables => Js.Json.t = \"%identity\"; } = { [@ocaml.warning \"-32\"]; module Raw = { type t = {hasuraRepro: Dog.Raw.t}; type t_variables = { blockNumber: Js.Nullable.t(int), [@bs.as \"type\"] type_: Js.Nullable.t(string), }; }; type t = {hasuraRepro: Dog.t}; type t_variables = { blockNumber: option(int), [@bs.as \"type\"] type_: option(string), }; let query = \"query HasuraRepro($blockNumber: Int, $type: String) {\\nhasuraRepro(orderBy: [{id: desc}], block: {number: $blockNumber, type: $type}) {\\n...Dog \\n}\\n\\n}\\n\" ++ Dog.query; let parse: Raw.t => t = (value) => ( { hasuraRepro: { let value = (value: Raw.t).hasuraRepro; Dog.verifyArgsAndParse(~fragmentName=`Dog, value); }, }: t ); let serialize: t => Raw.t = (value) => ( { let hasuraRepro = { let value = (value: t).hasuraRepro; Dog.serialize(value); }; {hasuraRepro: hasuraRepro}; }: Raw.t ); let serializeVariables: t_variables => Raw.t_variables = inp => { blockNumber: ( a => switch (a) { | None => Js.Nullable.undefined | Some(b) => Js.Nullable.return((a => a)(b)) } )( (inp: t_variables).blockNumber, ), type_: ( a => switch (a) { | None => Js.Nullable.undefined | Some(b) => Js.Nullable.return((a => a)(b)) } )( (inp: t_variables).type_, ), }; let makeVariables = (~blockNumber=?, ~type_=?, ()): t_variables => { blockNumber, type_, }; let makeDefaultVariables = () => makeVariables(); external unsafe_fromJson: Js.Json.t => Raw.t = \"%identity\"; external toJson: Raw.t => Js.Json.t = \"%identity\"; external variablesToJson: Raw.t_variables => Js.Json.t = \"%identity\"; }; HasuraRepro.makeVariables(~blockNumber=1, ~type_=\"1\", ());