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

Support Constrained types

Open lovetoburnswhen opened this issue 3 years ago • 3 comments

Currently attempting to convert a constrained type will result in:

graphene_pydantic.converters.ConversionError: Don't know how to convert the Pydantic field ModelField(name='id', type=ConstrainedIntValue, required=True) (<class 'pydantic.types.ConstrainedIntValue'>)

lovetoburnswhen avatar Aug 11 '21 02:08 lovetoburnswhen

What behavior would you expect here? Note that as far as I know constraints are not supported in GraphQL -- https://github.com/APIs-guru/graphql-constraints-spec is all I could find and that's just a draft so far.

necaris avatar Aug 19 '21 18:08 necaris

For now just treating it as an int is sufficient. My understanding is the conversion process ignores validators anyway.

lovetoburnswhen avatar Aug 20 '21 01:08 lovetoburnswhen

Any ideas?

dima-dmytruk23 avatar Apr 19 '22 13:04 dima-dmytruk23