Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tj-pre-commit/graphene-django-precommit-hook
Pre-commit hook for graphene-django schema generator
https://github.com/tj-pre-commit/graphene-django-precommit-hook
django-graphene django-graphql graphene-django graphql graphql-schema hook pre-commit-hook
Last synced: about 2 months ago
JSON representation
Pre-commit hook for graphene-django schema generator
- Host: GitHub
- URL: https://github.com/tj-pre-commit/graphene-django-precommit-hook
- Owner: tj-pre-commit
- License: mit
- Archived: true
- Created: 2020-06-11T19:07:08.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-05-31T11:31:21.000Z (over 3 years ago)
- Last Synced: 2024-09-19T18:34:33.968Z (2 months ago)
- Topics: django-graphene, django-graphql, graphene-django, graphql, graphql-schema, hook, pre-commit-hook
- Language: Shell
- Homepage:
- Size: 46.9 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# graphene-django-precommit-hook
[pre-commit](https://pre-commit.com) hook to generate your graphql schema for [graphene-django](https://github.com/graphql-python/graphene-django).## As a pre-commit hook
See [pre-commit](https://github.com/pre-commit/pre-commit) for instructions
Sample basic `.pre-commit-config.yaml`
```yaml
- repo: https://github.com/tj-pre-commit/graphene-django-precommit-hook
rev: v2.0.0
hooks:
- id: graphene-django-hook
stages: [commit]
```Sample complex `.pre-commit-config.yaml`
```yaml
- repo: https://github.com/tj-pre-commit/graphene-django-precommit-hook
rev: v2.0.0
hooks:
- id: graphene-django-hook
stages: [commit]
args: [
'--settings',
'project.settings'. # Defaults to: DJANGO_SETTINGS_MODULE
'--indent',
'4' # See https://docs.graphene-python.org/projects/django/en/latest/introspection/
'--out',
'path/to/schema.graphql',
'--schema',
'module.path.to.schema',
'--verbosity', # OR '-v'
'2', # Set the verbosity level {0,1,2,3}
]
```