graphql-batch
Interactor
Our great sponsors
graphql-batch | Interactor | |
---|---|---|
2 | 9 | |
1,286 | 3,042 | |
0.9% | 1.2% | |
4.7 | 3.6 | |
3 months ago | 3 days ago | |
Ruby | Ruby | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
graphql-batch
-
N+1 problem will never be an issue with N1Loader gem
Interesting, I've just been researching Dataloader implementations for Ruby and have between trying to decide between GraphQL::Dataloader, graphql-batch and BatchLoader. I'll give this a look as well. Can you also make API calls inside the loaders?
-
"I'm the CTO of a Growing Rails Startup" Ask Me Anything
This is mainly addressed in the last thing but we cache pretty heavily on our REST APIs and for GraphQL we use the graphql-batch gem pretty heavily. Those two things can go a long way. Make sure you're using an APM like Scout to keep an eye on things and then debug the outliers.
Interactor
-
What Would be Your Ideal Ruby Tech Stack
I see many senior Ruby developers around me going away from that magicness (like all the validations and callbacks) to move away from fat models, using libs like https://github.com/collectiveidea/interactor and have their own control.
-
Applying the Use Case Pattern with Rails
The Interactor and ActiveInteraction gems are both great libraries for implementing this pattern.
- Utilizando o padrão interactor no Ruby on Rails
-
Organizing business logic in Rails with contexts
I've used https://github.com/collectiveidea/interactor on some apps with a lot of success.
-
Single Responsibility Principal
Have a look at https://github.com/collectiveidea/interactor, they give you a new pattern that would allow you to think more in POROs and one class per responsibility. Active Record puts your head in a box where every model has to have a database table. Try to break out of that
-
"I'm the CTO of a Growing Rails Startup" Ask Me Anything
We don't do too many things The Rails Way™ anymore. We tend to use the Interactor pattern using the aptly named gem. We use Wisper to broadcast events instead of using AR callbacks. We use Pusher for websockets because we broadcast millions of events per day and ActionCable just can't keep up.
-
Are you putting your business logic at correct place?
In this blog, we are going to look at Interactor using interactor gem. It is quite easy to integrate into an existing project.
-
When should you use callbacks?
There are lots of different libraries that you can use to organize/structure/enhance your "service objects", or you can just use plain old Ruby classes (as in the example above).
-
How can I ask the controller to ask another controller to call one of its actions? Without violating the SRP?
In the past I've used (and loved) https://github.com/collectiveidea/interactor
What are some alternatives?
Light Service - Series of Actions with an emphasis on simplicity.
ActiveInteraction - :briefcase: Manage application specific business logic.
Trailblazer - The advanced business logic framework for Ruby.
dry-transaction - Business transaction DSL
Rectify - Build maintainable Rails apps
SimpleCommand - A simple, standardized way to build and use Service Objects (aka Commands) in Ruby
wisper - A micro library providing Ruby objects with Publish-Subscribe capabilities
graphql-guard - Simple authorization gem for GraphQL :lock:
Mutations - Compose your business logic into commands that sanitize and validate input.
u-service - Represent use cases in a simple and powerful way while writing modular, expressive and sequentially logical code.
graphql-client - A Ruby library for declaring, composing and executing GraphQL queries
Spree Commerce - A headless open source e-commerce platform for global brands