AWSAmplify DataStore iOS: Populating relationships

0

Hi, I am trying to implement offline app using Datastore in iOS. I was going through this guide saving-relations In the example if we want to create a Comment and associate to a Post we have to supply the entire Post object. Is there a possibility to pass in just the postID and the comment then gets associated with that Post? I tried this by adding (fields: ["postID"]) but the comments never gets populated in the Post object. Whats the correct way to model this?

Objective is to just pass in the postId for creating and associating a comment to the post and make sure when querying the post, I get the comments field populated.

asked 2 years ago89 views
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions