Skip to content

Way to consume relationships on the fly ? #215

@alberto-f

Description

@alberto-f

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:

jsonApi.define('post', {
  title: '',
  content: '',
  comments: {
    jsonApi: 'hasMany',
    type: 'comments'
  }
})

const post = await jsonApi.find('post', '1'); // trigger get request
const comments = await post.comments.findAll();  // trigger get request

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions