Giter Site home page Giter Site logo

falcon-graphene's Introduction

Get started

  1. Stand up a mongo instance

    Docker:-

      docker run -d -p 27017:27017 --name mongoDB -e MONGO_INITDB_ROOT_USERNAME=mongoadmin -e MONGO_INITDB_ROOT_PASSWORD=secret mongo:latest
    
  2. Clone this repository

    https://github.com/sreehari-aot/falcon-graphene.git

  3. Create virtual environment and activate

    https://docs.python.org/3/library/venv.html

  4. Install dependencies

    pip install -r requirements.txt

  5. Rename sample.env to .env

  6. run python script.py

    data should be saved to the database if all the steps are followed as mentioned

  7. Starting the application server

    • check into /api directory
    • run python app.py

    application server should be up and running by now

  8. Query data with Grapghql

    • countriesQuery - return a list of countries

      query {
          countries {
              name
              currencies
              capital
              language
              latlng
              maps
              population
              continents
              flags
              postalCode
          }
      }
      
      
    • countryQuery - take country id as an argument and return details of single country raise error if id is invalid

      query {
          country (id: "{country id}") {
              name
              ...
          }
      }
      
      
    • countriesNearby - take location cocordinates and return list of nearest countries

      query {
          nearby (coordinates: [{lat}, {lng}]) {
              name
              ...
          }
      }
      
    • countriesByLanguage - take a language string and return a list of countries speaking that language

      query {
          lang (language: "English") {
              name
              ...
          }
      }
      

falcon-graphene's People

Contributors

sreehari-aot avatar

Watchers

 avatar

falcon-graphene's Issues

Not able to update specific country details

Need to debug the issue with the following mutation.

mutation CountryMutation{
    CountryMutation(id: "633d65f64e4bbf66c3c955bc", population:366426){
        country {
            name
        }
    }   
}

Expected behavior:
Should return the updated object
Current behavior:
Cannot query field 'CountryMutation' on type 'Mutations'.

GraphQL request:2:5
1 | mutation CountryMutation{
2 | CountryMutation(id: "633d65f64e4bbf66c3c955bc", population:366426){
| ^

Client used: Postman GraphQL

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.