Example Requests 💡

Here we provide some example requests to test your GraphQL client with. You can copy these requests into the corresponding files in your project (depending on whether you use Apollo Client or a custom solution) or you can use the GraphiQL App to explore the Yoli API.

Query

Queries are used to fetch data from a GraphQl endpoint. They are prefixed with the query keyword.

The following example query retrieves a list of banks for a given search string.

query BankSearch($search:String!) {
  bankSearch(search: $search) {
    shortName
    bic
  }
}

For example, try "Sparkasse" as the search string.

Mutation

Mutations are used to create, update or delete data on a GraphQL endpoint. Mutations can also return data. They are prefixed with the mutation keyword.

The following example mutation updates account data with new custom user data.

mutation customizeAccount($accountId: String!,
           $customName:String,
           $customCategory:String, 
           $customGroup:String,
           $customDetailJSON:String, 
           $configured:Boolean,
           $hidden: Boolean) {
             customizeAccount(accountId: $accountId, 
               customName: $customName, 
               customCategory: $customCategory, 
               customGroup: $customGroup, 
               customDetailJSON: $customDetailJSON, 
               configured:$configured,
               hidden: $hidden
             )
}

Note, that this mutation requires authentication. You need to specify an authorization header with a valid Access Token as the value.

Reponses

The responses from the Yoli API contain on the top-level a data object containing the returned data or, if something went wrong, an errors object containing information on the occured error.

Data

Example response for a banksearch query for "N26":

{
  "data": {
    "bankSearch": [
      {
        "shortName": "N26 Bank Berlin",
        "bic": "NTSBDEB1XXX"
      }
    ]
  }
}

Error

Example response for a banksearch query with missing search term:

{
  "errors": [
    {
      "message": {
        "id": "Variable \"$search\" of required type \"String!\" was not provided."
      },
      "locations": [
        {
          "line": 1,
          "column": 18
        }
      ]
    }
  ]
}