Skip to content

It is a poll system API based on graphql and Django

License

Notifications You must be signed in to change notification settings

CPCoders/Poll-API-D

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Poll-API-D

It is a poll system API based on graphql and Django

Installation:

$cd Polls $pip3 install pipenv $pipenv shell $pip3 install django $pip3 install graphene-django $python manage.py makemigrations $python manage.py migrate $python manage.py runserver

Executing queries

//You will get an url append /graphql at end of it //You will get into graphiql ide on entering the appended url //For accessing API in other way view official documentation

QUERY SYNTAX

mutation createArea {
  createArea(input: {name: "Sonari",winningParty:"None",oppositionParty:"None",winner:"None",opposition:"None"}) 
  {
    ok
    area
    {
      id
      name
      winner
      winningParty
      oppositionParty
    }
  }
}

mutation deleteArea {
  deleteArea(id:2) {
    ok
    area 
    {
      id
      name
      winningParty
      oppositionParty
    }
  }
}

mutation updateArea {
  updateArea(id:1,input: {name: "Anari",winningParty:"None",oppositionParty:"None",winner:"None",opposition:"None"}) 
  {
    ok
    area
    {
      id
      name
      winner
      winningParty
      oppositionParty
    }
  }
}

mutation pollArea {
  pollArea(id:1,input: {name: "Sonari"}) 
  {
    ok
   area
   {
      id
      name
      winningParty
      oppositionParty
      opposition
      winner
    }
  }
}

mutation createVoter 
{
  createVoter(input: {name: "Prithwiraj", partyPrefered: "Congress", place: "Sonari", age: 24}) 
  {
    ok
   voter {
      id
      name
      partyPrefered
      place
      age
    }
  }
}

mutation updateVoter
{
  updateVoter(id:5,input: {name: "Prithwiraj", partyPrefered: "Congress", place: "Sonari", age: 24})
  {
    ok
   voter 
   {
      id
      name
      partyPrefered
      place
      age
    }
  }
}

mutation deleteVoter 
{
  deleteVoter(id:4)
  {
    ok
    voter 
    {
      id
      name
      partyPrefered
      place
    }
  }
}


mutation castVoter
{
  castVoter(id:4,input: {name: "Prithwiraj", partyPrefered: "Congress", place: "Sonari", age: 22}) 
  {
    ok
   voter
   {
      id
      name
      partyPrefered
      place
      age
    }
  }
}

mutation createCandidate 
{
  createCandidate(input: {name: "Prithwi", party: "Congress", place: "Sonari", age: 27,votes:0})
  {
    ok
   candidate
   {
      id
      name
      party
      place
      age
    }
  }
}

mutation updateCandidate
{
  updateCandidate(id:2,input: {name: "Prithwi", party: "Congress", place: "Sonari", age: 27,votes:0}) 
  {
    ok
   candidate 
   {
      id
      name
      party
      place
      age
    }
  }
}

mutation deleteCandidate 
{
  deleteCandidate(id:2)
  {
    ok
    candidate
    {
      id
      name
      party
      place
      votes
    }
  }
}

Status

Repository status(badge):

All Contributors Version

Getting started

  • Fork the repository.
  • Clone it to your machine.

Code of Conduct

We really appreciate the keen interest and the overall work culture we create by working together as a team with various unique experiences and minds culminated into a single project. This is only possible if we respect each other.

Kindly go through our Code of Conduct to take a moment and familiarise with the spirit of opensource.

Contributing Guide

If you're have worked on the front-end part make PR to the front-end branch and same goes for the back-end too.

PR rules:

  • Kindly follow the Pull Request template provided.

For more details kindly go through our Contributing Guidelines.

Contributors ✨

Thanks goes to these wonderful people (emoji key):


prskid1000

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

About

It is a poll system API based on graphql and Django

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages