Unable to perform sorting using Apollo server in Dgraph

type Post {
id: ID!
title: String!
timestamp: String!
isPrivate: Boolean!
avatar: String
body: String!
isReplyEnabled: Boolean!
first: Int
offset: Int
hashtag: [String]

enum SortOrder {

enum SortableField {

input Sort {
order:SortOrder = DESC


getAllPost(sort: Sort,first: Int, offset: Int): AllPostResponse

Getting below mentioned error:


throw (0, _syntaxError.syntaxError)(source, pos, unexpectedCharacterMessage(code));

GraphQLError [Object]: Syntax Error: Cannot parse the unexpected character “\u00A0”.
at syntaxError (/home/yuvaraj/node_modules/graphql/error/syntaxError.js:15:10)
at readToken (/home/yuvaraj/node_modules/graphql/language/lexer.js:360:40)
at Lexer.lookahead (/home/yuvaraj/node_modules/graphql/language/lexer.js:75:108)
at Lexer.advance (/home/yuvaraj/node_modules/graphql/language/lexer.js:58:35)
at Parser.expectOptionalToken (/home/yuvaraj/node_modules/graphql/language/parser.js:1425:19)
at Parser.optionalMany (/home/yuvaraj/node_modules/graphql/language/parser.js:1499:14)
at Parser.parseInputFieldsDefinition (/home/yuvaraj/node_modules/graphql/language/parser.js:1065:17)
at Parser.parseInputObjectTypeDefinition (/home/yuvaraj/node_modules/graphql/language/parser.js:1049:23)
at Parser.parseTypeSystemDefinition (/home/yuvaraj/node_modules/graphql/language/parser.js:720:23)
at Parser.parseDefinition (/home/yuvaraj/node_modules/graphql/language/parser.js:150:23) {
locations: [ { line: 121, column: 1 } ]

A0 is a non-breaking space (i.e.,   in HTML), which is indeed not a valid character in GraphQL. It’s also very difficult to find because it looks like a regular space! I’m not sure if this is an intentional part of your operation or your schema, or if you inadvertently typed it (by default, it’s quite easy to mistakenly type since it’s Option-Spacebar on Mac, I believe?), but that seems like it could be the problem here.