Skip to content
Recipes App using Node.js, GraphQL(Apollo Server) and MongoDB
Branch: master
Clone or download
Latest commit 2a48d57 Mar 30, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src add chef recipes nested resolver Mar 27, 2018
.babelrc integrate the elements with graphiql Mar 26, 2018
.gitignore Initial Commit Mar 20, 2018
README.md Create README.md Mar 30, 2018
package-lock.json integrate the elements with graphiql Mar 26, 2018
package.json integrate the elements with graphiql Mar 26, 2018
yarn.lock Initial Commit Mar 20, 2018

README.md

Recipes App

A Simple app that allows you to create:

  • Food Recipes
  • Categoeis belongs to this recipes.
  • Chefs for the recipes.

Recipes App using

Node.js, GraphQL(Apollo-Server) and MongoDB.

You want to try it?

npm run serve

GraphQL endpoint URL:PORTNumber/graphql

GraphQL Interactive docs URL:PORTNumber/docs

Examples :

Create New Category

and return only the id and title of the newly created element.

mutation createNewCategory($input: newCategoryInput!) {
  newCategory(category: $input) {
    id
    title
  }
}

and the input will be

{
  "input": {
    "title": "MiddleEast Food"
  }
}

Create New Chef:

mutation createNewChef($input: newChefInput!) {
  newChef(chef: $input) {
    id
    name
  }
}

# the Input
{
  "input": {
    "name": "Ahmad",
    "email": "ama@me.yes",
    "phoneNumber": "123654"
  }
}

Create New Recipe:

mutation createNewRecipe($input:newRecipeInput!){
  newRecipe(recipe:$input){
    id
    title
    description
  }
}

# Input
{
  "input": {
    "title": "Test",
    "description": "ABC",
    "category": "5ab924fbd5109b267428eb0a",
    "chef": "5ab93e5dd232655140412a12"
  }
}

Querying:

You can ask for single item and get only the fields that you want

{
  singleRecipe(id: "IDXFD") {
    id
    title
    category {
      id
      title
    }
    chef {
      id
      name
    }
  }
}

List all of the categories, chefs and recipes

{
  categories {
    id
    title
  }
  chefs {
    id
  }
  recipes{
    id
    title
  }
}
You can’t perform that action at this time.