refactor: move query pipeline into internal package
Created by: rvantonder
- Moves the parse-check-validate pipeline to the query package.
- Separates error-to-alert conversion, and keeps it in the GQL resolver.
- Introduces a ValidationError
- Format some tests