Questions & Feedback + Seed tutorial #88
Replies: 12 comments
-
Hi @MartinKavik, thanks for getting in touch. Saw you star the repo a few days ago and got very curious. Definitely a fan of seed - used it for the Rust parts of the generator and really enjoyed it. I'll answer your questions first, and then have a proper read of your tutorial:
Yeah, please do. Not got round to writing a proper tutorial for cynic myself, so I'm extremely happy that there's something I can point people at if they ask.
Good question. Certainly started as an experiment, but I've got fairly into it now. I'm running it in production at work and I'm keen to fill in the missing features, documentation and fix the various rough edges. So farily serious.
So fixing input object support is next on my list, and I think that's really the only blocker for adding mutation support. Don't want to give too strong a promise, but hopefully in the next couple of weeks.
Yeah, this is a good idea. I've kind of been making the assumption that people would commit schemas to their repositories but this is not always what you'd want. Have raised #89 so I get round to this at some point.
I think this is expected: you can only put parenthesis on a field in graphql if you're providing arguments to that field. Or at least that's how most tooling I've used has worked - please correct me if I'm wrong (or I'm misunderstanding the issue).
Another good idea - think I'd avoided this as the apps code needs to use
😆 yeah - will do, thanks for pointing that out.
Yeah, definitely a lot more work to be done on the generator. For now I see it more as a tool to provide a starting point, rather than something that gives you the exact code you'll want. Deduplicating types is one of the items on #13 although not sure how much that would have helped with your specific case: each of your queries is just different enough to require a different set of structs. I'd imagined one of the advantages of the cynic approach would be that you could easily share structs between queries (which is basically impossible with the existing graphql-client approach) though maybe that'll always be tricky given how easy graphql makes it to build slightly different types. From a quick skim I think what you've ended up with is reasonable: is there anything you think I could change to improve your code? |
Beta Was this translation helpful? Give feedback.
-
I don't have too much experience with GraphQL - I've written some PRs for Elm and Elixir GraphQL libs and written some Seed examples, but I don't know all GraphQL specs and all supported features. So you are probably right and it isn't a problem, it was just the first "blocker" when I was trying the Rust generator.
Once the Thanks and enjoy the weekend! |
Beta Was this translation helpful? Give feedback.
-
👍 There's probably some room for improving the graphql-parser error messages. I've been tripped up by this several times myself, and a rust compiler style fix suggestion would be really nice to have. Though there's a lot of things to do before I'll even think about attempting that 😄 |
Beta Was this translation helpful? Give feedback.
-
What you think about adding discord server for the cynic project? |
Beta Was this translation helpful? Give feedback.
-
@lunaryone I was just thinking about that last night actually, think it's a good idea. Will try get something set up today |
Beta Was this translation helpful? Give feedback.
-
@lunaryone There's now a discord link in the readme & on the website. |
Beta Was this translation helpful? Give feedback.
-
@MartinKavik I released v0.9.0 of cynic the other day by the way, it includes mutation & input object support along with a few other things from your list. Made a PR to update your guide here: seed-rs/seed-rs.org#83 |
Beta Was this translation helpful? Give feedback.
-
@obmarg Thank you! I would like to finish that Seed tutorial ideally in the coming weeks. I'll write another batch of questions / feedback or close the issue once the tutorial is done. |
Beta Was this translation helpful? Give feedback.
-
Hi, I'm trying to write mutations but there are two blockers:
See |
Beta Was this translation helpful? Give feedback.
-
Hi @MartinKavik I’m on holiday right now (and on my phone) so apologies if this isn’t the most useful response, but:
|
Beta Was this translation helpful? Give feedback.
-
Enjoy your holiday!
I don't know internal
I didn't use the generator. I was just trying to follow and resolve compiler errors.
Don't hurry, enjoy your holiday, it can wait 🙂 Thank you! |
Beta Was this translation helpful? Give feedback.
-
Thanks! I'm back now, so let me answer your questions a bit better. Re: recursive type support, I'm going to get on that first. Hadn't considered recrusive types, but seems a pretty essential feature for a GraphQL library. Hoping it won't be too much work, so hopefully land in the next week or two.
Could you point me at an example of doing lazy object creation in seed? I'd be really happy to get rid of the (Feel free to skip this next blob if you want, I'm mostly thinking out loud.) The difficulty here is that I generate code that looks something like this:
That
Currently I've gone with option 3, though I agree it's not great. May switch back to option 2 if I can't come up with a better solution, as I think supporting
Sorry - I see what's going on now, couldn't quite read your code properly on my phone. I see that the |
Beta Was this translation helpful? Give feedback.
-
Hi @obmarg!
I'm a Seed maintainer. And I think your project has a great potential. That's why I've integrated it into a larger app example while I was writing a Seed tutorial. Cynic-related content starts from this page.
Could you answer a few questions, please?
cynic
in that tutorial?cynic
would we able to download a schema by itself. I would use it from build script to download and updateschema.graphql
.queryClient()
, howeverqueryClient
passes.serde_json
into the app'sCargo.toml
. Perhaps it should be included incynic
deps. (?)cynic
repository is hidden underHomepage
and more detailed content is missing in the crates.io page. I would pointHomepage
to https://cynic-rs.dev/ andRepository
to, well, repository.Thank you!
Beta Was this translation helpful? Give feedback.
All reactions