The user will input multiple usernames and I would like to search my DynamoDB table for all each user's id in a single API call. The following is the important portion of the graphql user schema:
type User
@model
@key(name: "byName", fields: ["username"], queryField: "findUsername")
{
id: ID!
email: AWSEmail!
username: String!
firstName: String
lastName: String
createdAt: AWSDateTime
updatedAt: AWSDateTime
}
I would like to create a query which takes the list of usernames and returns each user's user id in a single api call. I am not sure how to dynamically and separately add the usernames to a query. Btw, I am using aws-amplify to help with dynamodb and graphql. This is also a React Native project.