single |
# ![Graphene Logo] [Graphene] [PyPI version] [Coverage Status]
[![]](https://discord.gg/T6Gp6NFYHe)
[���� Join the community on Discord]
**We are looking for contributors**! Please check the current issues to see
how you can help ������
## Introduction
[Graphene] is an opinionated 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), Mongo, 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
|
| ----------------- |
---------------------------------------------------------------------------------------
|
| SQLAlchemy | [graphene-sqlalchemy] |
| Mongo | [graphene-mongo] |
| Apollo Federation | [graphene-federation] |
| Django | [graphene-django] |
Also, Graphene is fully compatible with the GraphQL spec, working
seamlessly with all GraphQL clients, such as [Relay], [Apollo] and [gql].
## Installation
To install `graphene`, just run this command in your shell
```bash
pip install "graphene>=3.1"
```
## Examples
Here is one example for you to get started:
```python
import graphene
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:
```python
query = '''
query SayHello {
hello
}
'''
result = schema.execute(query)
```
If you want to learn even more, you can also check the following
[examples]:
- **Basic Schema**: [Starwars example]
- **Relay Schema**: [Starwars Relay example]
## Documentation
Documentation and links to additional resources are available at
https://docs.graphene-python.org/en/latest/
## Contributing
After cloning this repo, create a [virtualenv] and ensure dependencies are
installed by running:
```sh
virtualenv venv
source venv/bin/activate
pip install -e ".[test]"
```
Well-written tests and maintaining good test coverage is important to this
project. While developing, run new and existing tests with:
```sh
pytest graphene/relay/tests/test_node.py # Single file
|