You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
npm list @aws-amplify/data-construct @aws-amplify/graphql-schema-generator
Description
I am using amplify gen2 lambda function
I am unable to retrieve data for custom data types defined in my schema while performing list operations In Lambda function. Specifically, I cannot access data inside the PurchasedTickets custom type when querying for Ticket objects. Other fields in the Ticket model are accessible, but the purchasedTickets array (which uses the custom type) .
Custom Types and Models
Here is the relevant part of my schema:
totalPurchaseTickets
totalPurchaseAmount
# Missing: purchasedTickets field (custom data type)
__typename
}
nextToken
__typename
}
}
`;
Problem
The purchasedTickets field, which references the custom type PurchasedTickets, is missing in the items section of the generated GraphQL query. While all other fields in the Ticket model are present, I cannot fetch or use the data for purchasedTickets in my queries.
Environment
Backend: Separate backend repository
Frontend: Separate frontend repository
GraphQL: Using automatically generated queries
The text was updated successfully, but these errors were encountered:
Environment information
Data packages
Description
I am using amplify gen2 lambda function
I am unable to retrieve data for custom data types defined in my schema while performing list operations In Lambda function. Specifically, I cannot access data inside the PurchasedTickets custom type when querying for Ticket objects. Other fields in the Ticket model are accessible, but the purchasedTickets array (which uses the custom type) .
Custom Types and Models
Here is the relevant part of my schema:
PurchasedTickets: a.customType({
code: a.id().required(),
category: a.string(),
price: a.float(),
}),
Ticket: a.model({
id: a.id().required(),
type: a.string().default('Ticket').required(),
eventId: a.id().required(),
purchasedTickets: a.ref('PurchasedTickets').array(), // Custom data type
totalPurchaseTickets: a.integer(),
totalPurchaseAmount: a.float(),
}),
Generated GraphQL Query
The following is the query generated for listing Ticket objects:
export const listTicketByEventIdCreatedAt = /* GraphQL */ `query ListTicketByEventIdCreatedAt(
$createdAt: ModelStringKeyConditionInput
$eventId: ID!
$filter: ModelTicketFilterInput
$limit: Int
$nextToken: String
$sortDirection: ModelSortDirection
) {
listTicketByEventIdCreatedAt(
createdAt: $createdAt
eventId: $eventId
filter: $filter
limit: $limit
nextToken: $nextToken
sortDirection: $sortDirection
) {
items {
createdAt
eventId
id
}
}
`;
Problem
The purchasedTickets field, which references the custom type PurchasedTickets, is missing in the items section of the generated GraphQL query. While all other fields in the Ticket model are present, I cannot fetch or use the data for purchasedTickets in my queries.
Environment
Backend: Separate backend repository
Frontend: Separate frontend repository
GraphQL: Using automatically generated queries
The text was updated successfully, but these errors were encountered: