Closed fatalbert3390 closed 4 years ago
It should only add the first two leaf fields by default. You can control the behavior by providing the getDefaultFieldNames
prop to the Explorer.
There is a default value defined in Explorer.js
.
Thinking about this a bit more--the behavior you're seeing is when you run the query and it's caused by graphiql itself, not the Explorer. You should provide the custom getDefaultFieldNames
prop to the GraphiQL
component. You can use the default one we defined for the explorer: https://github.com/OneGraph/graphiql-explorer/blob/00881cc5b0f17a78d5ef8c5f64e0a85cbb6d5ec8/src/Explorer.js#L218
It would be nice in the case where when no subfields are selected under certain headings, running a query didn't automatically check every single box available for that heading. For example:
I drill into
policyDetail > settings > items
, but I don't tick any boxes underitems
. I would expect to get the same error when you don't expand any of the subfields undersettings
:However, you end up with this happening:
All of the boxes under the
items
subfield are automatically checked when you run the policy, forcing you to have to go back and uncheck all of the subfields that were auto-selected.Is there a way to make the behavior the same for fields with checkboxes vs. those without?