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

use async-graphql over juniper #63

Closed
Suyashtnt opened this issue Jul 24, 2022 · 5 comments · Fixed by #80
Closed

use async-graphql over juniper #63

Suyashtnt opened this issue Jul 24, 2022 · 5 comments · Fixed by #80

Comments

@Suyashtnt
Copy link

async-graphql is another gql framework for rust and overall, it seems to be better than juniper according to their comparison. I'ved used both and async-graphql seems better to work with

@JonasKruckenberg
Copy link
Owner

Interesting! I actually wasn't aware of this async-graphql crate. I cannot promise anything however, as there are many projects that need attention and this would be s fairly substantial rewrite. I'm happy to review+accept a PR however!

@Suyashtnt
Copy link
Author

Interesting! I actually wasn't aware of this async-graphql crate. I cannot promise anything however, as there are many projects that need attention and this would be s fairly substantial rewrite. I'm happy to review+accept a PR however!

I might PR this for a better DX with the app I'm currently working on as duplicating types is really annoying rn. Subscriptions could also be very helpful with the app. I'll start making a PR soon

@JonasKruckenberg
Copy link
Owner

JonasKruckenberg commented Jul 24, 2022

The current version of the plugin has subscriptions too, just FIY. It's just hidden behind the subscriptions flag bc it adds another dependency.

@Suyashtnt
Copy link
Author

The current version of the plugin has subscriptions too, just FIY. It's just hidden behind the subscriptions flag bc it adds another dependency.

I know, I just prefer async-graphqls impl over juniper

@JonasKruckenberg
Copy link
Owner

@Suyashtnt I think I like async-graphql better too, it has more integrations so is probably the better choice anyway.

The only thing I particularly dislike is the way you access shared state (the app handle or window)

struct Query;

#[Object]
impl Query {
    async fn hello(&self, ctx: Context<'_>) {
      let app = ctx.data::<AppHandle>().unwrap();
      let window = ctx.data::<Window>().unwrap();
   }
}

Maybe you have any idea to do this in a better way somehow 🤔

Anyway, please test the PR branch if you have the chance and report if it works 👍🏻

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

Successfully merging a pull request may close this issue.

2 participants