First, the server parses the string and turns it into an AST — an abstract syntax tree.
If there are any syntax errors, the server will stop execution and return the syntax error to the client.
Validation
A query can be syntactically correct, but still make no sense.
The validation stage makes sure that the query is valid given the schema before execution starts.