An experimental, lightweight GraphQL wrapper for the OpenCritic API.
npm install
npm start
The server will run on localhost:4000 by default
There is one simple integration test that can be run with:
npm run test
The server uses apollo-server. It is run with babel-node to support imports (for ease of organizing typedefs and resolvers) and runs with nodemon.
The server uses Apollo data sources for fetching and deduplication. Running the server with npm run debug will log the OpenCritic API requests being made.
I didn't take the time to wrap the entire REST API, but through this endpoint you can:
- Search games by keyword
- Retrieve information about a game
- Get the review snippets and scores for each game
There are typedefs for the following fields from OpenCritic's API:
- Game
- Platform
- Review
- Outlet
- Author
query {
games(filter: "witcher 3") {
id
name
Platforms {
shortName
}
Reviews {
snippet
score
}
}
}
OpenCritic's Swagger docs can be found here.