Replies: 1 comment
-
As far as I understand, It is not possible to use But there is alternatives, that work outside of graphQL, e.g. https://github.com/exAspArk/batch-loader |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've arrived at a few key concepts on how a GraphQL architecture should be structured in the context of a Rails application. Things like thin Rails models focused on persistence, thin graph type definition layer that calls into a business layer, single source of truth for authorization outside of graph layer, etc.
This is all nice until I bring dataloaders into the mix. Without batch loaders like
GraphQL::Batch
andGraphQL::Dataloader
, a graph API won't scale. The problem is these concepts seem to be very coupled to GraphQL. In fact I don't think it's possible to use either of these constructs outside of GraphQL execution.So I'd love to learn how others build their business layer with data loaders, that remains agnostic to the caller/execution context, whether that's GraphQL, a Sidekiq worker, or some other Rails controller.
Beta Was this translation helpful? Give feedback.
All reactions