You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe the deserialization step in Devour throws away the information that's needed for what you like to do @alberto-f . I could be mistaken though..
I would like to have this functionality too; and I already thought about it. There's one problem that's keeping me from implementing it though: (using the code from your example) post.comments.findAll() will reserve the word findAll for that function. That means this name cannot be used anymore as an attribute or a relationship (collectively called fields).
Change the deserialization so that we keep attributes and relationships separate; but add convenient delegates to for non-clashing names; like such:
constpost=awaitjsonApi.find('post','1');post.attributes.title// => the attribute "title"post.title// a delegate to the title attributepost.relationships.comments// => a relationship-object with methods like get and deletepost.relationships.comments.included[0]// => a resource-object; an [included related resource](https://jsonapi.org/format/#fetching-includes)post.comments// a delegate to an included resource (only available if it's included)
I doubt that my second solution will be popular with the users of this library though since it seems like this was a deliberate design decision that was made long ago.
Hello, thanks for the project. It is really nice structure and the middlewares are a really nice feature.
I was wondering if there is any way to continue consuming the responses
Example:
The text was updated successfully, but these errors were encountered: