Open arlimus opened 11 months ago
I very much likes A. I think the field should have a specific error or type that is rendered custom. In this case "not set". I like the grayed out printing. We have the same case with permissions e.g. user has no permission to retrieve the data. There is nothing the user can do, so we should not print this in a full blown error but instead make it a helpful message: hey you do not have permissions to see this part of the graph.
When using fields in resources that have not been set, we currently print confusing indications for users:
What the system is trying to tell us: This resource has none of its (mandatory) values set. In this specific example, we have a resource that should be entirely pre-initialized, but has no values at all. There are also mixed use-cases, where partial values may be provided or where fields depend on values that have not been set.
None of these cases are currently handled in v9.
There are 2 possible solutions:
A: Indicate missing fields
Soft indications that no data is provided without errors or failure
B: Error on missing fields
Same as above, but every field counts as an error
C: Error on resource creation
This is what v8 does, just with better error messages for v9:
Solution
We will need to decide on which path to take for v9.
Not a v9 release blocker, as it doesn't break behavior.
Supersedes https://github.com/mondoohq/cnquery/issues/1721
Closes https://github.com/mondoohq/cnquery/pull/1894 in favor of a solution that addresses this holistically.