Add a method for validation of graphql queries
Created by: camdencheek
This commit adds graphqlbackend.ValidatedQuery
and
graphqlbackend.ValidatedQueryWithVariables
, which are intended to help
ensure that our GraphQL queries are up to date with the schema.
Motivation: This is meant to help mitigate situations like those that caused #21494. The GraphQL query used a field that was removed, and we didn't catch it for a month since it was just exposed in log messages. If we'd been using a validated query, this would catch that situation. This PR adds validation to the query that was failing. If this is accepted, I'll likely make some followup PRs adding it to other queries in the codebase.