devour-client
devour-client copied to clipboard
Don't just consume your JSON API, Devour it...
How to handle unauthorized error after main auth token expires and do a refresh token request? I tried something like this: ``` import JsonApi from 'devour-client' import store from '../store/index'...
When making a custom request, at least while making a POST request, there are multiple issues. One is avoidable with some hacking but the other renders the function useless. When...
From: https://jsonapi.org/format/#document-compound-documents > To reduce the number of HTTP requests, servers MAY allow responses that include related resources along with the requested primary resources. Such responses are called “compound documents”....
Im trying to do this ```js await jsonApi.update("match", { id: this.match.id, date: date, homeTeam: { id: homeTeam.id }, visitTeam: { id: visitTeam.id }, tournament: { id: tournament.id } }); ```...
Including recursive relationships result in a null object. A minimal example is here: [Backend](https://runkit.com/pcr910303/json-api) [Frontend](https://codesandbox.io/s/laughing-visvesvaraya-fqpj3) As you see from the [response](https://json-api-a4z6drvcquyp.runkit.sh/as?include=b.a) of the API, `jsonApi.findAll("a", { include: "b.a" })` should...
When a new object is created pluralize is not used on the relationship type: `serializeRelationships[relationshipName] = serializeHasOne(relationship, relationshipType.type);` The above only takes the single type but shouldn't it also do...
Hello there, We've been experiencing an issue with Devour where passing `fields: { comments: 'title' }` will not get serialized for `create` or `update` calls. For GET requests it will...
This is a breaking change, as it might break existing code that uses `insertMiddlewareBefore` and `insertMiddlewareAfter`, so this PR should be merge in next major ## Priority Low ## What...
There's no way to not have a slash when `path` is [empty][1], ```js return `${this.apiUrl}/${path}${slash}` ``` [1]: https://github.com/twg/devour/blob/v2.0.13/src/index.js#L150
Allows create relationship with jsonApi.createRelationship('base.child', [baseEntity, childEntity]); its a basic version. need to add a multientity and update relationship support.