mirror of
https://github.com/graphql-python/graphene.git
synced 2025-02-23 07:00:56 +03:00
commit
c1d93d6046
12
.travis.yml
12
.travis.yml
|
@ -12,15 +12,15 @@ cache:
|
||||||
install:
|
install:
|
||||||
- |
|
- |
|
||||||
if [ "$TEST_TYPE" = build ]; then
|
if [ "$TEST_TYPE" = build ]; then
|
||||||
pip install --download-cache $HOME/.cache/pip/ pytest pytest-cov coveralls six pytest-django django-filter sqlalchemy_utils
|
pip install pytest pytest-cov coveralls six pytest-django django-filter sqlalchemy_utils
|
||||||
pip install --download-cache $HOME/.cache/pip psycopg2 > /dev/null 2>&1
|
pip install psycopg2 > /dev/null 2>&1
|
||||||
pip install --download-cache $HOME/.cache/pip/ -e .
|
pip install -e .
|
||||||
pip install --download-cache $HOME/.cache/pip/ -e .[django]
|
pip install -e .[django]
|
||||||
pip install --download-cache $HOME/.cache/pip/ -e .[sqlalchemy]
|
pip install -e .[sqlalchemy]
|
||||||
pip install django==$DJANGO_VERSION
|
pip install django==$DJANGO_VERSION
|
||||||
python setup.py develop
|
python setup.py develop
|
||||||
elif [ "$TEST_TYPE" = lint ]; then
|
elif [ "$TEST_TYPE" = lint ]; then
|
||||||
pip install --download-cache $HOME/.cache/pip/ flake8
|
pip install flake8
|
||||||
fi
|
fi
|
||||||
script:
|
script:
|
||||||
- |
|
- |
|
||||||
|
|
|
@ -19,6 +19,7 @@ class MyNode(relay.Node):
|
||||||
def get_node(cls, id, info):
|
def get_node(cls, id, info):
|
||||||
return MyNode(id=id, name='mo')
|
return MyNode(id=id, name='mo')
|
||||||
|
|
||||||
|
|
||||||
class MyObject(graphene.ObjectType):
|
class MyObject(graphene.ObjectType):
|
||||||
name = graphene.String()
|
name = graphene.String()
|
||||||
|
|
||||||
|
@ -32,10 +33,12 @@ class SpecialNode(relay.Node):
|
||||||
value = "!!!" if context.get('is_special') else "???"
|
value = "!!!" if context.get('is_special') else "???"
|
||||||
return SpecialNode(id=id, value=value)
|
return SpecialNode(id=id, value=value)
|
||||||
|
|
||||||
|
|
||||||
def _create_my_node_edge(myNode):
|
def _create_my_node_edge(myNode):
|
||||||
edge_type = relay.Edge.for_node(MyNode)
|
edge_type = relay.Edge.for_node(MyNode)
|
||||||
return edge_type(node=myNode, cursor=str(myNode.id))
|
return edge_type(node=myNode, cursor=str(myNode.id))
|
||||||
|
|
||||||
|
|
||||||
class Query(graphene.ObjectType):
|
class Query(graphene.ObjectType):
|
||||||
my_node = relay.NodeField(MyNode)
|
my_node = relay.NodeField(MyNode)
|
||||||
my_node_lazy = relay.NodeField('MyNode')
|
my_node_lazy = relay.NodeField('MyNode')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user