在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):torchbox/wagtail-grapple开源软件地址(OpenSource Url):https://github.com/torchbox/wagtail-grapple开源编程语言(OpenSource Language):Python 93.4%开源软件介绍(OpenSource Introduction):Wagtail GrappleA library to build GraphQL endpoints easily so you can grapple your Wagtail data from anywhere! Explore the docs » · Report Bug · Request Feature About The ProjectThere is a range of GraphQL packages for Python and specifically Django. However, getting these packages to work out of the box with an existing infrastructure without errors isn't as easy to come by. The purpose of Grapple is to be able to build GraphQL endpoints on a model by model
basis as quickly as possible. The setup and configuration have been designed
to be as simple but also provide the best features;
No complex serializers need to be written - just add a Features
Built WithThis library is an abstraction upon and relies heavily on Graphene & Graphene Django. We also use Django Channels and the Potrace image library.
Getting StartedGetting Grapple installed is designed to be as simple as possible! Prerequisites
Installationpip install wagtail_grapple Add the following to the INSTALLED_APPS = [
# ...
"grapple",
"graphene_django",
# ...
] For GraphQL Subscriptions with Django Channels, run INSTALLED_APPS = [
# ...
"grapple",
"graphene_django",
"channels",
# ...
] Add the following to the bottom of the same settings file, where each key is the app you want to this library to scan and the value is the prefix you want to give to GraphQL types (you can usually leave this blank): # Grapple config:
GRAPHENE = {"SCHEMA": "grapple.schema.schema"}
GRAPPLE = {
"APPS": ["home"],
} Add the GraphQL URLs to your from grapple import urls as grapple_urls
# ...
urlpatterns = [
# ...
path("api/", include(grapple_urls)),
# ...
] Done! Now you can proceed onto configuring your models to generate GraphQL types that adopt their structure |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论