quintype-backend
v1.13.0
Published
client for accessing quintype API
Downloads
25
Maintainers
Keywords
Readme
@quintype/backend
This library is used for making API calls to a Quintype API server
How to use this library
It is highly recommended that you use the object wrappers for each API call. For example, please use
Story.getStoryBySlug(client, "slug").then(story => story.domainFunction())
rather than
// Do not use this
client.getStoryBySlug("slug").then(story => doSomethingWithStoryJson(story))
Return Values
In cases where a 404 is possible (such as getting a story or a collection by slug), the following return types are possible (taking Story.getStoryBySlug
as an example)
- In case of a success, the promise resolves to an object of the Story class
- In case of a 404, such as a not found slug, the promise resolves to null
- In case of a 5xx or any other status code, the promise is rejected with an exception