This module is used for any kind of configuration that is associated with requests, such as limiting the number of results, filtering, order, etc..
See https://docs.ghost.org/api/content/ for further information on all settings.
fields takes in a string of comma-separated fields, that will be returned
by ghost. Since it allows to filter any kind of field, such as "id", "title",
"url", "authors", etc. all ghost types are defined as Maybe types.
Params.empty
|> Params.fields "url,id" -- everything else is dissmissed
|> ...Takes in a string of comma-separated filters, to fine tune the response.
Params.empty
|> Params.filter "featured:true,tag:getting-started"
|> ...include takes a string of comma-separated parameters, such as:
* Posts & Pages: authors, tags
* Authors: count.posts
* Tags: count.posts
Params.empty
|> Params.include "authors,count.posts"
|> ...which allow to fine tune the returned result.
Limit the number of records returned, the default value is 15, the nagative value -1 will return all results.
Params.empty
|> Params.limit 2
|> ...Define the sort order:
Params.empty
|> Params.order "published_at DESC"
|> ...By default, the first 15 records are returned.
Params.empty
|> Params.limit 2
|> Params.page 2
|> ...Used internally only, to generate a string from all parameters.
A basic record for all ghost related fine tune settings.
Initialise an empty Parameter record. This is a shortcut for: