mirror of
https://github.com/graphql-python/graphene.git
synced 2024-11-30 05:23:57 +03:00
Merge branch 'master' of github.com:graphql-python/graphene
This commit is contained in:
commit
342511cda0
|
@ -18,7 +18,7 @@ class CreatePerson(graphene.Mutation):
|
||||||
class Input:
|
class Input:
|
||||||
name = graphene.String()
|
name = graphene.String()
|
||||||
|
|
||||||
ok = graphene.String()
|
ok = graphene.Boolean()
|
||||||
person = graphene.Field('Person')
|
person = graphene.Field('Person')
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
|
@ -125,14 +125,14 @@ def test_should_query_connection():
|
||||||
model = Reporter
|
model = Reporter
|
||||||
|
|
||||||
class Query(graphene.ObjectType):
|
class Query(graphene.ObjectType):
|
||||||
all_reporters_connection = DjangoConnectionField(ReporterType)
|
all_reporters = DjangoConnectionField(ReporterType)
|
||||||
|
|
||||||
def resolve_all_reporters_connection(self, *args, **kwargs):
|
def resolve_all_reporters_connection(self, *args, **kwargs):
|
||||||
return Reporter.objects.all()
|
return Reporter.objects.all()
|
||||||
|
|
||||||
query = '''
|
query = '''
|
||||||
query ReporterQuery {
|
query ReporterQuery {
|
||||||
allReportersConnection(first:1) {
|
allReporters(first:1) {
|
||||||
edges {
|
edges {
|
||||||
node {
|
node {
|
||||||
lastName
|
lastName
|
||||||
|
@ -147,7 +147,7 @@ def test_should_query_connection():
|
||||||
}
|
}
|
||||||
'''
|
'''
|
||||||
expected = {
|
expected = {
|
||||||
'allReportersConnection': {
|
'allReporters': {
|
||||||
'edges': [{
|
'edges': [{
|
||||||
'node': {
|
'node': {
|
||||||
'lastName': 'ABA',
|
'lastName': 'ABA',
|
||||||
|
@ -180,23 +180,14 @@ def test_should_query_connectionfilter():
|
||||||
model = Reporter
|
model = Reporter
|
||||||
|
|
||||||
class Query(graphene.ObjectType):
|
class Query(graphene.ObjectType):
|
||||||
all_reporters_connection_filter = DjangoFilterConnectionField(ReporterType)
|
all_reporters = DjangoFilterConnectionField(ReporterType)
|
||||||
|
|
||||||
def resolve_all_reporters_connection_filter(self, *args, **kwargs):
|
def resolve_all_reporters_connection_filter(self, *args, **kwargs):
|
||||||
return Reporter.objects.all()
|
return Reporter.objects.all()
|
||||||
|
|
||||||
def resolve_all_reporters_connection(self, *args, **kwargs):
|
|
||||||
return Reporter.objects.all()
|
|
||||||
|
|
||||||
def resolve_all_reporters(self, *args, **kwargs):
|
|
||||||
return Reporter.objects.all()
|
|
||||||
|
|
||||||
def resolve_reporter(self, *args, **kwargs):
|
|
||||||
return Reporter.objects.first()
|
|
||||||
|
|
||||||
query = '''
|
query = '''
|
||||||
query ReporterQuery {
|
query ReporterQuery {
|
||||||
allReportersConnectionFilter(first:1) {
|
allReporters(first:1) {
|
||||||
edges {
|
edges {
|
||||||
node {
|
node {
|
||||||
lastName
|
lastName
|
||||||
|
@ -211,7 +202,7 @@ def test_should_query_connectionfilter():
|
||||||
}
|
}
|
||||||
'''
|
'''
|
||||||
expected = {
|
expected = {
|
||||||
'allReportersConnectionFilter': {
|
'allReporters': {
|
||||||
'edges': [{
|
'edges': [{
|
||||||
'node': {
|
'node': {
|
||||||
'lastName': 'ABA',
|
'lastName': 'ABA',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user