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.

feita há 2 anos92 visualizações
Sem respostas

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas