Skip to content

Commit

Permalink
fix: support for new graphene-federation
Browse files Browse the repository at this point in the history
drop support for python 3.8
  • Loading branch information
mak626 committed May 9, 2024
1 parent 8fd26f2 commit 41b8739
Show file tree
Hide file tree
Showing 3 changed files with 209 additions and 197 deletions.
9 changes: 3 additions & 6 deletions graphene_mongo/advanced_types.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
import base64

import graphene
from graphene_federation import shareable


@shareable # Support Graphene Federation v2
class FileFieldType(graphene.ObjectType):
content_type = graphene.String()
md5 = graphene.String()
chunk_size = graphene.Int()
length = graphene.Int()
data = graphene.String()

# Support Graphene Federation v2
_shareable = True

@classmethod
def _resolve_fs_field(cls, field, name, default_value=None):
v = getattr(field.instance, field.key)
Expand All @@ -38,12 +37,10 @@ def resolve_data(self, info):
return None


@shareable # Support Graphene Federation v2
class _CoordinatesTypeField(graphene.ObjectType):
type = graphene.String()

# Support Graphene Federation v2
_shareable = True

def resolve_type(self, info):
return self["type"]

Expand Down
Loading

0 comments on commit 41b8739

Please sign in to comment.