You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to have ability to define args and filters that should be exposed. So let's see the example.
By default it exposes lots default fileters and args. Also module allows to add custom filters through .argFactory() method.
So the first problem is that it's hard to remove not needed filters for certain fields. Also it's became rather complicated when you have lots of models defined in different files. So in order to add some filters or args for each model, you'll need to define all that stuff somewhere (probably in your model file), then collect it into one object in file where schema is built and pass it to .argFactory() method.
Instead of doing this it would be better if module will check for presence of some static properties in model class e.g.:
So when model will be generated it will try to get this property and if it exist it will only add filters for each field that are defined in that object.
The same approach could be implemented for additional filters and args. And as a result .argFactory() method will be under the hood of this module and users will just define all the stuff they need directly in model class.
So it will be something similar to @timhuff approach with mutations #43. But in this case there will be no need to call additional method like extendWithModelMutations, it would just check for some properties in modelClass and get all info from there.
The text was updated successfully, but these errors were encountered:
It would be nice to have ability to define args and filters that should be exposed. So let's see the example.
By default it exposes lots default fileters and args. Also module allows to add custom filters through
.argFactory()
method.So the first problem is that it's hard to remove not needed filters for certain fields. Also it's became rather complicated when you have lots of models defined in different files. So in order to add some filters or args for each model, you'll need to define all that stuff somewhere (probably in your model file), then collect it into one object in file where schema is built and pass it to
.argFactory()
method.Instead of doing this it would be better if module will check for presence of some static properties in model class e.g.:
So when model will be generated it will try to get this property and if it exist it will only add filters for each field that are defined in that object.
The same approach could be implemented for additional filters and args. And as a result
.argFactory()
method will be under the hood of this module and users will just define all the stuff they need directly in model class.So it will be something similar to @timhuff approach with mutations #43. But in this case there will be no need to call additional method like
extendWithModelMutations
, it would just check for some properties inmodelClass
and get all info from there.The text was updated successfully, but these errors were encountered: