mirror of
https://github.com/graphql-python/graphene.git
synced 2025-07-27 08:19:45 +03:00
Add requirements-txt-fixer pre-commit hook and run on all files
This commit is contained in:
parent
28f6353212
commit
4214981444
|
@ -15,3 +15,4 @@
|
|||
- id: pretty-format-json
|
||||
args:
|
||||
- --autofix
|
||||
- id: requirements-txt-fixer
|
||||
|
|
|
@ -207,7 +207,7 @@ Before:
|
|||
```python
|
||||
class SomeMutation(Mutation):
|
||||
...
|
||||
|
||||
|
||||
@classmethod
|
||||
def mutate(cls, instance, args, context, info):
|
||||
...
|
||||
|
@ -218,7 +218,7 @@ With 2.0:
|
|||
```python
|
||||
class SomeMutation(Mutation):
|
||||
...
|
||||
|
||||
|
||||
def mutate(self, info, **args):
|
||||
...
|
||||
```
|
||||
|
@ -231,7 +231,7 @@ class SomeMutation(Mutation):
|
|||
first_name = String(required=True)
|
||||
last_name = String(required=True)
|
||||
...
|
||||
|
||||
|
||||
def mutate(self, info, first_name, last_name):
|
||||
...
|
||||
```
|
||||
|
@ -250,7 +250,7 @@ If you are using Middelwares, you need to some adjustments:
|
|||
Before:
|
||||
|
||||
```python
|
||||
class MyGrapheneMiddleware(object):
|
||||
class MyGrapheneMiddleware(object):
|
||||
def resolve(self, next_mw, root, args, context, info):
|
||||
|
||||
## Middleware code
|
||||
|
@ -261,7 +261,7 @@ class MyGrapheneMiddleware(object):
|
|||
With 2.0:
|
||||
|
||||
```python
|
||||
class MyGrapheneMiddleware(object):
|
||||
class MyGrapheneMiddleware(object):
|
||||
def resolve(self, next_mw, root, info, **args):
|
||||
context = info.context
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Required library
|
||||
Sphinx==1.5.3
|
||||
# Docs template
|
||||
http://graphene-python.org/sphinx_graphene_theme.zip
|
||||
# Required library
|
||||
Sphinx==1.5.3
|
||||
|
|
Loading…
Reference in New Issue
Block a user