Built with Node.JS, Express and the express-graphql package.
- Firstly clone this repo locally
- Run
npm installto install the project dependencies - Run
node index.jsornodemon index.jsto start the application
You should then be able to access the GraphiQL UI by visting http://localhost:4000/graphql
Full documentation is generated by the GraphiQL UI which can be accessed by visting http://localhost:4000/graphql
query {
course(id: 1) {
title
trainer {
name
}
url
}
}
{
"data": {
"course": {
"title": "Full Stack Track",
"trainer": [
{
"name": "Ashley Coles"
},
{
"name": "Mike Oram"
}
],
"url": "https://mayden.academy/full-stack-track/"
}
}
}
query {
courses {
title
trainer {
id
name
}
url
}
}
{
"data": {
"courses": [
{
"title": "Full Stack Track",
"trainer": [
{
"id": 2,
"name": "Ashley Coles"
},
{
"id": 1,
"name": "Mike Oram"
}
],
"url": "https://mayden.academy/full-stack-track/"
},
{
"title": "Working with Developers Workshop",
"trainer": [
{
"id": 1,
"name": "Mike Oram"
}
],
"url": "https://mayden.academy/working-with-developers-workshop/"
},
{
"title": "Introduction to WordPress for Developers",
"trainer": [
{
"id": 2,
"name": "Ashley Coles"
}
],
"url": "https://mayden.academy/introduction-to-wordpress-for-developers/"
}
]
}
}
query {
courses(topic: "Full Stack") {
title
trainer {
name
}
url
}
}
{
"data": {
"courses": [
{
"title": "Full Stack Track",
"trainer": [
{
"name": "Ashley Coles"
},
{
"name": "Mike Oram"
}
],
"url": "https://mayden.academy/full-stack-track/"
}
]
}
}
mutation {
updateCourseTopic(id: 1, topic: "cheese!") {
title
topic
url
}
}
{
"data": {
"updateCourseTopic": {
"title": "Full Stack Track",
"topic": "cheese!",
"url": "https://mayden.academy/full-stack-track/"
}
}
}
type Course {
id: Int
title: String
trainer: [Trainer]
description: String
topic: String
url: String
}
type Trainer {
id: Int
name: String
}