Fork me on GitHub

Since the performance rework in lacinia (somewhere between 1.0 and 1.1-alpha5) empty / nil values are also required to be tagged with a type when returning a union. i.e. returning (resolve/resolve-as nil {:message "my error"}) will now raise "Field resolver returned an instance not tagged with a schema type.", where it'd previously work. Is this intentional?


It is not; if you can, please add a bug and I'll look into it.

thumbnail16:11:20 I suspect it's this specific line 😬 L1046 in com.walmartlabs.lacinia.schema.clj. If you can restore that it should work again. A simple repro would be returning nil from a field which should return a union.


I tried creating a repro but wasn't able so far. I'm not sure what caused the initial issue but it seems it was local. Sorry for the noise 😅


What’s odd is that there’s a test, but it wasn’t executed. Not sure why.


Nope, there’s a test that passes at command line and fails inside Cursive. Funny that.


Ok, I’m very confused today.


r.e. L1046, I’ll check again, but I believe that nil has its own path through that code so the check was no longer necessary.


See select-bypass-if-nil near line 1174


Anyway, I can’t reproduce the problem you are seeing; the tests (such as cover this case AFAIK and show that it is working correctly (a nil flows through OK, even for a type defined in terms of union or interface).