{"id":21530701,"url":"https://github.com/jcserv/manaql","last_synced_at":"2026-04-16T12:04:37.185Z","repository":{"id":264347516,"uuid":"891656611","full_name":"jcserv/manaql","owner":"jcserv","description":"manaql is a GraphQL API for Magic: The Gathering cards, powered by the Scryfall API.","archived":false,"fork":false,"pushed_at":"2024-12-27T04:26:47.000Z","size":650,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-17T19:21:25.308Z","etag":null,"topics":["apollo","graphql","node","postgres","prisma","typescript"],"latest_commit_sha":null,"homepage":"https://api.manaql.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jcserv.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-20T18:08:28.000Z","updated_at":"2024-11-29T15:02:49.000Z","dependencies_parsed_at":"2024-11-23T16:24:04.015Z","dependency_job_id":"81430f6f-5c76-4259-9982-230f373c3b85","html_url":"https://github.com/jcserv/manaql","commit_stats":null,"previous_names":["jcserv/manaql"],"tags_count":0,"template":false,"template_full_name":"jcserv/prisma-graphql-api-template","purl":"pkg:github/jcserv/manaql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcserv%2Fmanaql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcserv%2Fmanaql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcserv%2Fmanaql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcserv%2Fmanaql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jcserv","download_url":"https://codeload.github.com/jcserv/manaql/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcserv%2Fmanaql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31884931,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T11:36:10.202Z","status":"ssl_error","status_checked_at":"2026-04-16T11:36:09.652Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apollo","graphql","node","postgres","prisma","typescript"],"created_at":"2024-11-24T02:09:47.447Z","updated_at":"2026-04-16T12:04:37.179Z","avatar_url":"https://github.com/jcserv.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# manaql\n\n\u003e [!IMPORTANT]\n\u003e\n\u003e ManaQL is not meant to be a replacement for Scryfall, and was intended to be a minimally-viable-replacement for the usecase highlighted.\n\nmanaql is a GraphQL API for Magic: The Gathering cards, powered by the [Scryfall API](https://scryfall.com/docs/api/bulk-data).\n\nIt currently supports basic search features (see the example queries section below) for Magic: The Gathering web applications, namely:\n\n- get cards and all their printings, by card name(s)\n- autocomplete card names\n\n## why?\n\nI built this to be used by [bling-my-deck](https://github.com/jcserv/bling-my-deck), which has a need to query for\n{cards and all their printings, by card name}, which wasn't supported by Scryfall.\n\nalso, as a learning experience!\n\n## where's the data coming from?\n\ncheck out [manaql-ingest](https://github.com/jcserv/manaql-ingest) for the data ingestion pipeline!\n\n## installation\n\n### prerequisites\n\n- [node.js](https://nodejs.org/en)\n- [pnpm](https://pnpm.io/installation)\n- [docker](https://docs.docker.com/get-started/get-docker/)\n\n### running locally\n\n1. clone this repo\n2. run `pnpm i`\n3. run `pnpm dev:db`\n4. run `pnpm dev`\n5. visit http://localhost:4000/graphql in your browser\n\n### running tests\n\n1. run `pnpm test:db:down`\n2. run `pnpm test:db`\n3. run `pnpm test`\n\n## example queries\n\nPOST https://api.manaql.com/graphql\n\n\u003cdetails\u003e\n  \u003csummary\u003eGet cards by name and all of their printings\u003c/summary\u003e\n  \n  ### Request\n  ```graphql\n  query Cards($filter: CardFilter!, $first: Int) {\n    cards(filter: $filter, first: $first) {\n      edges {\n        node {\n          cardId\n          name\n          mainType\n          printings {\n            edges {\n              node {\n                id\n                set\n                imageUri\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n  ```\n\n### Variables\n\n```json\n{\n  \"filter\": {\n    \"fields\": [\"name\"],\n    \"operator\": \"eq\",\n    \"query\": [\n      \"Animate Dead\",\n      \"Arachnogenesis\",\n      \"Assassin's Trophy\",\n      \"Azusa, Lost but Seeking\",\n      \"Bala Ged Recovery\",\n      \"Baba Lysaga, Night Witch\"\n    ]\n  },\n  \"first\": 10\n}\n```\n\n\u003c/details\u003e\n\n\u003cbr /\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eGet cards by name and all of their printings, filtering by certain finishes and sets\u003c/summary\u003e\n  \n  ### Request\n  ```graphql\n  query ExcludeCertainFinishesAndSets($filter: CardFilter!, $first: Int, $filters: [PrintingFilter!]) {\n    cards(filter: $filter, first: $first) {\n      edges {\n        node {\n          cardId\n          name\n          mainType\n          printings(filters: $filters) {\n            edges {\n              node {\n                id\n                set\n                imageUri\n                finishes\n                set\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n  ```\n\n### Variables\n\n```json\n{\n  \"filter\": {\n    \"fields\": [\"name\"],\n    \"operator\": \"eq\",\n    \"query\": [\n      \"Animate Dead\",\n      \"Arachnogenesis\",\n      \"Assassin's Trophy\",\n      \"Azusa, Lost but Seeking\",\n      \"Bala Ged Recovery\",\n      \"Baba Lysaga, Night Witch\"\n    ]\n  },\n  \"first\": 10,\n  \"filters\": [\n    {\n      \"fields\": \"set\",\n      \"operator\": \"ne\",\n      \"query\": [\n        \"sld\"\n      ]\n    },\n    {\n      \"fields\": \"finishes\",\n      \"operator\": \"co\",\n      \"query\": [\"nonfoil\", \"foil\"] // if you want to exclude a finish, just don't include it in the query\n    }\n  ]\n}\n```\n\n\u003c/details\u003e\n\n\u003cbr /\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eAutocomplete/typeahead\u003c/summary\u003e\n\n### Request\n\n```graphql\nquery Autocomplete($filter: CardFilter!, $first: Int) {\n  cards(filter: $filter, first: $first) {\n    edges {\n      node {\n        cardId\n        name\n      }\n    }\n  }\n}\n```\n\n### Variables\n\n```json\n{\n  \"filter\": {\n    \"fields\": [\"name\"],\n    \"query\": [\"Baba Ly\"],\n    \"operator\": \"sw\"\n  },\n  \"first\": 10\n}\n```\n\n### Response\n\n```json\n{\n  \"data\": {\n    \"cards\": {\n      \"edges\": [\n        {\n          \"node\": {\n            \"cardId\": \"10561\",\n            \"name\": \"Baba Lysaga, Night Witch\"\n          }\n        }\n      ]\n    }\n  }\n}\n```\n\n\u003c/details\u003e\n\n\u003cbr /\u003e\n\nTODO:\n\n- better fuzzy searching\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcserv%2Fmanaql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjcserv%2Fmanaql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcserv%2Fmanaql/lists"}