Unable to query for all connections
Describe the bug Abbreviated Schema: User @model { recommendations: [Recommendation] @connection(name:"User_Recommendation") } Restaurant @model { name: String! recommendations: [Recommendation] @connection("Restaurant_Recommendation") } Recommendation @model { caption: String! user: User! @connection(name:"User_Recommendation") restaurant: Restaurant! @connection(name:"Restaurant_Recommendation") } When I create a new recommendation, I see it created in the database. It has the proper recommendationUserId and recommendationRestaurantId fields. But when I query for the user or the restaurant (like below) I do not see all of the Recommendations that should be connected.
query getUser { getUser(id:"<proper_id_here>") { recommendations { items { restaurant { name } caption } } } }
To Reproduce
- Create a User
- Create a Restaurant
- Create multiple Recommendations with the User/Restaurant
- Attempt to query for the User's recommendations
Expected behavior All recommendations created should appear (w/ captions 1 - 19) when using this query: query getUser { getUser(id:"6b822cf0-4352-4170-b888-25d96d2de549") { recommendations { items { restaurant { name } caption } } } }
What I actually get: { "data": { "getUser": { "recommendations": { "items": [ { "restaurant": { "name": "Edo Salon" }, "caption": "Hair test 12 w/ photo " }, { "restaurant": { "name": "Edo Salon" }, "caption": "Hair 18" }, { "restaurant": { "name": "Edo Salon" }, "caption": "Hair 15 w/ photo " }, { "restaurant": { "name": "Edo Salon" }, "caption": "Hair 6 w/ photo" }, { "restaurant": { "name": "Edo Salon" }, "caption": "Hair test 3 w/ photo" }, { "restaurant": { "name": "Edo Salon" }, "caption": "Hair test1" }, { "restaurant": { "name": "Edo Salon" }, "caption": "Hair 4 no photo" } ] } } } }
Desktop (please complete the following information):
- OS: iOS
- Browser is chrome (version 74.0.3729.169)
- Amplify 1.1.2
Smartphone (please complete the following information):
- iPhone6s
- OS: iOS 12.2
- Browser: Chrome
*Closed because the problem was not using nextToken properly
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.
Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels for those types of questions.