-
-
Notifications
You must be signed in to change notification settings - Fork 833
Description
Scenario: I have a not-null schema object attempting to merge a null result from a subschema. This is absolutely an error in my own data, and it justifiably errors. However, the returned error is:
"Cannot read property 'Symbol(initialSubschema)' of null"
That error indicates a failure in merge code – which is sort of true, but the source of the error is my own. This would be better for both developers and maintainers if such an error was contextualized in a way that doesn't make it look like a bug in stitching code.
Suggestion: wrap the point of the final merge in a try/catch, and have the catch delegate to some kind of onMergeError handler. It'd be useful for that handler to receive the merge type, the original selection set, and all fetched data that is attempting to merge. The default return from this handler could be something generic like error while merging subschema results