is there a builtin way in Pathom 3 to have optional ("conditional"?) outputs on resolvers?
I have a bulk resolver that's effectively doing a SQL SELECT for a bunch of fields. there's a couple of fields that are possibly large embedded JSON values. only some consumers of this resolver need that large field.
IIUC the planner knows whether those fields are needed by the query, but it doesn't seem to tell the resolver that. I could roll my own with a parameter set at query time, I suppose.
every output is potentially optional in the view of Pathom 3
all validity checks are on the input side, never on the output
the approach I recommend in cases like you described is to place all output options in the output description, and in the resolver look for the expects part of the node, which will tell you which attributes are actually needed in the current execution context
env -> pcp/node -> pcp/expects
Ah, cool. Thanks for the pointer!