This is a GraphQL server application to be used with a sibling React application for demo and training purposes. This application has a simple schema for the display of a handful of Marvel Villain characters. After installation, you can view the GraphQL API UI for testing at http://localhost:8082/graphiql. The endpoint path to target from an external application is http://localhost:8082/graphql
.
- Express
- GraphQL
- GraphQL Tools
- Apollo Server Express
- Babel transpiling
- Install yarn or also use
npm
for dependencies. - Install packages with
yarn install
ornpm install
- Run the server with
yarn start
ornpm start
and visithttp://localhost:8082
The GraphQL API UI will provide a method to test queries, which you can then replicate in our secondary application. Here are some quick schema constructs which have been added by default.
# Show all Villains with the following properties
{
allVillains {
id
name
age
weight
image
description
powers
first_appearance
}
}
# Filter villains by ID
{
villain(id: 4) {
id
name
}
}
# Show count of Villains
{
totalVillains
}