Skip to content

jawakarD/hackernews-2.0

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example queries

links

{
  allLinks{
    id
    url
    description
    postedBy {
      id
      name
      email 
      votes {
        id
      }
    }
  }
}	

Create link

mutation {
  createLink(input: {url: "https://npmjs.com/graphql-tools", description: "Just following guide"}){
    link{
      id
      url
      description	
      postedBy {
        id
        name
      }
    }
  }
}

#

mutation{
  createUser(
    input: {
      name: "Jawakar", 
      authProvider: {
        credentials: {
          email: "jawakar2@gmail.com",
          password: "1233456"
        }	
  		},	
  	}
  ){
    user  {
      id
      name
      email
    }
  }
}

Login

mutation{
  signinUser(
    input: {
      credentials: {
        email: "jawakar2@gmail.com",
        password:"1233456"
      }
    }
  ){
    token
    user{
      id
      name
      email
    }
  }
}

Vote for link

mutation{
  createVote(input: {linkId: 14}){
    vote{
      id
      link {
        id
        url
        description
      },
      user {
        id
        name
        email
      }
    }
  }
}