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.

preguntada hace 2 años92 visualizaciones
No hay respuestas

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas