dillonkearns / elm-graphql

Autogenerate type-safe GraphQL queries in Elm.

Home Page:https://package.elm-lang.org/packages/dillonkearns/elm-graphql/latest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Include an exhaustive query for each type

janwirth opened this issue · comments

I really like the library but in one regards it's worse that a coder-generator workflow or writing a decoder from some JSON. If I care about a lot of fields (or all of them) because I want to rapidly prototype or migrate from HTTP I need to manually write the GQL query and the type alias that accepts it etc. It would be useful if for each type we had an exhaustive query that gives you back the full type :)

I'd rather be honest than give false hope here. This doesn't fit in to my vision of the library. I think that some type-aware tool-assisted scaffolding would be a really neat thing for Elm code, and I think it could help with this sort of thing. I could imagine a tool to help generate elm-graphql code, as well, and think that would be valuable. But the idea of generating an exhaustive selection set for prototyping purposes doesn't fit into my vision for the library because it doesn't give you an incremental path to then slim down the SelectionSet to what you'll actually use in production, so I don't see this as something I'd like to add to the core package.

Thank you for elaborating. :)

Thanks for understanding 😄

Oh yes, I found something related that I wrote about a while back, too, so I'll add this link here for reference: https://github.com/dillonkearns/elm-graphql/blob/master/FAQ.md#why-doesnt-elm-graphql-generate-types-automatically