I want to create a query that will trigger the lambda function. I have created schema.graphql file as below, but I am getting "Syntax Error: Unexpected Name". It is unclear why the name of the query is the unexpected name.
type GetDashboardHeaderCountOutput {
instituteCnt: Int,
memberCnt: Int,
tournamentCnt: Int
}
type Query {
getDashboardHeaderCount: GetDashboardHeaderCountOutput #Line 84
@function(name: "getDashboardHeaderCount-${env}")
@auth(
rules: [
{
allow: groups
groups: ["AdminGroup"]
}
]
)
}
Please help me why I am getting the following error?
{
"name": "GraphQLError",
"classification": "ERROR",
"options": {
"message": "Syntax Error: Unexpected Name \"getDashboardHeaderCount\"."
},
"downstreamException": {
"message": "Syntax Error: Unexpected Name \"getDashboardHeaderCount\".",
"locations": [
{
"line": 84,
"column": 3
}
]
},
"link": "https://docs.amplify.aws/cli/project/troubleshooting/"
}
For anyone who has a similar problem, this was my solution.
It seems that amplify was broken due to some reason, and re creating it resolve the problem.