Git Product home page Git Product logo

mtgjson-graphql-v2's Introduction

MTGJSON GraphQL V.2

mtgraphql logo

An Apollo GraphQL Server for mtgjson.com

Discord

This repository contains the code to run the GraphQL server via Apollo Server. Please note that you will need to set up your own PSQL server to pull from and for this to work you will need a .env file with that looks similar to this:

PORT=8000(whatever you like)
DEV_MODE=true
DB_HOST=localhost
DB_PORT=5432
DB_USER=postgres (or whatever you want)
DB_PASS=<password>
DB_DATABASE=mtgjson (or whatever you want)

EMAIL_HOST=smtp.host
EMAIL_PORT=465
[email protected]
EMAIL_PASS=pass

About


MTGJSON GraphQL is exactly what you would expect from the name, an open-source GraphQL API and Server built on top of the mtgjson data sets. This API focuses on the JSON payloads for MTGJSON specifically these:

  • Card/Cards
  • Deck/Decks
  • Set/Sets
  • SetList & DeckList (Meta-data structures for Sets & Decks)

Maintained

This codebase is maintained by Milo as part of the greater mtgjson team which can be found on the website. The hosted version of this software is available to patreons of the overall MTGJSON project in a beta status currently.

Patreon

The Beta version of MTGGraphQL is available to patrons of MTGJSON with the goal of bringing a version to our other non-patron users.

Contributing

If you would like to contribute to the development of this project please reach out on Discord or open a pull request bug fixes, new features, and more are always appreciated. Feel free to support us through code or financial contributions.

Issues

Report any bugs to issues

How to Use

Before you utilize the service you must have a valid API key to pass in the header as "authorization": Bearer <APIKey> without this you won't be authorized to utilize the API and the server will deny your request. Each key is rate limited by key and by IP so one IP can make up to 1000 requests per hour and each key can make up to 500 per hour. The rate limits are subject to change and should be reflected on the website and in this README.

Basic Query

query{
  getCard(
    input:{
      name: "Abundance"
    }
  ){
    uuid
    name
    artist
    text
  }
}

Basic Usage

To get started from scratch quickly simply clone this repository and run the following:

npm install

npm run dev

This should install the required dependencies and if you have the write .env file and environment setup then things should spin up properly and info messages should tell you the server is listening on port 8000 or whatever port you set it to be.

Navigate to localhost:8000/ and you're set, docs for Apollo, GraphQL, NodeJS, TypeORM, and TypeGraphQL can all be found online.

Advanged Usage

If you are looking to deploy this server yourself you will need to run npm run build and then npm start using whatever deployment strategies you would like.

General Usage

For most people there will be no need to download the codebase and host your own server, the plans are to host this codebase at mtgjson.com/graphql or something similar initially as a beta for patrons and possibly moving towards a wider release upon proven success.

Licensing

MTGJSON GraphQL is a freely available product under the MIT License, allowing our users to enjoy Magic: the Gathering data free of charge, in perpetuity.

mtgjson-graphql-v2's People

Contributors

milorue avatar zeldazach avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.