Skip to content

Commit 12559fd

Browse files
committed
feat: Add advanced_types.
1 parent 31812db commit 12559fd

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

graphene_mongo/advanced_types.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import graphene
2+
3+
4+
def _resolve_point_type_coordinates(self, info):
5+
return self['coordinates']
6+
7+
8+
class PointType(graphene.ObjectType):
9+
10+
type = graphene.String()
11+
coordinates = graphene.List(
12+
graphene.Float, resolver=_resolve_point_type_coordinates)
13+
14+
def resolve_type(self, info):
15+
return self['type']

0 commit comments

Comments
 (0)