-
Notifications
You must be signed in to change notification settings - Fork 67
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
Is there a plan in place for adding support for async await? #55
Comments
Given that Swift 5.5 is now released, will Graphiti support async-await? |
Hello @cshadek, @paulofaria and @adam-fowler It appears that support for async/await is a big undertaking. I really hope to see it implemented some day. I've just started learning about this package from https://www.raywenderlich.com/21148796-graphql-tutorial-for-server-side-swift-with-vapor-getting-started It's a great package, thank you all for your hard work! |
Hi, thank you for your kindness. I will try to finish this by the end of the month. The async part itself is mostly done. It's just that I took the chance to improve the API so we can release a new major version and life got in the way. |
I was also waiting on https://github.com/apple/swift-evolution/blob/main/proposals/0348-buildpartialblock.md to improve the API greatly. Instead of using classes and initializers for the Schema definition, we'll be able to use functions and structs, which will make the API look much closer to the GraphQL SDL. |
@paulofaria have you given any thought as to how subscriptions and directives fit into the new API design? |
@cshadek I have done a little thinking about subscriptions and async/await. The new AsyncSequence should be able to replace reactive drivers like GraphQLRxSwift. |
@alobaili In the meantime, you can convert any let result = await graphitiAPI.execute(
request: request,
...
).get() |
This sounds amazing |
I just came across this, but it looks like this repo is already doing a lot of what we're talking about. |
Woah, I hadn't seen that repo before! That's pretty awesome stuff they're doing! Yeah, it seems like we could easily bring some of the extensions they've made into this repo. |
Yeah I just found it earlier today. I really wonder if there shouldn't be some strategic partnership between Pioneer and GraphQLSwift. It's almost like they want to build Apollo Server for Swift - that would be incredible! |
It does seem like it's only one guy - which is not unheard of it, but I'd worry about it getting maintained longterm. But some of the stuff with abstracting away the web socket support and graphiQL is really nice. |
I have an PR in to GraphQL that adds async/await support, and a followup one ready for Graphiti once that one goes through. |
I think I can help move the async-await extensions I made from Pioneer here. The only problem with those extensions I made is that at the moment, they completely ignore the Sendable conformance which is not enforced now with Swift 5 but will be a problem later on with Swift 6 which is set to be safe-by-default and the only solution I see is |
I'm marking this as resolved, since |
Async-await will be added in Swift 5.5.
https://github.com/apple/swift-evolution/blob/main/proposals/0296-async-await.md
The text was updated successfully, but these errors were encountered: