graphene-pydantic icon indicating copy to clipboard operation
graphene-pydantic copied to clipboard

Don't know how to convert the Pydantic field AnyUrl

Open konnerthg opened this issue 1 year ago • 0 comments

I am trying to use pydantic's AnyUrl type:

class SomePydanticModel(pydantic.BaseModel):
    url: pydantic.AnyUrl = pydantic.Field()

class SomeGrapheneObject(graphene_pydantic.PydanticObjectType):
    class Meta:
        model = SomePydanticModel

But I receive the following error:

graphene_pydantic.converters.ConversionError: Don't know how to convert the Pydantic field FieldInfo(annotation=Url, required=True) (<class 'pydantic_core._pydantic_core.Url'>)

Is there a way to support this field?

graphene==3.3 graphene-pydantic==0.6.1

konnerthg avatar Mar 18 '24 06:03 konnerthg