graphql / graphql.github.io

GraphQL Documentation at graphql.org
https://graphql.org
MIT License
832 stars 1.42k forks source link

Interest for a codegen blog post? #1760

Open martinbonnin opened 1 month ago

martinbonnin commented 1 month ago

Hi everyone 👋

Martin from Apollo Kotlin here.

A question that's coming up quite often from our users is how come the codegen doesn't model classes after the GraphQL types but rather after the operations.

The reason is type safety of course (cannot access the fields you did not query) but given that GraphQL and a lot of other type systems are so similar, expecting the same shapes seems like a pretty reasonnable expectation to have.

I'd love to write a blog post explaining the different ways to look at codegen and the various tradeoffs there so that I could point users at.

Content would be cross-platform. Probably use TS for codeblocks examples but frame the content as cross platform enough so that it could apply to Swift/Kotlin developers as well.

Is that something that could belong to graphql.org? Any interest in this?

benjie commented 1 month ago

Absolutely; I'm sure we'd love to see this! I've come across the exact same confusion. Please go ahead, and let me know if you need any guidance or input.

benjie commented 1 month ago

cc @jorydotcom

AnthonyMDev commented 4 weeks ago

My talk at GraphQL Conf is going to be about this same topic.

We could pair the talk as a companion to this post?

martinbonnin commented 1 week ago

Draft here, comments welcome!