Open dustymugs opened 2 years ago
hi @dustymugs, why don't you simply pass the argument to the functions?
Other than that, I highly recommend to NOT use auto-selection since it goes against the GraphQL principles. It will bring you lots of data, it will make your code more subject to breakages and so on.
Note this is a pure "dev only" thing I added to help quick hacks... I regret adding it when I see some "misuses" :-P
This is purely a hack so as to contextually control
DEFAULT_AUTO_SELECT_DEPTH
as the default value of2
may not be sufficient when sending the request and merging the response into the Operation object.Example schema:
And a basic consumption...
With the default depth of 2,
Product.tags
andProduct.releases
(amongst other fields) are not included in the merged results.With this PR, I can safely do the following and get
Product.tags
andProduct.releases
in the resultsObviously, a cleaner approach would be lovely (e.g.
Operation(Query, max_select_depth=10)
but this is the dirty solution to achieve my needs