Skip to content

Commit 1eee5a4

Browse files
committed
Merge branch 'master' of github.com:tpict/graphene-django into connection-offset
2 parents 0868497 + 5b14511 commit 1eee5a4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+3093
-911
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: "\U0001F41Bbug"
6+
assignees: ''
7+
8+
---
9+
10+
**Note: for support questions, please use stackoverflow**. This repository's issues are reserved for feature requests and bug reports.
11+
12+
* **What is the current behavior?**
13+
14+
15+
16+
* **If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem** via
17+
a github repo, https://repl.it or similar (you can use this template as a starting point: https://repl.it/@jkimbo/Graphene-Django-Example).
18+
19+
20+
21+
* **What is the expected behavior?**
22+
23+
24+
25+
* **What is the motivation / use case for changing the behavior?**
26+
27+
28+
29+
* **Please tell us about your environment:**
30+
31+
- Version:
32+
- Platform:
33+
34+
* **Other information** (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow)

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blank_issues_enabled: false
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: "✨enhancement"
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/stale.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
# Number of days of inactivity before an issue becomes stale
2-
daysUntilStale: 60
2+
daysUntilStale: 120
33
# Number of days of inactivity before a stale issue is closed
4-
daysUntilClose: 7
4+
daysUntilClose: 30
55
# Issues with these labels will never be considered stale
66
exemptLabels:
77
- pinned
88
- security
9+
- 🐛bug
10+
- 📖 documentation
11+
- help wanted
12+
- ✨enhancement
913
# Label to use when marking an issue as stale
1014
staleLabel: wontfix
1115
# Comment to post when marking an issue as stale. Set to `false` to disable

.github/workflows/deploy.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: 🚀 Deploy to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v1
14+
- name: Set up Python 3.8
15+
uses: actions/setup-python@v1
16+
with:
17+
python-version: 3.8
18+
- name: Build wheel and source tarball
19+
run: |
20+
pip install wheel
21+
python setup.py sdist bdist_wheel
22+
- name: Publish a Python distribution to PyPI
23+
uses: pypa/[email protected]
24+
with:
25+
user: __token__
26+
password: ${{ secrets.pypi_password }}

.github/workflows/lint.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Lint
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- uses: actions/checkout@v1
11+
- name: Set up Python 3.8
12+
uses: actions/setup-python@v1
13+
with:
14+
python-version: 3.8
15+
- name: Install dependencies
16+
run: |
17+
python -m pip install --upgrade pip
18+
pip install tox
19+
- name: Run lint 💅
20+
run: tox
21+
env:
22+
TOXENV: flake8

.github/workflows/tests.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
max-parallel: 4
10+
matrix:
11+
django: ["1.11", "2.2", "3.0", "3.1"]
12+
python-version: ["3.6", "3.7", "3.8"]
13+
include:
14+
- django: "1.11"
15+
python-version: "2.7"
16+
17+
steps:
18+
- uses: actions/checkout@v1
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v1
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install tox tox-gh-actions
27+
- name: Test with tox
28+
run: tox
29+
env:
30+
DJANGO: ${{ matrix.django }}
31+
TOXENV: ${{ matrix.toxenv }}

.travis.yml

Lines changed: 0 additions & 65 deletions
This file was deleted.

README.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
1-
Please read [UPGRADE-v2.0.md](https://github.com/graphql-python/graphene/blob/master/UPGRADE-v2.0.md) to learn how to upgrade to Graphene `2.0`.
1+
# ![Graphene Logo](http://graphene-python.org/favicon.png) Graphene-Django
22

3-
---
43

5-
# ![Graphene Logo](http://graphene-python.org/favicon.png) Graphene-Django [![Build Status](https://travis-ci.org/graphql-python/graphene-django.svg?branch=master)](https://travis-ci.org/graphql-python/graphene-django) [![PyPI version](https://badge.fury.io/py/graphene-django.svg)](https://badge.fury.io/py/graphene-django) [![Coverage Status](https://coveralls.io/repos/graphql-python/graphene-django/badge.svg?branch=master&service=github)](https://coveralls.io/github/graphql-python/graphene-django?branch=master)
4+
A [Django](https://www.djangoproject.com/) integration for [Graphene](http://graphene-python.org/).
65

6+
[![travis][travis-image]][travis-url]
7+
[![pypi][pypi-image]][pypi-url]
8+
[![Anaconda-Server Badge][conda-image]][conda-url]
9+
[![coveralls][coveralls-image]][coveralls-url]
710

8-
A [Django](https://www.djangoproject.com/) integration for [Graphene](http://graphene-python.org/).
11+
[travis-image]: https://travis-ci.org/graphql-python/graphene-django.svg?branch=master&style=flat
12+
[travis-url]: https://travis-ci.org/graphql-python/graphene-django
13+
[pypi-image]: https://img.shields.io/pypi/v/graphene-django.svg?style=flat
14+
[pypi-url]: https://pypi.org/project/graphene-django/
15+
[coveralls-image]: https://coveralls.io/repos/github/graphql-python/graphene-django/badge.svg?branch=master
16+
[coveralls-url]: https://coveralls.io/github/graphql-python/graphene-django?branch=master
17+
[conda-image]: https://img.shields.io/conda/vn/conda-forge/graphene-django.svg
18+
[conda-url]: https://anaconda.org/conda-forge/graphene-django
19+
20+
[💬 Join the community on Slack](https://join.slack.com/t/graphenetools/shared_invite/enQtOTE2MDQ1NTg4MDM1LTA4Nzk0MGU0NGEwNzUxZGNjNDQ4ZjAwNDJjMjY0OGE1ZDgxZTg4YjM2ZTc4MjE2ZTAzZjE2ZThhZTQzZTkyMmM)
921

1022
## Documentation
1123

@@ -78,7 +90,7 @@ class Query(graphene.ObjectType):
7890
schema = graphene.Schema(query=Query)
7991
```
8092

81-
Then you can simply query the schema:
93+
Then you can query the schema:
8294

8395
```python
8496
query = '''
@@ -101,3 +113,7 @@ To learn more check out the following [examples](examples/):
101113
## Contributing
102114

103115
See [CONTRIBUTING.md](CONTRIBUTING.md)
116+
117+
## Release Notes
118+
119+
* See [Releases page on github](https://github.com/graphql-python/graphene-django/releases)

docs/authorization.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Let's use a simple example model.
2020
Limiting Field Access
2121
---------------------
2222

23-
To limit fields in a GraphQL query simply use the ``only_fields`` meta attribute.
23+
To limit fields in a GraphQL query simply use the ``fields`` meta attribute.
2424

2525
.. code:: python
2626
@@ -31,10 +31,10 @@ To limit fields in a GraphQL query simply use the ``only_fields`` meta attribute
3131
class PostNode(DjangoObjectType):
3232
class Meta:
3333
model = Post
34-
only_fields = ('title', 'content')
34+
fields = ('title', 'content')
3535
interfaces = (relay.Node, )
3636
37-
conversely you can use ``exclude_fields`` meta attribute.
37+
conversely you can use ``exclude`` meta attribute.
3838

3939
.. code:: python
4040
@@ -45,7 +45,7 @@ conversely you can use ``exclude_fields`` meta attribute.
4545
class PostNode(DjangoObjectType):
4646
class Meta:
4747
model = Post
48-
exclude_fields = ('published', 'owner')
48+
exclude = ('published', 'owner')
4949
interfaces = (relay.Node, )
5050
5151
Queryset Filtering On Lists
@@ -84,7 +84,7 @@ with the context argument.
8484
8585
def resolve_my_posts(self, info):
8686
# context will reference to the Django request
87-
if not info.context.user.is_authenticated():
87+
if not info.context.user.is_authenticated:
8888
return Post.objects.none()
8989
else:
9090
return Post.objects.filter(owner=info.context.user)
@@ -133,7 +133,7 @@ method to your ``DjangoObjectType``.
133133
class PostNode(DjangoObjectType):
134134
class Meta:
135135
model = Post
136-
only_fields = ('title', 'content')
136+
fields = ('title', 'content')
137137
interfaces = (relay.Node, )
138138
139139
@classmethod
@@ -166,7 +166,7 @@ To restrict users from accessing the GraphQL API page the standard Django LoginR
166166
167167
After this, you can use the new ``PrivateGraphQLView`` in the project's URL Configuration file ``url.py``:
168168

169-
For Django 1.9 and below:
169+
For Django 1.11:
170170

171171
.. code:: python
172172

docs/extra-types.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Extra Types
2+
===========
3+
4+
Here are some libraries that provide common types for Django specific fields.
5+
6+
7+
GeoDjango
8+
---------
9+
10+
Use the graphene-gis_ library to add GeoDjango types to your Schema.
11+
12+
.. _graphene-gis: https://github.com/EverWinter23/graphene-gis

0 commit comments

Comments
 (0)