Merge branch 'master' of github.com:graphql-python/graphene

This commit is contained in:
Syrus Akbary 2016-02-05 18:28:15 -08:00
commit 342511cda0
2 changed files with 7 additions and 16 deletions

View File

@ -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

View File

@ -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',