Skip to main content

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


Graphene Logo Graphene Build Status PyPI version Coverage Status

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

Metadata

Release files for graphene 2.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for graphene 2.1.2
File Size Uploaded
graphene-2.1.2.tar.gz 40.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for graphene 2.1.2
File Interpreter ABI Platform
graphene-2.1.2-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 141.8 kB

Release files / graphene-2.1.2.tar.gz

Download URL graphene-2.1.2.tar.gz
Size 40.4 kB
Tags Source
SHA-256 checksum
How to use checksums
98e74c32d0415e5b5362738c1c1cb4b7a4e411b5d3d828abb29ccd3efb378c44
BLAKE2b-256 checksum
How to use checksums
ede0c1f50d94d6a84cf8c4217b73e656097bbc960a94cd2c913d07158c0c21a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / graphene-2.1.2-py2.py3-none-any.whl

Download URL graphene-2.1.2-py2.py3-none-any.whl
Size 101.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
8fd8e6195c56c15b2936e7dee2e156692eba4752ee1978f65e10925eafe8d014
BLAKE2b-256 checksum
How to use checksums
17c8d326bb2bb207af057d9cd8b986bdc09afa56c54ccf642e0a864e6e9e3970
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

3.4.3

2 release files

3.4.2

2 release files

3.4.1

2 release files

3.4

2 release files

3.3

2 release files

3.2.2

2 release files

3.2.1

2 release files

3.2

2 release files

3.1.1

2 release files

3.1

2 release files

3.0

2 release files

2.1.9

2 release files

2.1.8

2 release files

2.1.7

2 release files

2.1.6

2 release files

2.1.5

2 release files

2.1.3

2 release files

This release

2.1.2 This release

2 release files

2.1.1

2 release files

2.1

2 release files

2.0.1

2 release files

2.0

2 release files

1.4.2

1 release file

1.4.1

1 release file

1.4

1 release file

1.3

1 release file

1.2

1 release file

1.1.3

1 release file

1.1.2

1 release file

1.1.1

1 release file

1.1

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0

1 release file

0.10.2

1 release file

0.10.1

1 release file

0.10.0

1 release file

0.9.1

1 release file

0.9

1 release file

0.8.1

1 release file

0.8.0

1 release file

0.7.3

1 release file

0.7.2

1 release file

0.7.1

1 release file

0.7.0

1 release file

0.6.1

1 release file

0.6.0

1 release file

0.5.0

1 release file

0.4.3

1 release file

0.4.2

1 release file

0.4.1.1

1 release file

0.4.1

1 release file

0.4.0.1

1 release file

0.4.0

1 release file

0.3.0

1 release file

0.1.6.1

1 release file

0.1.6.0

1 release file

0.1.6

0.1.5.3

1 release file

0.1.5.2

1 release file

0.1.5.1

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

0.0.1

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page