Conversation
|
Oh brilliant, it's not working with Graphql Ruby 1.7... |
| @@ -46,26 +53,6 @@ | |||
| query QueryType | |||
| mutation MutationType | |||
There was a problem hiding this comment.
@DamirSvrtan I know why. I forgot to add use BatchLoader::GraphQL in the GraphQL 1.7 schema in this PR #13, my bad. Took me a while to debug and understand why it fails :)
There was a problem hiding this comment.
Brilliant, thanks for the help! I'll add it!
There was a problem hiding this comment.
One interesting thought dough - if you forgot to add use BatchLoader::GraphQL, then it was resolved as a regular field, right? Shouldn't it then be caught by the normal field resolve proc?
There was a problem hiding this comment.
Yeah, good question. It should but, unfortunately, it fails somewhere on the GraphQL-Ruby level when it tries to detect whether the object is lazy or not. And when it performs the check, BatchLoader is being resolved with an exception somewhere outside GraphQL instruments. I.e. devs should handle the exception in the BatchLoader itself in this case or improve the instrospection in GraphQL-Ruby (when it checks a lazyness)
|
|
||
| private | ||
|
|
||
| def wrap_proc(object, arguments, context, old_resolve_proc) |
There was a problem hiding this comment.
😻
we might want to rename old_resolve_proc arg to something else (proc, old_proc, etc.) to avoid any confusions (old_resolve_proc vs old_lazy_resolve_proc)
|
@exAspArk I've updated the PR! |
|
Released in |
As commented in #12, I've added work on top of your PR #13 .
Let me know if that looks good to you!