mirror of
https://github.com/graphql-python/graphene.git
synced 2025-02-22 14:40:49 +03:00
Added python to test setup.
This commit is contained in:
parent
9d5e428cd2
commit
1e1dc4c83a
|
@ -4,6 +4,8 @@ from graphql.type import GraphQLID, GraphQLNonNull
|
|||
import graphene
|
||||
from graphene import relay, with_context
|
||||
|
||||
from promise import Promise
|
||||
|
||||
schema = graphene.Schema()
|
||||
|
||||
|
||||
|
@ -51,7 +53,7 @@ class Query(graphene.ObjectType):
|
|||
|
||||
connection_type_nodes = relay.ConnectionField(
|
||||
MyNode, connection_type=MyConnection)
|
||||
|
||||
|
||||
promise_connection_type = relay.ConnectionField(
|
||||
MyNode, connection_type=MyConnection)
|
||||
|
||||
|
@ -78,7 +80,7 @@ class Query(graphene.ObjectType):
|
|||
|
||||
def resolve_all_my_objects(self, args, info):
|
||||
return [MyObject(name='my_object')]
|
||||
|
||||
|
||||
def resolve_promise_connection_type(self, args, info):
|
||||
return Promise.resolve('async name').then(lambda name: [MyNode(id='1', name=name)])
|
||||
|
||||
|
|
1
setup.py
1
setup.py
|
@ -66,6 +66,7 @@ setup(
|
|||
'sqlalchemy',
|
||||
'sqlalchemy_utils',
|
||||
'mock',
|
||||
'promse',
|
||||
# Required for Django postgres fields testing
|
||||
'psycopg2',
|
||||
],
|
||||
|
|
Loading…
Reference in New Issue
Block a user