Welcome to the Mula API.

Introduction

The Mula API consist of a GraphQL endpoint that provides a Schema on the route /graphql in order to interact with the Schema, the clients need to authenticate using a federated identy provider.

Currently the Mula API supports the following providers:

  1. Google
  2. Facebook
  3. Twitter

Authentication

Clients start authentication process by visiting the /auth/:provider route where the :provider happens to be a supported federated identity provider. On visiting this route, the client is redirected to the desired provider where they have to login to their account and are issued with a token.
Clients are then redirected back to the Mula API where the client has to provide details using the token issued.This needs to be placed in the Authorization header in any request that needs authorization.

Example header

        
            Authorization: Bearer YWxhZGRpbjpvcGVuc2VzYW1l
        
    

Requests

Requests to the Mula API will be sent as GraphQL documents and replies will be formarted as a JSON obect containing a data or error object depending on how the request went.

Example request

        
        mutation($input:IncomeLogInput!){
            addIncomeLog(input: $input){
                name
                amount
            }
        }
        
    

Example Response
        
        {
            "data":{
                "addIncomeLog":{
                    "name":"Salary",
                    "amount": 350.00
                }
            }       
        }