Skip to content

schlpbch/graphql-django

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GraphQL commands

Query

Query links

query {
  links {
    id
    description
    url
  }
}

Query Users

query {
  users {
    id
    username
    password
  }
}

Query Votes

query {
  votes {
    id
    user {
      id
      username
    }
    link {
      id
      url
    }
  }
}

Query with filter

query {
  links(search: "schlpbch") {
    id
    description
    url
  }
}

Mutate

Create link:

mutation {
  createLink(
    url: "https://github.com",
    description: "Where the world builds software"
  ) {
    id
    description
    url
  }
}
mutation {
  createLink(
    url: "https://github.com/schlpbch",
    description: "Schlpbch's GitHub"
  ) {
    id
    description
    url
    postedBy {
      id
      username
      email
    }
  }
}

Create user:

mutation {
  createUser(
    username: "schlpbch",
    email: "[email protected]",
    password: "424242"
  ) {
    user {
      id
      username
      email
    }
  }
}

Create Vote

mutation {
  createVote(linkId: 1) {
    user {
      id
      username
      email
    }
    link {
      id
      description
      url
    }
  } 
}

About

Playing with GraphQL

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages