Skip to content

enhance(stitch) better error handling for merge errors #2016

@gmac

Description

@gmac

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions