/graphql-test

graphql testing

Primary LanguageJavaScript

Sandbox for testing

DEMO

Get all movies

{
  movies {
    name
    genre
  }
}

Get all the directors

{
  directors {
    name
    age
  }
}

Add a director

mutation ($name: String!, $age: String!) {
  addDirector(name: $name, age: $age) {
    name
    age
  }
}

//add query vaiables
{
  "name": "Steven Spielberg",
  "age": "76"
}

Add Movie

mutation ($name: String!, $genre: String!, $directorId: ID) {
  addMovie(name: $name, genre: $genre, directorId: $directorId) {
    name
    genre
  }
}

//add query vaiables
{
  "name": "Jaws",
  "genre": "Thriller",
  "directorId": "test24"
}

Update Director

mutation ($id: ID, $name: String!, $age: String!)
  updateDirector(id: $id, name: $name, age: $age) {
    name
    age
  }


//add query vaiables
{ "id": "63b438fc17c7360034080576",
  "name": "Steven Spielberg",
  "age": "77"
}

Update movie

mutation ($id: ID, $name: String!, $genre: String!, $directorId: ID) {
  updateMovie(id: $id, name: $name, genre: $genre, directorId: $directorId) {
    name
    genre
  }
}

//add query vaiables
{ "id": "63b4362917c736003408056d",
  "name": "Jaws",
  "genre": "Drama",
  "directorId": "test42"
}