Skip to content

Ambro17/pyconar-graphql

Repository files navigation

PyconAr GraphQL Playground

PyconAr GraphQL Playground is a playground for anyone who wants to learn graphql interactively.

Screenshot The repo has different kind of query resolvers, backed by

  • DB Models
  • JSON Files
  • REST Calls

This is to demonstrate that there are no hard constraints on implementation details. We're free to do whatever fits better in our tech stack.

Query Examples

What are the upcoming talks?

{
  nextTalks {
    name
    description
    speaker {
      name
      bio
    }
  }
}

What are the names of all people that ever gave a talk on pyconar?

{
  allTalks {
    speaker {
      name
    }
  }
}

Are there people open to receive offers?

{
  findPeopleOpenToHiring {
    name
    email
    interests
  }
}

Are there companies looking to fill positions?

{
  findOpenPositions {
    title
    url
    company {
      name
      website
      technologies
    }
  }
}

Are there people interested in GraphQL?

{
  findPeopleInterestedIn(interest: "GraphQL") {
    name
    email
    openToJobOffers
  }
}

What talks should i see if i'm interested in microservices?

{
  searchTalks(keywords: ["microservicios", "microservices"]) {
    name
    description
    video
  }
}

Run it Locally

To run the server follow these steps:

python3 -m venv venv && source venv/bin/activate && pip install -r requirements.txt
export FLASK_APP="pyconar.app:create_app()"
flask run

If you have docker installed you can start it with

docker build . -t pyconar-graphql
docker run -it -p 5050:5050 pyconar-graphql

You can also deploy to heroku with just one click

Deploy

Endpoints

  • / GraphiQL IDE with Explorer Plugin
  • /dark Playground IDE with dark theme and multitab docs navigation
  • /explorer Api Schema Visualizer with graphqql voyager`

Features

  • IDE in Browser. To explore the API interactively
  • Interactive Graph Explorer. A visually compelling view of the API
  • Mutation Example. Useful Patterns to alter data
  • Error Handling. HTTP, what's that?

About GraphQL

GraphQL is a new paradigm in API Design that is rapidly growing in popularity. Although it's not a replacement of REST, it does help solve some of its most frequent problems. I hope that exploring the API you can get a taste of the benefits of GraphQL and perhaps motivate you to write your own GraphQL PoC for your next big project.

TODO

  • DoS Protection
  • Remove custom GraphiQL html as it has bugs
  • Improve Mutations Auth