Skip to content
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

Any plan to support to async await resolvers ? #21

Open
Samsv77 opened this issue Feb 28, 2023 · 6 comments
Open

Any plan to support to async await resolvers ? #21

Samsv77 opened this issue Feb 28, 2023 · 6 comments

Comments

@Samsv77
Copy link

Samsv77 commented Feb 28, 2023

Hi,
Swift GraphQL supports resolvers with async throws, in addition to NIO eventLoop.
Do you have any plan to provide support for them too ?

@bdrelling
Copy link

Same question. @alexsteinerde, can you let us know your plans for this repository? Thanks!

@alexsteinerde
Copy link
Owner

The async/await support comes with Graphiti already built in. This package is only a layer on top with additional resolver functions for Fluent objects which don't require mention EventLoops to the public API at the moment.
So updating Graphiti should give you async/await resolvers.

Or do you have any specific function that ships with this package and doesn't support async/await?

@Samsv77
Copy link
Author

Samsv77 commented Mar 13, 2023

The native Graphiti methods are not integrated with Vapor and Fluent, in particular the request object. So we can't use the async throws method without adding the Vapor integration layer manually.

@alexsteinerde
Copy link
Owner

I'm sorry but I currently don't see any EventLoops in the public interface.
Could you please provide me with an example? Probably I just missed a place.

@GiovanniLuigi
Copy link

Maybe he's referring to public func register<RootType>(graphQLSchema schema: Schema<RootType, Request>, withResolver rootAPI: RootType, at path: PathComponent="graphql", postBodyStreamStrategy: HTTPBodyStreamStrategy = .collect)

@kylebrowning
Copy link

You use -> Future<GraphQLResult> Rather than async -> GraphQLResult

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants