Skip to content

manjunath24/polls-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Installation

  1. Create virtualenv
  2. Goto the project root directory and run pip install -r requirements.txt
  3. run python manage.py migrate
  4. Visit http://127.0.0.1:8000/graphql/ and start playing with GraphQL!

Some examples

Query

  • Get list of poll questions
query {
  questions {
    id,
    questionText,
    pubDate
  }
}
  • Get list of poll questions with choice(s)
query {
  questions {
    id,
    questionText,
    pubDate,
    choices {
      id,
      choiceText
    }
  }
}

Mutation

  • Create a poll question
mutation {
  createQuestion(
    questionText: "What is GraphQL?",
    pubDate: "2019-01-01T00:00:00"
  ) {
    question {
      id,
      questionText,
      pubDate
    }
  }
}
  • Update a specific poll question
mutation {
  updateQuestion(
    id: 1,
  	questionText: "My poll question"
  ) {
    question {
      id,
      questionText,
      pubDate
    }
  }
}
  • Delete a specific poll question
mutation {
  deleteQuestion(
    id: 1,
  ) {
    message
  }
}

About

Polls app using django graphene

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages