Json Api
Say I have two resources user and profile. relationship being profile belongs to user. when iam returning user resource how can i return it along with the profile as response from get request?. i have a read action that works well and return data as expected via iex. however if i use the same action on json api, i only recieve user data without profile data. can someone guide me?
2 Replies
This is described in the
json:api
specifications: https://jsonapi.org/format/#fetching-includes
Then, in your json_api
configuration for user
you'd add a includes [:profile]
to allow passing ?include="profile"
thank you all is working well now 😀