mirror of
https://github.com/graphql-python/graphene.git
synced 2025-02-23 07:00:56 +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
|
import graphene
|
||||||
from graphene import relay, with_context
|
from graphene import relay, with_context
|
||||||
|
|
||||||
|
from promise import Promise
|
||||||
|
|
||||||
schema = graphene.Schema()
|
schema = graphene.Schema()
|
||||||
|
|
||||||
|
|
||||||
|
@ -51,7 +53,7 @@ class Query(graphene.ObjectType):
|
||||||
|
|
||||||
connection_type_nodes = relay.ConnectionField(
|
connection_type_nodes = relay.ConnectionField(
|
||||||
MyNode, connection_type=MyConnection)
|
MyNode, connection_type=MyConnection)
|
||||||
|
|
||||||
promise_connection_type = relay.ConnectionField(
|
promise_connection_type = relay.ConnectionField(
|
||||||
MyNode, connection_type=MyConnection)
|
MyNode, connection_type=MyConnection)
|
||||||
|
|
||||||
|
@ -78,7 +80,7 @@ class Query(graphene.ObjectType):
|
||||||
|
|
||||||
def resolve_all_my_objects(self, args, info):
|
def resolve_all_my_objects(self, args, info):
|
||||||
return [MyObject(name='my_object')]
|
return [MyObject(name='my_object')]
|
||||||
|
|
||||||
def resolve_promise_connection_type(self, args, info):
|
def resolve_promise_connection_type(self, args, info):
|
||||||
return Promise.resolve('async name').then(lambda name: [MyNode(id='1', name=name)])
|
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',
|
||||||
'sqlalchemy_utils',
|
'sqlalchemy_utils',
|
||||||
'mock',
|
'mock',
|
||||||
|
'promse',
|
||||||
# Required for Django postgres fields testing
|
# Required for Django postgres fields testing
|
||||||
'psycopg2',
|
'psycopg2',
|
||||||
],
|
],
|
||||||
|
|
Loading…
Reference in New Issue
Block a user