-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
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
Ability to add errors to resolved fields #512
Ability to add errors to resolved fields #512
Conversation
Covered test case: Add additional error and return value from a non-nullable GraphQL field resolver
…ers`/`resolveWith`
6ce4185
to
8c5a23c
Compare
match ctx.Context.Errors.TryGetValue ctx with | ||
| true, errors -> | ||
errors | ||
|> Seq.map (GQLProblemDetails.OfFieldExecutionError (path |> List.rev)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You either do List.rev inside function OfFieldExecutionError or at least create function normalizedPath() = path |> List.rev somewhere
let internal normalizedPath(fieldPath : FieldPath) = | ||
fieldPath |> List.rev | ||
|
||
let internal normalizedPathToObj(fieldPath : FieldPath) = | ||
fieldPath |> List.rev |> box | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let internal normalizedPath(fieldPath : FieldPath) = | |
fieldPath |> List.rev | |
let internal normalizedPathToObj(fieldPath : FieldPath) = | |
fieldPath |> List.rev |> box | |
let internal normalizeErrorPath (fieldPath : FieldPath) = | |
fieldPath |> List.rev | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I remove normalizedPathToObj function?
Some time ago @xperiandri removed this functionality as exceptions were no longer processed anywhere.
Now I add it back aligned to the new
Result
based internal resolvers execution