Skip to content

[Feat][V3] Graphql rework - REQUEST FOR COMMENT#1084

Open
thomas-bassett wants to merge 11 commits intotcgdex:masterfrom
thomas-bassett:graphql-rework
Open

[Feat][V3] Graphql rework - REQUEST FOR COMMENT#1084
thomas-bassett wants to merge 11 commits intotcgdex:masterfrom
thomas-bassett:graphql-rework

Conversation

@thomas-bassett
Copy link
Copy Markdown
Contributor

@thomas-bassett thomas-bassett commented Jan 26, 2026

This PR is a full rework of the GraphQL endpoint and is likely to change. This PR is open for others to build locally and test.

With this version of then GraphQL endpoint, it completely removes the Brief/Full object structure and allows full top down and bottom up searching of every value in the API.

This is likely to have some issues and will need further work and discussion, reach out to me on discord at @Thomas (snoogle13) with any issues for me to have a look at.

this version of graphql is available under the v3 endpoint
/v3/graphql

Multilang Support

this adds multi Lang support for cards, sets and series with the use of the new locales object. You can still request translatable fields in the root object but can add this new object and a selection of language filters to get addition information in one language

example query:

query {
  cards(filters: { id: "eq:base1-1" }) {
    id
    locales(langs: ["en", "fr", "de"]) {
      lang
      name
      attacks {
        name
        damage
        effect
        cost
      }
      description
    }
  }
}

locales accepts all the same fields from the card object except for fields like id as they are the same

except for when cards cross the International > Asia boundary this still will not work to translate these as there is no mapping currently to get them. Currently cards must share an id for them to be found

example return:

{
  "data": {
    "cards": [
      {
        "id": "base1-1",
        "locales": [
          {
            "lang": "en",
            "name": "Alakazam",
            "description": null
          },
          {
            "lang": "fr",
            "name": "Alakazam",
            "description": "Son super cerveau peut effectuer des opérations plus rapidement qu'un super ordinateur. Il a un Q.I. de 5000."
          },
          {
            "lang": "de",
            "name": "Simsala",
            "description": null
          }
        ]
      }
    ]
  }
}

Restores the main async compilation logic by uncommenting code that loads remote sources, cleans the dist folder, loads git info, and compiles endpoint files for each language. This enables the compiler to function as intended instead of being disabled by commented code.
Uncommented and activated the 'sets' query in the GraphQL schema and resolver. Updated Set.ts to properly transform sets and include card details for each set. This allows clients to fetch sets with their associated cards.
@Aviortheking

This comment was marked as off-topic.

@Aviortheking Aviortheking reopened this Mar 9, 2026
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.

2 participants