edgedb / easy-edgedb

An illustrated textbook designed to be a one-stop shop for learning EdgeDB
https://www.edgedb.com/easy-edgedb
69 stars 36 forks source link

Fix broken functions #91

Closed raddevon closed 1 year ago

raddevon commented 1 year ago

These functions no longer work. When you try to create them, you run into an error: InvalidFunctionDefinitionError: return cardinality mismatch in function declared to return exactly one value. This fixes them by using the coalescing operator to provide fallbacks to optional properties.

I have almost 7,000 words of notes on this book that I'd like to use for a more extensive refactor at some point, but this takes care of the most pressing issue I found during my review. I'll circle back to the rest later.

raddevon commented 1 year ago

I think I've addressed all your concerns here, @vpetrovykh. I also added a quick paragraph to explain why we provided a fallback for the single opponent's name but not for the group. Could you have another look when you get a chance and see if this ticks all the boxes?