Skip to content

Commit b655859

Browse files
committed
Repository renamed from graphql-core to graphql-core-legacy
1 parent 0668626 commit b655859

File tree

2 files changed

+50
-37
lines changed

2 files changed

+50
-37
lines changed

README.md

Lines changed: 48 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,45 @@
1-
# GraphQL-core
1+
# GraphQL-core 2
22

3-
GraphQL for Python.
3+
This is the repository of GraphQL for Python 2 (legacy version).
44

5-
_This library is a port of [graphql-js](https://github.com/graphql/graphql-js) to Python and currently is up-to-date with release [0.6.0](https://github.com/graphql/graphql-js/releases/tag/v0.6.0)._
5+
**The repository for the current version GraphQL is available at
6+
[github.com/graphql-python/graphql-core](https://github.com/graphql-python/graphql-core).**
67

7-
[![PyPI version](https://badge.fury.io/py/graphql-core.svg)](https://badge.fury.io/py/graphql-core)
8-
[![Build Status](https://travis-ci.org/graphql-python/graphql-core.svg?branch=master)](https://travis-ci.org/graphql-python/graphql-core)
9-
[![Coverage Status](https://coveralls.io/repos/graphql-python/graphql-core/badge.svg?branch=master&service=github)](https://coveralls.io/github/graphql-python/graphql-core?branch=master)
10-
[![Public Slack Discussion](https://graphql-slack.herokuapp.com/badge.svg)](https://graphql-slack.herokuapp.com/)
8+
[![PyPI version](https://badge.fury.io/py/graphql-core-legacy.svg)](https://badge.fury.io/py/graphql-core-legacy)
9+
[![Build Status](https://travis-ci.org/graphql-python/graphql-core-legacy.svg?branch=master)](https://travis-ci.org/graphql-python/graphql-core-legacy)
10+
[![Coverage Status](https://coveralls.io/repos/graphql-python/graphql-core-legacy/badge.svg?branch=master&service=github)](https://coveralls.io/github/graphql-python/graphql-core-legacy?branch=master)
1111

12-
See more complete documentation at http://graphql.org/ and
13-
http://graphql.org/docs/api-reference-graphql/.
12+
_This library is a port of [GraphQL.js](https://github.com/graphql/graphql-js) to Python
13+
and up-to-date with release [0.6.0](https://github.com/graphql/graphql-js/releases/tag/v0.6.0)._
1414

15-
For questions, ask [Stack Overflow](http://stackoverflow.com/questions/tagged/graphql).
15+
GraphQL.js is the JavaScript reference implementation for GraphQL,
16+
a query language for APIs created by Facebook.
17+
18+
See also the GraphQL documentation at [graphql.org](https://graphql.org/) and
19+
[https://graphql.org/graphql-js/graphql/](https://graphql.org/graphql-js/graphql/).
20+
21+
For questions regarding GraphQL, ask [Stack Overflow](http://stackoverflow.com/questions/tagged/graphql).
1622

1723
## Getting Started
1824

1925
An overview of the GraphQL language is available in the
20-
[README](https://github.com/facebook/graphql/blob/master/README.md) for the
21-
[Specification for GraphQL](https://github.com/facebook/graphql).
26+
[README](https://github.com/graphql/graphql-spec/blob/master/README.md) for the
27+
[Specification for GraphQL](https://github.com/graphql/graphql-spec).
2228

23-
The overview describes a simple set of GraphQL examples that exist as [tests](https://github.com/graphql-python/graphql-core/tree/master/tests/)
24-
in this repository. A good way to get started is to walk through that README and the corresponding tests
25-
in parallel.
29+
The overview describes a simple set of GraphQL examples that exist as
30+
[tests](https://github.com/graphql-python/graphql-core-legacy/tree/master/tests/)
31+
in this repository. A good way to get started is to walk through that README
32+
and the corresponding tests in parallel.
2633

27-
### Using graphql-core
34+
### Using GraphQL-core 2
2835

2936
Install from pip:
3037

3138
```sh
32-
pip install graphql-core
39+
pip install "graphql-core<3"
3340
```
3441

35-
GraphQL.js provides two important capabilities: building a type schema, and
42+
GraphQL-core provides two important capabilities: building a type schema, and
3643
serving queries against that type schema.
3744

3845
First, build a GraphQL type schema which maps to your code base.
@@ -47,22 +54,22 @@ from graphql import (
4754
)
4855

4956
schema = GraphQLSchema(
50-
query= GraphQLObjectType(
57+
query=GraphQLObjectType(
5158
name='RootQueryType',
5259
fields={
5360
'hello': GraphQLField(
54-
type= GraphQLString,
61+
type=GraphQLString,
5562
resolver=lambda *_: 'world'
5663
)
5764
}
5865
)
5966
)
6067
```
6168

62-
This defines a simple schema with one type and one field, that resolves
63-
to a fixed value. The `resolve` function can return a value, a promise,
64-
or an array of promises. A more complex example is included in the top
65-
level [tests](https://github.com/graphql-python/graphql-core/tree/master/tests/) directory.
69+
This defines a simple schema with one type and one field, that resolves to a fixed value.
70+
The `resolver` function can return a value, a promise, or an array of promises.
71+
A more complex example is included in the top level
72+
[tests](https://github.com/graphql-python/graphql-core-legacy/tree/master/tests/) directory.
6673

6774
Then, serve the result of a query against that type schema.
6875

@@ -77,9 +84,8 @@ result = graphql(schema, query)
7784
print result.data
7885
```
7986

80-
This runs a query fetching the one field defined. The `graphql` function will
81-
first ensure the query is syntactically and semantically valid before executing
82-
it, reporting errors otherwise.
87+
This runs a query fetching the one field defined. The `graphql` function will first ensure
88+
the query is syntactically and semantically valid before executing it, reporting errors otherwise.
8389

8490
```python
8591
query = '{ boyhowdy }'
@@ -94,8 +100,7 @@ print result.errors
94100

95101
### Executors
96102

97-
The graphql query is executed, by default, synchronously (using `SyncExecutor`).
98-
However the following executors are available if we want to resolve our fields in parallel:
103+
The graphql query is executed, by default, synchronously (using `SyncExecutor`). However the following executors are available if we want to resolve our fields in parallel:
99104

100105
- `graphql.execution.executors.asyncio.AsyncioExecutor`: This executor executes the resolvers in the Python asyncio event loop.
101106
- `graphql.execution.executors.gevent.GeventExecutor`: This executor executes the resolvers in the Gevent event loop.
@@ -108,9 +113,15 @@ However the following executors are available if we want to resolve our fields i
108113
You can specify the executor to use via the executor keyword argument in the `grapqhl.execution.execute` function.
109114

110115
```python
111-
from graphql.execution.execute import execute
116+
from graphql import parse
117+
from graphql.execution import execute
118+
from graphql.execution.executors.sync import SyncExecutor
119+
120+
ast = parse('{ hello }')
112121

113-
execute(schema, ast, executor=SyncExecutor())
122+
result = execute(schema, ast, executor=SyncExecutor())
123+
124+
print result.data
114125
```
115126

116127
### Contributing
@@ -126,15 +137,17 @@ pip install -e ".[test]"
126137
Well-written tests and maintaining good test coverage is important to this project. While developing, run new and existing tests with:
127138

128139
```sh
129-
py.test PATH/TO/MY/DIR/test_test.py # Single file
130-
py.test PATH/TO/MY/DIR/ # All tests in directory
140+
pytest PATH/TO/MY/DIR/test_test.py # Single file
141+
pytest PATH/TO/MY/DIR/ # All tests in directory
131142
```
132143

133144
Add the `-s` flag if you have introduced breakpoints into the code for debugging.
134145
Add the `-v` ("verbose") flag to get more detailed test output. For even more detailed output, use `-vv`.
135146
Check out the [pytest documentation](https://docs.pytest.org/en/latest/) for more options and test running controls.
136147

137-
GraphQL-core supports several versions of Python. To make sure that changes do not break compatibility with any of those versions, we use `tox` to create virtualenvs for each python version and run tests with that version. To run against all python versions defined in the `tox.ini` config file, just run:
148+
GraphQL-core 2 supports several versions of Python. To make sure that changes do not break compatibility
149+
with any of those versions, we use `tox` to create virtualenvs for each Python version and run tests with that version.
150+
To run against all python versions defined in the `tox.ini` config file, just run:
138151

139152
```sh
140153
tox
@@ -156,4 +169,4 @@ Tox can only use whatever versions of python are installed on your system. When
156169

157170
## License
158171

159-
[MIT License](https://github.com/graphql-python/graphql-core/blob/master/LICENSE)
172+
[MIT License](https://github.com/graphql-python/graphql-core-legacy/blob/master/LICENSE)

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ def run_tests(self):
5555
description="GraphQL implementation for Python",
5656
long_description=open("README.md").read(),
5757
long_description_content_type="text/markdown",
58-
url="https://github.com/graphql-python/graphql-core",
59-
download_url="https://github.com/graphql-python/graphql-core/releases",
58+
url="https://github.com/graphql-python/graphql-core-legacy",
59+
download_url="https://github.com/graphql-python/graphql-core-legacy/releases",
6060
author="Syrus Akbary, Jake Heinz, Taeho Kim",
6161
author_email="[email protected]",
6262
license="MIT",

0 commit comments

Comments
 (0)