-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve examples using Async::HTTP and Falcon #2
Comments
Another idea is to return class Schema < GraphQL::Schema
query Query
lazy_resolve Async::Task, :wait
end Resolver methods can now just return an def one
Async {
response = internet.get("https://httpbin.org/delay/1").read
JSON.parse(response)["url"]
}
end You could probably take things further by injecting something that wraps all resolvers with This approach may mean you can avoid the graphql-batch dependency all together. |
Thanks for the note, @josh -- I'll try to work up an example app using this style for reference today and report back. I'm also trying working up an example suggested by @ioquatix #3 using |
How to enable Accept-Encoding: gzip #7 (?) multiple headers?We have discussed this and I think this is appropriate for default inclusion into |
We also discussed improving this: socketry/async-http#67 |
Investigate how the fiber interface is supposed to be used. |
I think we covered everything! I have some notes to follow up with docs re preloading and Heroku falcon.rb config once I sort those things out for myself. Thank you again for all of your help so far! |
Issues hit when upgrading my existing Rails app:
Protocol::HTTP1::BadRequest
with old VCR cassettes Unexpected Protocol::HTTP1::BadRequest exception protocol-http1#11Need examples and/or documentation for the proof of concept sample apps in this repo:
async-await
but running into trouble: async-await (wip) #3lazy_resolve
but not sure about the semaphore(s) graphql-ruby lazy_resolve, Async::Semaphore #4internet.close
(?)rails-async-http-falcon-graphql-batch
-- isSync
the appropriate here? Do we needAsync::Barrier
?Async::Clock.measure
or something manual (?)async/http/internet/instance
Example using async/http/internet/instance async-http#72group :preload
, don't understandpreload.rb
)rack-async-http-falcon-graphql-batch
and falcon hosting on heroku using falcon.rb falcon#121 (comment)Feature requests:
wait_all
re: Async::Task#wait_all async#89 if/when acceptable (don't need this, can use barriers)Async::HTTP::Internet
should useProtocol::HTTP::AcceptEncoding
by default. async-http#68Async::HTTP::Internet
async-http#74rack-async-http-puma-graphql
(not expected to work currently?)rack-async-http-falcon-graphql-dataloader
(should work in Ruby 3.1? Can we make it work now?)For the examples/documentation issues, I'd like to work in the open and/or contribute back to the relevant projects' documentation wherever possible. I'm finding the async suite of tools to be lovely, but the documentation sparse, and I'm hoping to contribute back in an effort to increase adoption.
For the issues found while upgrading my existing Rails app, I'll need to keep that source code private, but happy to work in the open wherever possible, as illustrated by the VCR cassette issue: socketry/protocol-http1#11 since obviously most of these concerns can be generalized.
The text was updated successfully, but these errors were encountered: