0
graphene의 ConnectionField에서 사용자 정의 필드를 사용하는 방법을 이해하지 못했습니다. 내가 좋아하는 뭔가가 있습니다사용자 정의 ConnectionField in graphene
def resolve_ships(self, args, context, info):
return SHIPS
을하지만 어떻게 당신은 여분의 에 뭔가를 반환 않고 목록을 반환 :
class ShipConnection(Connection):
extra = String()
class Meta:
node = Ship
SHIPS = ['Tug boat', 'Row boat', 'Canoe']
class Query(AbstractType):
ships = relay.ConnectionField(ShipConnection)
def resolve_ships(self, args, context, info):
return ShipConnection(
extra='Some extra text',
edges=???
)
보통을, 당신은 말할 것?