goldcaddy77 / warthog

GraphQL API Framework with strong conventions and auto-generated schema
https://warthog.dev/
MIT License
359 stars 38 forks source link

Embedded Entities #286

Open domvernon opened 4 years ago

domvernon commented 4 years ago

👋 Does Warthog support embedded entities? My usecase would be similar to the one given, to reduce boilerplate for several models that would have the same fields.

goldcaddy77 commented 4 years ago

Hi, I don't support this yet. How would you imagine sorting and filtering would work on these columns? What might the Warthog API look like for this?

Note that you could always create a class and subclass from it, inheriting it's columns.

domvernon commented 4 years ago

Not sure about the API, but since the underlying tables would have whatever columns the other entity defined I believe it would be similar. Inheritance would definitely be another way to achieve this - the other way lends itself more to composition patterns.

Thanks for the reply though, I'm enjoying using the framework so far!