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.

demandé il y a 2 ans92 vues
Aucune réponse

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions