- The basic use of Promise and Fiber
- The combination of Promise and Fiber performs like Async/Await syntax
- The naive Async/Await syntax sadly does NOT work efficiently in Graphql-ruby
Promise and Fiber 2. ★ The combination of Promise and Fiber performs like Async/Await syntax 3. ★★ The naive Async/Await syntax sadly does NOT work efficiently in ★: hard for @sat0yu to explain
inherit GraphQL::Batch::Loader - which need implementing perform(...)fetching data in bulk - Generate field values through the loader X.rb Y.rb ref. https://github.com/Shopify/graphql-batch
won’t be calculated until evaluating it (lazy-evaluation) - Chain-able with other promises through .then(...) What is “Promise”? fulfill reject pending fulfilled rejected ※ .load(...) returns a promise
feel it’s do-able… but it does not work even if modifying it as returning a promise - The main difficulty comes from the difference in the promise life-cycle between Graphql-batch and the handcrafted Async/Await implementation
- Confirmed the combination of Promise and Fiber works as Async/Await syntax - Observed that the naive impl. is not enough to work along with Graphql-batch - Code available: https://github.com/sat0yu/heisei-ruby-kaigi01 Thank you for your time and attention