Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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

  • Django: Automatic Django model mapping to Graphene Types. Check a fully working Django implementation

Graphene also supports SQLAlchemy!

What is supported in this Python version? Everything: Interfaces, ObjectTypes, Scalars, Unions and Relay (Nodes, Connections), in addition to queries, mutations and subscriptions.

NEW!: Try graphene online

Installation

For instaling graphene, just run this command in your shell

pip install graphene
# In case of need Django model support
pip install graphene[django]
# Or in case of need SQLAlchemy support
pip install graphene[sqlalchemy]

Examples

Here is one example for get you started:

class Query(graphene.ObjectType):
    hello = graphene.String(description='A typical hello world')
    ping = graphene.String(description='Ping someone',
                           to=graphene.String())

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

    def resolve_ping(self, args, info):
        return 'Pinging {}'.format(args.get('to'))

schema = graphene.Schema(query=Query)

Then Querying graphene.Schema is as simple as:

query = '''
    query SayHello {
      hello
      ping(to:"peter")
    }
'''
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:

python setup.py install

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

python setup.py test # Use --pytest-args="-v -s" for verbose mode

Release files for graphene 1.0.dev20160823061102

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 1.0.dev20160823061102
File Size Uploaded
graphene-1.0.dev20160823061102.tar.gz 26.1 kB Details

Release files / graphene-1.0.dev20160823061102.tar.gz

Download URL graphene-1.0.dev20160823061102.tar.gz
Size 26.1 kB
Tags Source
SHA-256 checksum
How to use checksums
0055bd2525d2a85476c546be1b2eb94d373c622ef5afb38b6c5484bd08beee6e
BLAKE2b-256 checksum
How to use checksums
301339d51c394f0c3098e9dc1b1423aee9096b069cb9f4980cd19f0b9a4eb13c
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

2.1.2

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

This release

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