Checks if the query is valid, if not returns an error string.
Parses the given string into a caliban.parsing.adt.Document object or fails with a caliban.CalibanError.ParsingError.