node server.js
query {
greeting
}
Server
npm start
Client
npm start
- Get Jobs
query {
jobs {
id
title
company {
id
name
}
}
}
- Get Job
query JobQuery($id: ID!) {
job(id: $id) {
...JobDetail
}
}
fragment JobDetail on Job {
id
title
company {
id
name
}
description
}
Variables
{
"id": "J-ONE"
}
- Get Company
query ComapnyQuery($id: ID!) {
company(id: $id) {
id
name
description
jobs {
id
title
}
}
}
Variables
{
"id": "C-ONE"
}
- Create Job
mutation CreateJob($input: CreateJobInput) {
job: createJob(input: $input) {
id
title
company {
id
name
}
description
}
}
Variables
{
"input": {
"title": "New Job",
"description": "This is a new Job"
}
}
Headers
{
"authorization": "Bearer <YOUR TOKEN>"
}
Server
npm start
Client
npm start
subscription {
messageAdded {
id
from
text
}
}