Open developerKumar opened 5 years ago
Seems to be an issue with amplify cli graphql compile. The generated schema in amplify/backend/api/chatqlv2/schema.graphql
generates nextToken as type String when it should be type Int for ElasticSearch.
Wrong:
69: searchMessages(filter: SearchableMessageFilterInput, sort: SearchableMessageSortInput, limit: Int, nextToken: String): SearchableMessageConnection
70: searchUsers(filter: SearchableUserFilterInput, sort: SearchableUserSortInput, limit: Int, nextToken: String): SearchableUserConnection
71: searchConvoLinks(filter: SearchableConvoLinkFilterInput, sort: SearchableConvoLinkSortInput, limit: Int, nextToken: String): SearchableConvoLinkConnection
Correct:
69: searchMessages(filter: SearchableMessageFilterInput, sort: SearchableMessageSortInput, limit: Int, nextToken: Int): SearchableMessageConnection
70: searchUsers(filter: SearchableUserFilterInput, sort: SearchableUserSortInput, limit: Int, nextToken: Int): SearchableUserConnection
71: searchConvoLinks(filter: SearchableConvoLinkFilterInput, sort: SearchableConvoLinkSortInput, limit: Int, nextToken: Int): SearchableConvoLinkConnection
There is a easy way to fix it 1) Login to the aws AppSync console,and edit Schema. 2) change the type of nextToken: Stirng to nextToken: Int 3) save the schema 4) It'll work wel
I have created two users. I am trying to search via username, But it's not working. After analyzing network tab response, I am getting an error from the server as follows:
{"data":null,"errors":[{"path":null,"locations":[{"line":2,"column":71,"sourceName":null}],"message":"Validation error of type VariableTypeMismatch: Variable type 'Int' doesn't match expected type 'String' @ 'searchUsers'"}]}
Please help me.