随笔分类 -  Graphene

摘要:class type1(graphene.InputObjectType): name = graphene.String() gender= graphene.String() class type2(graphene.ObjectType): name = graphene.String() g 阅读全文
posted @ 2020-07-10 00:36 青花メ 阅读(206) 评论(0) 推荐(0)
摘要:1、所需要的安装包: graphene 2.1.8 Django 3.0.8 graphene-django 2.11.0 2、创建一个model from django.db import models # Create your models here. from django.db impor 阅读全文
posted @ 2020-07-08 00:48 青花メ 阅读(468) 评论(0) 推荐(0)
摘要:在Graphene中搜索Es中的数据一开始打算重写DjangoFilterConnectionField和Django Model对应的type。但是这样比较复杂,字段的对应以及查询显示,排序等。后来发现一个东西: graphene-elastic 阅读全文
posted @ 2020-06-15 00:11 青花メ 阅读(196) 评论(0) 推荐(0)
摘要:class DictType(graphene.InputObjectType): name = graphene.InputField(graphene.String) # 定义一个查询语句 class Query(ObjectType): all_user = graphene.List(Use 阅读全文
posted @ 2020-06-05 01:00 青花メ 阅读(372) 评论(0) 推荐(0)