Skip to content

Document how to call the GraphQL API outside the playground - #734

Merged
ZeldaZach merged 1 commit into
mainfrom
docs-graphql-api-access-665
Sep 8, 2026
Merged

ZeldaZach merged 1 commit into
mainfrom
docs-graphql-api-access-665

Conversation

@ZeldaZach

Copy link
Copy Markdown
Member

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 Bearer token in a subsection under it, with no endpoint URL and no path to getting a token.

docs/mtggraphql/index.md

  • Endpoint — POST https://graphql.mtgjson.com/, JSON body with a query property, and a note that opening it in a browser loads the playground.
  • Authorization — promoted out of the playground subsection, with numbered steps for obtaining a token (Patreon, then ask on Discord).
  • Querying Outside of the Playground — a curl invocation and a fetch example. The curl command was run verbatim against the live endpoint and returns both Phelddagrif printings.
  • The playground's auth subsection now links to #authorization instead of repeating the "contact us" line.

docs/faq/index.md

New entry, "How do I query the GraphQL API?", carrying the curl example and the token path and linking to /mtggraphql/#usage.

markdownlint passes 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

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

codecov Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (c0e3035) to head (eab901c).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ZeldaZach
ZeldaZach merged commit 6782a01 into main Sep 8, 2026
5 checks passed
@ZeldaZach
ZeldaZach deleted the docs-graphql-api-access-665 branch September 8, 2026 18:14
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.

no doucmentation for accessing the api

1 participant