1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
import graphene # type: ignore
class Country(graphene.ObjectType):
name = graphene.String(description="Country name")
code = graphene.String(description="ISO 3166-1 two character country code")
alpha3 = graphene.String(description="ISO 3166-1 three character country code")
numeric = graphene.Int(description="ISO 3166-1 numeric country code")
ioc_code = graphene.String(
description="International Olympic Committee country code"
)
@staticmethod
def resolve_name(country, info):
return country.name
@staticmethod
def resolve_code(country, info):
return country.code
@staticmethod
def resolve_alpha3(country, info):
return country.alpha3
@staticmethod
def resolve_numeric(country, info):
return country.numeric
@staticmethod
def resolve_ioc_code(country, info):
return country.ioc_code
|