This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
1.0.0 2.0.0
We were not able to find the expected elm-package.json file at this tag.
Tag 2.0.1
Committed At 2020-12-01 15:25:57 UTC

Modules

    README

    elm-graphql

    A simple ELM library to use the GraphQL API.

    Install

    > elm install gribouille/elm-graphql
    

    Examples

    To run the examples:

    $ cd examples
    $ npm install
    $ npm run server
    $ npm run dev
    

    Open http://localhost:8000/src/Main.elm.

    Usage

    GraphQL API:

    type User {
      id: Int!
      login: String!
      firstname: String
      lastname: String
      email: String
    }
    
    type Query {
      users: [User!]!
      ...
    }
    

    Library usage:

    type alias User =
      { id        : Int
      , login     : String
      , firstname : String
      , lastname  : String
      , email     : String
      }
    
    
    userDecoder : Decoder User
    userDecoder = ...
    
    
    type Msg
      = OnUsers (GraphQL.Response (List User))
      | ...
    
    
    get : Cmd Msg
    get =
      GraphQL.run
      { query = "query { users { id login firstname lastname email } }"
      , decoder = usersDecoder
      , root = "users"
      , url = "<url/graphql>"
      , headers = []
      , on = OnUsers
      , variables = Nothing
      }
    

    Documentation

    The API documentation is available here.

    Contributing

    Feedback and contributions are very welcome.

    License

    This project is licensed under Mozilla Public License Version 2.0.