DEV Community

Discussion on: 😰 Optional chaining trap !

Collapse
wintercounter profile image
Victor Vincent • Edited on

{ user: { can = {} } }

Thread Thread
smeijer profile image
Stephan Meijer

I'm aware of that syntax. But defaults don't work for null values. As grapql tends to return null for missing data, I don't use that syntax that much.

In a real world scenario, I would have moved the assignment out of the arguments.

Thread Thread
wintercounter profile image
Victor Vincent

Makes sense!