Code Monkey home page Code Monkey logo

graphene's Introduction

Please read UPGRADE-v2.0.md to learn how to upgrade to Graphene 2.0.


Graphene is a Python library for building GraphQL schemas/types fast and easily.

  • Easy to use: Graphene helps you use GraphQL in Python without effort.
  • Relay: Graphene has builtin support for Relay.
  • Data agnostic: Graphene supports any kind of data source: SQL (Django, SQLAlchemy), NoSQL, custom Python objects, etc. We believe that by providing a complete API you could plug Graphene anywhere your data lives and make your data available through GraphQL.

Integrations

Graphene has multiple integrations with different frameworks:

integration Package
Django graphene-django
SQLAlchemy graphene-sqlalchemy
Google App Engine graphene-gae
Peewee In progress (Tracking Issue)

Also, Graphene is fully compatible with the GraphQL spec, working seamlessly with all GraphQL clients, such as Relay, Apollo and gql.

Installation

For instaling graphene, just run this command in your shell

pip install "graphene>=2.0"

2.0 Upgrade Guide

Please read UPGRADE-v2.0.md to learn how to upgrade.

Examples

Here is one example for you to get started:

class Query(graphene.ObjectType):
    hello = graphene.String(description='A typical hello world')

    def resolve_hello(self, info):
        return 'World'

schema = graphene.Schema(query=Query)

Then Querying graphene.Schema is as simple as:

query = '''
    query SayHello {
      hello
    }
'''
result = schema.execute(query)

If you want to learn even more, you can also check the following examples:

Contributing

After cloning this repo, ensure dependencies are installed by running:

pip install -e ".[test]"

After developing, the full test suite can be evaluated by running:

py.test graphene --cov=graphene --benchmark-skip # Use -v -s for verbose mode

You can also run the benchmarks with:

py.test graphene --benchmark-only

Documentation

The documentation is generated using the excellent Sphinx and a custom theme.

The documentation dependencies are installed by running:

cd docs
pip install -r requirements.txt

Then to produce a HTML version of the documentation:

make html

graphene's People

Contributors

syrusakbary avatar adamcharnock avatar globegitter avatar jkimbo avatar alecaivazis avatar ekampf avatar jhgg avatar pizzapanther avatar sjhewitt avatar jdugan1024 avatar bossgrand avatar pidelport avatar amitsaha avatar defrex avatar kevin-abiera avatar montemishkin avatar nparrish avatar yen223 avatar hung-phan avatar abawchen avatar blakegong avatar xatmassacre avatar nvie avatar ryanwilsonperkin avatar mjtamlyn avatar helfer avatar jeffwidman avatar lilyfoote avatar anisjonischkeit avatar adrielvelazquez avatar

Watchers

James Cloos avatar Aleksei Tcelishchev avatar

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.