fpl-api-graphql
A GraphQL node wrapper for the Fantasy Premier League (fantasy.premierleague.com) REST apis, updated for the 2019/20 season.
Installation
npm install fpl-api-graphql --save
Usage
const typeDefs resolvers = ;
The package exposes GraphQL typeDefs
(a schema description as a GraphQL type language string) and resolvers
.
There are no assumptions about the implementation. If serving over http the package would typically be consumed with either express-graphql or apollo-server.
Example
This example uses express-graphql to serve over http and graphql-tools to build an executable schema.
const express = ;const graphqlHTTP = ;const makeExecutableSchema = ;const typeDefs resolvers = ; // build executable schema from typedefs and resolversconst schema = ; // express appconst app = ; // graphqlapp; // serveapp;
The GraphQL server will be available at http://localhost:3000/graphql and the GraphiQL IDE will also be available in the browser.
TODO
- More documentation
- Unit tests