Hi @exAspArk! Thank you for your great work regarding the GraphQL stuff!
I've been trying to add this gem in combination with your other gem https://github.com/exAspArk/batch-loader but don't have much luck. The errors that are supposed to be rescued just get propagated.
It works well with fields that don't have batch loaders, the ones that have just propagate the error and it never gets rescued.
Looking at this code:
def instrument(_type, field)
old_resolve_proc = field.resolve_proc
new_resolve_proc = ->(object, arguments, context) do
begin
old_resolve_proc.call(object, arguments, context)
rescue => exception
if handler = find_handler(exception)
handler.call(exception, object, arguments, context)
else
raise exception
end
end
end
field.redefine { resolve(new_resolve_proc) }
end
In the begin rescue block, without the batch loader, the error gets raised and it gets rescued perfectly fine.
With the batch loader, the old_resolve_proc.call(object, arguments, context) just returns an instance of the batch loader and that is it (the error gets raised elsewhere later on).
Have you encountered this error so far?
Hi @exAspArk! Thank you for your great work regarding the GraphQL stuff!
I've been trying to add this gem in combination with your other gem https://github.com/exAspArk/batch-loader but don't have much luck. The errors that are supposed to be rescued just get propagated.
It works well with fields that don't have batch loaders, the ones that have just propagate the error and it never gets rescued.
Looking at this code:
In the begin rescue block, without the batch loader, the error gets raised and it gets rescued perfectly fine.
With the batch loader, the
old_resolve_proc.call(object, arguments, context)just returns an instance of the batch loader and that is it (the error gets raised elsewhere later on).Have you encountered this error so far?