You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const assert = require('assert');
assert(false, 'something was missing');
But of course, if you do that inside a graphql-errors call that error will get masked. If you want to assert in a way that shows the user what went wrong you need to make your own assert:
Obviously it's not a big deal to write the above function yourself, but since it's basically just a one-liner I thought it might be nice if such a method was provided as a convenience by the library:
const { assertUserError } = require('graphql-errors');
assertUserError(false, 'something was missing');
If you think such a function is within the library's scope I'd be happy to provide a PR.
Activity