I have a model for orders, I made an index that would let me query the orders based on what month and year they were created. Now that I am able to query those orders, I want to avoid unnecessary connection (order-vendor) queries every time I query using that month-year index since I only want the list of the orders' number and status. Is there a way that I can do that?
here is my schema:
type Vendor @model @searchable{
id: ID!
vendorName: String!
location: String!
telNo: String!
terms: String!
createdAt: AWSDateTime!
updatedAt: AWSDateTime!
}
type PurchaseOrder @model @searchable
@key(name:"MonthYearCreatedAt" fields:["monthYear", "createdAt"] queryField: "purchaseOrderMonthCreatedAt")
{
id: ID!
purchaseOrderNo: String!
vendor: Vendor! @connection
orders:[String!]
totalPrice: Float!
requestedBy: String!
category: String
addNotes: String
status: Status!
monthYear: String!
createdAt: AWSDateTime!
updatedAt: AWSDateTime!
}