graphql-python / graphene-pydantic

Integrate GraphQL with your Pydantic models
Other
229 stars 44 forks source link

Support for Pydantic Dataclass #26

Open matt-koevort opened 4 years ago

matt-koevort commented 4 years ago

Dataclasses are really useful in some instances. Pydantic has a drop-in replacement for dataclasses - but does not seem to supported by this library. Not sure how difficult it would be to include it? I know the classes have a __pydantic_model__ variable.

necaris commented 4 years ago

That's an interesting idea -- we haven't really looked into that. Supporting standard library dataclasses is a little out of the scope of this library IMHO, but Pydantic dataclasses should be easier to handle if they're easy to map to a Pydantic model.

I don't have a specific use case for Pydantic at my current work, so I'm not able to spend much time on it -- if you'd be interested in looking into it I'd be happy to help however I can, though! Otherwise I'm not sure when I'll be able to look into this.