running "afterware"
See original GitHub issueWith combine
we can add handlers to run before the main resolver. Useful for authentication checks and such.
I think it would be nice if we could also run some handlers after the main resolver. Think about credit transactions.
combineResolvers(reserveFunds, performAction, chargeFunds)
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Batched network interface runs middleware and afterware ...
'Afterware' is very similar to a middleware, except that a afterware runs after a request has been made, that is when a response...
Read more >Running a Marathon? Think Hot Tub, Not Ice Bath, Afterward
Muscles recover better after exhausting exercise if they are warmed than if they are chilled, a new study finds.
Read more >How To Warm Up For A Run And Cool Down Afterwards | Coach
Avoid injury and get the most out of your runs with these brief pre and post-run routines.
Read more >Why I run: 'It's painful and boring. Afterwards, you're fully alive'
Running is chafingly painful, repetitive, booorrring. It is also the best source of natural serotonin. Afterwards, once you've recovered ...
Read more >Aftercare - Pentz Run Family Servicess - DuBois, PA
Aftercare... Mobile Case Management Program. Aftercare services are available to residents and their families, upon the resident's discharge from Pentz Run.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@lucasconstantino, I’m aware of batching, but it’s not the holy grail either. It doesn’t combine requests from multiple child resolvers
When
authorId
andpublisherId
are not equal, this will still hit the database three times. While we could optimize it, by fetching in the blog resolver:This is an oversimplified example of course, and in this specific case, I even might recommend against it. But taking the blog’s code from before:
If the first 100 blogs are made by 100 different authors. This would still result in 101 queries hitting the database. Even when using dataloader with it’s batching implementation. Unless I missed something huge in dataloader, it only protects you from requesting duplicate id’s. So when there are 25 different authors in this first 100 blogs, the database will only be hit 26 times. While we could reduce the count to 2 hits when we would iterate over the blogs our selves.
@smeijer I honestly forgot to answer you back then. Facebook’s data-loader not only facilitates caching, but batching. You should have a deeper look at that.