Skip to content

feat: support query via GET#47

Merged
k1LoW merged 3 commits into
mainfrom
support-get-query
Dec 16, 2025
Merged

feat: support query via GET#47
k1LoW merged 3 commits into
mainfrom
support-get-query

Conversation

@k1LoW
Copy link
Copy Markdown
Contributor

@k1LoW k1LoW commented Dec 15, 2025

WHAT

Added support for GraphQL queries via GET requests, following the GraphQL over HTTP specification.

New APIs

  • TestWithMethod(t TestingT, method string) - Start a new test with a specified HTTP method

WHY

The GraphQL over HTTP specification supports the use of GET method for query operations.

GET requests for queries are useful in the following scenarios:

  • Leveraging HTTP caching (CDN, browser cache, etc.)
  • Bookmarkable query URLs
  • Testing GraphQL servers that only enable GET transport

This PR enables gqlcheck to test GraphQL servers that use GET transport.

@k1LoW k1LoW self-assigned this Dec 15, 2025
@k1LoW k1LoW marked this pull request as ready for review December 15, 2025 09:12
@k1LoW k1LoW requested a review from a team as a code owner December 15, 2025 09:12
Instead of separate methods like `QueryViaGet()` and `QueryViaGetWithVariables()`,
introduce `TestWithMethod(t, method)` to specify the HTTP method at test start.

This simplifies the API:
- Before: `checker.Test(t).QueryViaGet(q)`
- After:  `checker.TestWithMethod(t, http.MethodGet).Query(q)`
Copy link
Copy Markdown
Contributor

@ikawaha ikawaha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙆‍♀️ LGTM

@k1LoW k1LoW added the Type: Feature It's exciting new feature label Dec 16, 2025
@k1LoW k1LoW merged commit 5ed1d69 into main Dec 16, 2025
2 checks passed
@k1LoW k1LoW deleted the support-get-query branch December 16, 2025 02:00
@k1LoW k1LoW added breaking-change Breaking compatibility and removed breaking-change Breaking compatibility labels Dec 22, 2025
@k1LoW
Copy link
Copy Markdown
Contributor Author

k1LoW commented Dec 22, 2025

@ikawaha
The generation of Bearer token headers has been fixed ( WithBearerAuth ). While I consider this a bug fix, it could also be classified as a BREAKING CHANGE.

@github-actions github-actions Bot mentioned this pull request Dec 23, 2025
@k1LoW k1LoW added the minor label Dec 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor Type: Feature It's exciting new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants