I have the following schema in AppSync for GraphQL
input CreateTeamInput {
name: String!
sport: Sports!
createdAt: String
}
enum Sports {
baseball
basketball
cross_country
}
type Mutation{
createTeam(input: CreateTeamInput!): Team
}
However when I try to execute the query using AWS Amplify library via
export const CreateTeam = `mutation CreateTeam($name: String!, $sport: String!){
createTeam(input:{name:$name, sport:$sport}) {
id,
name,
sport
}
}
`;
....
API.graphql(graphqlOperation(CreateTeam, this.state))
I get the following error: Validation error of type VariableTypeMismatch: Variable type doesn't match
.
How can I update my code to work with this enum type?