Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for V3: Graphene, Flask GraphQL, Django GraphQL #61

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
8 changes: 1 addition & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
language: python
matrix:
include:
- python: 2.7
env: TOXENV=py27
- python: 3.4
env: TOXENV=py34
- python: 3.5
env: TOXENV=py35
- python: 3.6
env: TOXENV=py36
- python: 3.7
Expand All @@ -15,7 +9,7 @@ matrix:
env: TOXENV=py38
- python: 3.9
env: TOXENV=py39
- python: pypy
- python: pypy3
env: TOXENV=pypy
install:
- pip install tox
Expand Down
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@ urlpatterns = [

### Flask Integration:

Note that `flask-graphql` version `<2.0` is not supported. At the time of
writing this README, you must install `flask-graphql` with
`pip install --pre flask-graphql`

Simply import the modified view and create a new url rule on your app:

```python
Expand Down
2 changes: 1 addition & 1 deletion examples/flask/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ class Mutation(graphene.ObjectType):
view_func=FileUploadGraphQLView.as_view(
'graphql',
graphiql=True,
schema=schema,
schema=schema.graphql_schema,
)
)
2 changes: 1 addition & 1 deletion graphene_file_upload/flask/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Apply multipart request spec to flask"""
from flask import request
from flask_graphql import GraphQLView
from graphql_server import load_json_body
from graphql_server.flask import GraphQLView

from ..utils import place_files_in_operations

Expand Down
9 changes: 3 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@

flask_requires = [
'Flask>=1.0.2',
'graphene>=2.1.2',
'Flask-Graphql>=2.0.0',
'graphene>=3.0b7',
'graphql-server[flask]>=3.0.0b3',
]

django_requires = [
'graphene-django>=2.0.0',
'graphene-django>=3.0.0b6',
]
all_requires = flask_requires + django_requires

Expand Down Expand Up @@ -56,9 +56,6 @@
"Natural Language :: English",
"Topic :: Internet :: WWW/HTTP",
"Operating System :: OS Independent",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
Expand Down
3 changes: 1 addition & 2 deletions tests/flask_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@

from graphene_file_upload.flask import FileUploadGraphQLView


def create_app(schema, path='/graphql'):
app = Flask(__name__)
app.debug = True
app.add_url_rule(
path,
view_func=FileUploadGraphQLView.as_view(
'graphql',
schema=schema,
schema=schema.graphql_schema,
),
)
return app
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
# and then run "tox" from this directory.

[tox]
envlist = py27, py34, py35, py36, py37, py38, py39
envlist = py36, py37, py38, py39
skip_missing_interpreters = true

[testenv]
deps =
.[all,tests]
py3{4,5,6,7,8,9}: pylint
py3{6,7,8,9}: pylint
commands =
-coverage erase
py3{4,5,6,7,8,9}: pylint graphene_file_upload
py3{6,7,8,9}: pylint graphene_file_upload
py.test --cov=graphene_file_upload -v tests/