Skip to content

Back-end for the Dream App using Node.js with Express, Graphql, MongoDB w/ Mongoose.

Notifications You must be signed in to change notification settings

amlane/dream-graphql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dream API

Mutations

Add user

mutation{
  addUser(sub:"429721", name:"Amanda", email:"[email protected]"){
    sub
    name
    email
    id
    created_at
  }
}

Add dream

mutation{
  addDream(title:"title", content:"content test", category:"nightmare", user_id: "5dce198e5beb024a6453fdbd"){
    id
    title
    content
    category
    created_at
  }
}

Delete dream

mutation{
  removeDream(id:"5dce2205ddb1114a34582af7"){
    id
  }
}

Edit dream

mutation{
  editDream(id:"5dce1d6640b93109fceca2e0", title:"NewTitle", content:"new content", category:"nigtmare"){
    id
    title
    content
    category
    created_at
  }
}

Queries

Get users

{
  users{
    sub
    name
    email
    id
    created_at
    dreams{
      id
      title
      content
      category
      created_at
    }
  }
}

Get User by Sub

{
  user(sub:"429721"){
    id
    sub
    name
    email
    created_at
    dreams{
      id
      title
      content
      category
      created_at
    }
  }
}

About

Back-end for the Dream App using Node.js with Express, Graphql, MongoDB w/ Mongoose.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published