Modules

README

Elm GraphQL

Alternatives

If you're searching a complete solution including Decoders defined with your query, take a look at Elm GraphQL in Elm, and if you're searching for converting .graphql files to Elm, take a look at GraphQL to Elm!

Opinion

Just import GraphQL, and write queries and mutations! This package suppose your decoders are already written, and do not write decoders. It only provide a nice syntax to do GraphQL queries and mutations, and decode the "data" at the root of standard GraphQL response for you. Just think on your schema, and don't bother with everything else. By not writing custom decoders, you can make multiple queries on the same data, with different schemas each times. They will always be converted to the same type, avoiding you to rewrote a type for each request like others can do. Moreover, it is purely written in Elm, avoiding you to think to recompile .graphql files.

This package try to be similar to Json.Encode and Http. This allow to write things more easily if you're often involved with Elm!

How to use?

Basically, creates an object with object, add some fields with a list of field, and you're done! You can add some arguments, selectors or alias to the fields, by using the corresponding functions. The type system is here to protect you from doing anything crazy, so relax and enjoy GraphQL!