[1.17.0] Leona shouldn't fail to validate results when a required field is due to be provided by a field resolver · Issue #48 · WorksHub/leona · GitHub
More Web Proxy on the site http://driver.im/
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
We have found a problem with Leona whereby if a field is specified as required (using :req-un in the spec) then if that field is not provided by the base resolver, Leona will fail the validation even if the field is due to be serviced by a field resolver.
The above test will fail even though ::blogs has a field resolver attached.
Whilst it's clear to understand what's going on here, it feels disingenuous of Leona to punish the resolver for not returning a field that it knows is due to be serviced by a field resolver (Leona has that information in the context and schema).
Once we have the result of a resolver we should check any fields that appear in the spec that are serviced by field resolvers and exclude them from the validation (create a dynamic spec using spec-tools? or can we use s/merge in line? Not sure). Those field resolvers being excluded will be validated in isolation but because they only matched due to their appearance in the parent spec it should be sufficient that being validated in isolation means the parent is still valid.
The text was updated successfully, but these errors were encountered:
We have found a problem with Leona whereby if a field is specified as required (using
:req-un
in the spec) then if that field is not provided by the base resolver, Leona will fail the validation even if the field is due to be serviced by a field resolver.The above test will fail even though
::blogs
has a field resolver attached.Whilst it's clear to understand what's going on here, it feels disingenuous of Leona to punish the resolver for not returning a field that it knows is due to be serviced by a field resolver (Leona has that information in the context and schema).
Once we have the result of a resolver we should check any fields that appear in the spec that are serviced by field resolvers and exclude them from the validation (create a dynamic spec using spec-tools? or can we use s/merge in line? Not sure). Those field resolvers being excluded will be validated in isolation but because they only matched due to their appearance in the parent spec it should be sufficient that being validated in isolation means the parent is still valid.
The text was updated successfully, but these errors were encountered: