Closed mauricioszabo closed 3 years ago
This should work still because :c
was marked as optional, and Pathom always merges all the data that comes in, so by the time it calls the :sum
it does have :c
, even though wasn't declared.
I have some ideas to add some "linter" code to tell the user it should have expressed :c
in the output. But in the terms of behavior, it's correct. Closing for now.
Ok, but if I don't declare, in sum-all
, that :c
is an optional input that resolver is never called... is that expected too?
Correct, because them Pathom scan will see no path to do it.
Yes, that's expected on lenient mode, I think the linter thing will be nice to point when this kind of thing happens, just need to be something that the user chooses to run because it can add some overhead for production apps.
So, recently I made a typo in my output. And it... worked? this seems weird that's possible.
On newer versions of Pathom this don't work anymore, but the output keeps leaking (if I ask for the leaked attribute as an optional input, it'll be accepted. Even worse, it'll be resolved by the query even if we don't want that)