Comments (7)
Thanks @exAspArk - came across the today and updating all our resolvers to use BatchLoader::GraphQL.for
fixed it.
from batch-loader.
Hey @JanStevens!
Thank you for sharing the link. I'll be able to take a look into it once the Interpreter
became a default runtime and became more stable (not experimental to avoid potential breaking changes in BatchLoader
).
from batch-loader.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
from batch-loader.
@exAspArk, does this work now? I mean, we're just starting to use this gem on a grapqhl-ruby 1.9 project and it seems to work, but thought i'd confirm since I see nothing in the changelogs.
from batch-loader.
It seems like GraphQL::Execution::Interpreter
is now considered stable since graphql
gem version 1.10+ (January 2020). I'm reopening the issue, will try to make it work 🙏
from batch-loader.
@exAspArk, does this work now? I mean, we're just starting to use this gem on a grapqhl-ruby 1.9 project and it seems to work, but thought i'd confirm since I see nothing in the changelogs.
Long story short:
- if you use
BatchLoader::GraphQL.for
, then you're fine 👍 - if you use
BatchLoader.for
andInterpreter
, then you'd need to use #62 (draft PR) - if you use
BatchLoader.for
withoutInterpreter
, then it works with all GraphQL versions except the range between1.8.7
rmosolgo/graphql-ruby#1778 -1.8.10
#26 (comment)
I.e. please use BatchLoader::GraphQL.for
I'm going to deprecate using BatchLoader.for
in GraphQL, which adds unnecessary coupling with the graphql
gem. Alternatively, it's possible to keep BatchLoader.for
and wrap it:
field :user, UserType, null: false
def user # resolver
BatchLoader::GraphQL.wrap(lazy_user)
end
def lazy_user
BatchLoader.for...
end
from batch-loader.
I released a new version which still keeps compatibility with BatchLoader.for
+ GraphQL with Interpreter
, but adds a deprecation warning. More info in the changelog.
from batch-loader.
Related Issues (20)
- Possibility of deadlock HOT 2
- Extra computations for already loaded data happen when cache: false HOT 1
- How to get nested relation without n+1 on graphql ? HOT 4
- N+1 queries when batch loading has many association HOT 2
- Searchkick(elasticsearch) Object Associations HOT 2
- throwing undefined method `use' for BatchLoader::Middleware:Class HOT 4
- Using batch-loader to query a count of a has_many relation HOT 2
- batch-loader not working for non-nullable graphql fields, returns "Cannot return null for non-nullable field" HOT 14
- Warnings after updating to Ruby 2.7 HOT 3
- How I can filter associations values? HOT 2
- Wrong number of arguments (given 1, expected 0) HOT 6
- Loading across collections
- How to debug the code inside batch loader block HOT 1
- Erro on principal node is object
- BatchLoader::GraphQL with union type
- `BatchLoader.for().batch {}` evaluated as Truthy but should be Falsey HOT 5
- `BatchLoader::GraphQL.for` doesn't delegate missing methods as `BatchLoader.for` does
- Incompatibility with graphql-ruby 2.0.18+ HOT 4
- Why not to use `attr_accessor` for `batch_loader`? HOT 1
- Incompatibility with graphql-ruby 2.3.x HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from batch-loader.