Skip to content

Testing: validate our GraphQL queries against GHES schema - #3689

Closed
mislav wants to merge 1 commit into
trunkfrom
graphql-validate
Closed

Testing: validate our GraphQL queries against GHES schema#3689
mislav wants to merge 1 commit into
trunkfrom
graphql-validate

Conversation

@mislav

@mislav mislav commented May 21, 2021

Copy link
Copy Markdown
Contributor

To ensure we don't generate GraphQL queries that aren't compatible with an older version of the GitHub API (GHES), we'd like to come up with a mechanism to validate each GraphQL query that we generate in tests against a GraphQL schema.

WIP:

$ make ghes-2.21.graphql
$ go run ./cmd/gql-validate ghes-2.21.graphql '{viewer}'
query error: input:1: Field "viewer" of type "User!" must have a selection of subfields. Did you mean "viewer { ... }"?

exit status 1

TODO:

  • Hook into our test suite (probably httpmock.GraphQL calls) and verify each GraphQL query against the schema of the oldest supported Enterprise version
  • Figure out how to handle queries that we dynamically generate based on schema instrospection

Ref. #3688 #2996 #2035

@mislav

mislav commented Jun 9, 2023

Copy link
Copy Markdown
Contributor Author

Punting on this.

@mislav mislav closed this Jun 9, 2023
@samcoe
samcoe deleted the graphql-validate branch June 28, 2023 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant