I have no clue how to fetch nested data on AppSync with React. These are the models.
type BlrPost @model {
id: ID!
parentId: String!
parent: BlrParent @connection(name: "ParentPost")
title: String
contents: String
tags: [String]
ask: Float
urgentFlg: Boolean
Bids: [BlrBid] @connection(name: "PostBids")
createdAt: AWSDateTime
updatedAt: AWSDateTime
}
type BlrBid @model {
id: ID!
price: Float!
duration: Int!
Post: BlrPost @connection(name: "PostBids")
consultation: BlrConsultation @connection(name: "BidConsultation")
createdAt: AWSDateTime
updatedAt: AWSDateTime
}
I want to fetch Bids data details in BlrPost with below code.
const postsData = await API.graphql(
graphqlOperation(listBlrPosts, {
sortDirection: 'ASC'
})
);
However, I can fetch nextToken only.
...
Bids:
nextToken: null
__proto__: Object
...
I can fetch other data. And also, if I try this on AWS console directly, I can get Bids data like this.
