Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iashraful/pnp-graphql
A plug and play type graphql API making library
https://github.com/iashraful/pnp-graphql
api django graphql plug-and-play python query-language
Last synced: 3 months ago
JSON representation
A plug and play type graphql API making library
- Host: GitHub
- URL: https://github.com/iashraful/pnp-graphql
- Owner: iashraful
- License: mit
- Created: 2019-06-22T14:20:28.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-07-28T05:09:40.000Z (over 4 years ago)
- Last Synced: 2024-09-18T09:32:23.357Z (5 months ago)
- Topics: api, django, graphql, plug-and-play, python, query-language
- Language: Python
- Homepage: https://ashraful.dev/docs/plug-n-play-graphql/
- Size: 56.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-graphql - pnp-graphql - A Django integration for GraphQL with Graphene. It's fully plug and play type. No extra code needed to expose basic api with filtering, pagination and mutations. (Libraries / Python Libraries)
README
## Plug & Play GraphQL (pnp-graphql)-- [Change Log](https://github.com/iashraful/pnp-graphql/blob/master/CHANGELOG.md)
> A library for making GraphQL API with Python/Django. This is like a flash drive,
just how you plug into computer and transfer files.> **Read Full Documentation here: https://docs.ashraful.dev/pnp-graphql**
### Quick Start
> Documentation is coming soon...* Install from pip `pip install pnp-graphql`
* Add `graphene_django` on top of installed apps on settings.py
* Add `pnp_graphql` into installed apps on settings.py
* Add PnP GraphQL config on settings.
```python
GRAPHENE = {
'SCHEMA': 'pnp_graphql.schema.schema'
}PNP_GRAPHQL = {
'ENABLED_APPS': ['example_app'],
# If you want to use Token Authentication. Otherwise it's optional
'AUTHENTICATION_CLASS': 'pnp_graphql.authentication.TokenAuthentication'
}
```
* Add the following code on `urls.py`
```python
from pnp_graphql.urls import urlpatterns as upurlpatterns = [
# ... ... ...
]
urlpatterns += up
```
* Set `DEBUG = False` for production use.**That's it :)**
**Now visit:** `http://your-ip:port/api/graphql-explorer/` for explore GraphQL built-in UI explorer for query.
**Production ready API :** `http://your-ip:port/api/graphql/`#### What's working?
* GraphQL query
* Mutation (Create, Update, Delete)
* Pagination
* API filtering for Number, String, Date, DateTime
* Authentication#### What are the plans?
* Proper error handling
* Field validation
* Caching
* many more ... ... ...### Waiting for your contribution :smile: