Document how to call the GraphQL API outside the playground - #734
Merged
Merged
Conversation
The MTGGraphQL page explained the playground but never said where to send a request from your own code, and the only mention of access tokens was buried in a playground subsection with no way to get one. Add Endpoint, Authorization, and Querying Outside of the Playground sections with curl and fetch examples, and a matching FAQ entry. Closes #665 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Xba7S7uYsrKAVdniqNcfhS
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #734 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 69 69
Branches 27 27
=========================================
Hits 69 69 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #665
The reporter could not find how to query MTGGraphQL from their own code, or how to obtain the access token the playground asks for. The page documented the playground and mentioned a
Bearertoken in a subsection under it, with no endpoint URL and no path to getting a token.docs/mtggraphql/index.mdPOST https://graphql.mtgjson.com/, JSON body with aqueryproperty, and a note that opening it in a browser loads the playground.curlinvocation and afetchexample. The curl command was run verbatim against the live endpoint and returns both Phelddagrif printings.#authorizationinstead of repeating the "contact us" line.docs/faq/index.mdNew entry, "How do I query the GraphQL API?", carrying the curl example and the token path and linking to
/mtggraphql/#usage.markdownlintpasses and the site builds with no dead links.One thing to flag: the endpoint currently answers unauthenticated requests, prices included. These docs say to send a token, which matches the intended policy, but anyone testing will find it works without one.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Xba7S7uYsrKAVdniqNcfhS