We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I've used the pnpm patch for now, since we use rescript-relay V2 anyways. But maybe it may be added to V3:
pnpm patch
rescript-relay
/src/RescriptRelay.res @@ -587,16 +587,18 @@ module Store = { } module RequiredFieldLogger = { - type kind = [#"missing_field.log" | #"missing_field.throw"] - - type arg = {"kind": kind, "owner": string, "fieldPath": string} - - type js = arg => unit - - type t = (~kind: kind, ~owner: string, ~fieldPath: string) => unit - - let toJs: t => js = f => arg => - f(~kind=arg["kind"], ~owner=arg["owner"], ~fieldPath=arg["fieldPath"]) + @tag("kind") + type arg = + | @as("missing_field.log") MissingFieldLog({owner: string, fieldPath: string}) + | @as("missing_field.throw") MissingFieldThrow({owner: string, fieldPath: string}) + | @as("relay_resolver.error") + RelayResolverError({ + owner: string, + fieldPath: string, + error: Js.Exn.t, + }) + + type t = arg => unit } module Environment = { @@ -612,7 +614,7 @@ module Environment = { treatMissingFieldsAsNull: bool, missingFieldHandlers: array<MissingFieldHandler.t>, @optional - requiredFieldLogger: RequiredFieldLogger.js, + requiredFieldLogger: RequiredFieldLogger.t, @optional isServer: bool, } @@ -640,7 +642,7 @@ module Environment = { | Some(handlers) => handlers->Belt.Array.concat([nodeInterfaceMissingFieldHandler]) | None => [nodeInterfaceMissingFieldHandler] }, - ~requiredFieldLogger=?requiredFieldLogger->Belt.Option.map(RequiredFieldLogger.toJs), + ~requiredFieldLogger?, ~isServer?, (), ), /src/RescriptRelay.resi @@ -729,10 +729,19 @@ module Disposable: { /**A required field logger, which gets called when a field annotated with the @required directive was missing from the response*/ module RequiredFieldLogger: { - type kind = [#"missing_field.log" | #"missing_field.throw"] + @tag("kind") + type arg = + | @as("missing_field.log") MissingFieldLog({owner: string, fieldPath: string}) + | @as("missing_field.throw") MissingFieldThrow({owner: string, fieldPath: string}) + | @as("relay_resolver.error") + RelayResolverError({ + owner: string, + fieldPath: string, + error: Js.Exn.t, + }) /**A required field logger, which gets called when a field annotated with the @required directive was missing from the response*/ - type t = (~kind: kind, ~owner: string, ~fieldPath: string) => unit + type t = arg => unit }
The text was updated successfully, but these errors were encountered:
PR definitely welcome!
Sorry, something went wrong.
@DZakh PR? ;)
We are still on V2, but I can prepare it during the week
No branches or pull requests
I've used the
pnpm patch
for now, since we userescript-relay
V2 anyways. But maybe it may be added to V3:The text was updated successfully, but these errors were encountered: