1
- **We are looking for contributors **! Please check the
2
- `ROADMAP <https://github.com/graphql-python/graphene/blob/master/ROADMAP.md >`__
3
- to see how you can help ❤️
4
-
5
- --------------
6
-
7
1
|Graphene Logo | `Graphene <http://graphene-python.org >`__ |Build Status | |PyPI version | |Coverage Status |
8
2
=========================================================================================================
9
3
4
+ `💬 Join the community on
5
+ Slack <https://join.slack.com/t/graphenetools/shared_invite/enQtOTE2MDQ1NTg4MDM1LTA4Nzk0MGU0NGEwNzUxZGNjNDQ4ZjAwNDJjMjY0OGE1ZDgxZTg4YjM2ZTc4MjE2ZTAzZjE2ZThhZTQzZTkyMmM> `__
6
+
7
+ **We are looking for contributors **! Please check the
8
+ `ROADMAP <https://github.com/graphql-python/graphene/blob/master/ROADMAP.md >`__
9
+ to see how you can help ❤️
10
10
11
11
Introduction
12
12
------------
13
13
14
- `Graphene <http://graphene-python.org >`__ is a Python library for
15
- building GraphQL schemas/types fast and easily.
14
+ `Graphene <http://graphene-python.org >`__ is an opinionated Python
15
+ library for building GraphQL schemas/types fast and easily.
16
16
17
17
- **Easy to use: ** Graphene helps you use GraphQL in Python without
18
18
effort.
@@ -27,17 +27,18 @@ Integrations
27
27
28
28
Graphene has multiple integrations with different frameworks:
29
29
30
- +---------------------+----------------------------------------------------------------------------------------------+
31
- | integration | Package |
32
- +=====================+==============================================================================================+
33
- | Django | `graphene-django <https://github.com/graphql-python/graphene-django/ >`__ |
34
- +---------------------+----------------------------------------------------------------------------------------------+
35
- | SQLAlchemy | `graphene-sqlalchemy <https://github.com/graphql-python/graphene-sqlalchemy/ >`__ |
36
- +---------------------+----------------------------------------------------------------------------------------------+
37
- | Google App Engine | `graphene-gae <https://github.com/graphql-python/graphene-gae/ >`__ |
38
- +---------------------+----------------------------------------------------------------------------------------------+
39
- | Peewee | *In progress * (`Tracking Issue <https://github.com/graphql-python/graphene/issues/289 >`__) |
40
- +---------------------+----------------------------------------------------------------------------------------------+
30
+ +-------------------+-------------------------------------------------+
31
+ | integration | Package |
32
+ +===================+=================================================+
33
+ | Django | `graphene-django <https:/ |
34
+ | | /github.com/graphql-python/graphene-django/>`__ |
35
+ +-------------------+-------------------------------------------------+
36
+ | SQLAlchemy | `graphene-sqlalchemy <https://git |
37
+ | | hub.com/graphql-python/graphene-sqlalchemy/>`__ |
38
+ +-------------------+-------------------------------------------------+
39
+ | Google App Engine | `graphene-gae <http |
40
+ | | s://github.com/graphql-python/graphene-gae/>`__ |
41
+ +-------------------+-------------------------------------------------+
41
42
42
43
Also, Graphene is fully compatible with the GraphQL spec, working
43
44
seamlessly with all GraphQL clients, such as
@@ -52,13 +53,7 @@ For instaling graphene, just run this command in your shell
52
53
53
54
.. code :: bash
54
55
55
- pip install " graphene>=2.0"
56
-
57
- 2.0 Upgrade Guide
58
- -----------------
59
-
60
- Please read `UPGRADE-v2.0.md </UPGRADE-v2.0.md >`__ to learn how to
61
- upgrade.
56
+ pip install " graphene>=3.0"
62
57
63
58
Examples
64
59
--------
@@ -67,26 +62,26 @@ Here is one example for you to get started:
67
62
68
63
.. code :: python
69
64
70
- import graphene
65
+ import graphene
71
66
72
- class Query (graphene .ObjectType ):
73
- hello = graphene.String(description = ' A typical hello world' )
67
+ class Query (graphene .ObjectType ):
68
+ hello = graphene.String(description = ' A typical hello world' )
74
69
75
- def resolve_hello (self , info ):
76
- return ' World'
70
+ def resolve_hello (self , info ):
71
+ return ' World'
77
72
78
- schema = graphene.Schema(query = Query)
73
+ schema = graphene.Schema(query = Query)
79
74
80
75
Then Querying ``graphene.Schema `` is as simple as:
81
76
82
77
.. code :: python
83
78
84
- query = '''
85
- query SayHello {
86
- hello
87
- }
88
- '''
89
- result = schema.execute(query)
79
+ query = '''
80
+ query SayHello {
81
+ hello
82
+ }
83
+ '''
84
+ result = schema.execute(query)
90
85
91
86
If you want to learn even more, you can also check the following
92
87
`examples <examples/ >`__:
@@ -110,20 +105,20 @@ dependencies are installed by running:
110
105
111
106
.. code :: sh
112
107
113
- virtualenv venv
114
- source venv/bin/activate
115
- pip install -e " .[test]"
108
+ virtualenv venv
109
+ source venv/bin/activate
110
+ pip install -e " .[test]"
116
111
117
112
Well-written tests and maintaining good test coverage is important to
118
113
this project. While developing, run new and existing tests with:
119
114
120
115
.. code :: sh
121
116
122
- py.test graphene/relay/tests/test_node.py # Single file
123
- py.test graphene/relay # All tests in directory
117
+ py.test graphene/relay/tests/test_node.py # Single file
118
+ py.test graphene/relay # All tests in directory
124
119
125
120
Add the ``-s `` flag if you have introduced breakpoints into the code for
126
- debugging. Add the ``-v `` (" verbose" ) flag to get more detailed test
121
+ debugging. Add the ``-v `` (“ verbose” ) flag to get more detailed test
127
122
output. For even more detailed output, use ``-vv ``. Check out the
128
123
`pytest documentation <https://docs.pytest.org/en/latest/ >`__ for more
129
124
options and test running controls.
@@ -132,7 +127,7 @@ You can also run the benchmarks with:
132
127
133
128
.. code :: sh
134
129
135
- py.test graphene --benchmark-only
130
+ py.test graphene --benchmark-only
136
131
137
132
Graphene supports several versions of Python. To make sure that changes
138
133
do not break compatibility with any of those versions, we use ``tox `` to
@@ -142,14 +137,14 @@ config file, just run:
142
137
143
138
.. code :: sh
144
139
145
- tox
140
+ tox
146
141
147
142
If you wish to run against a specific version defined in the ``tox.ini ``
148
143
file:
149
144
150
145
.. code :: sh
151
146
152
- tox -e py36
147
+ tox -e py36
153
148
154
149
Tox can only use whatever versions of Python are installed on your
155
150
system. When you create a pull request, Travis will also be running the
@@ -168,7 +163,7 @@ An HTML version of the documentation is produced by running:
168
163
169
164
.. code :: sh
170
165
171
- make docs
166
+ make docs
172
167
173
168
.. |Graphene Logo | image :: http://graphene-python.org/favicon.png
174
169
.. |Build Status | image :: https://travis-ci.org/graphql-python/graphene.svg?branch=master
0 commit comments