Skip to content

Feature: Custom http status codes support

Compare
Choose a tag to compare
@Vijar Vijar released this 03 Oct 18:43
· 555 commits to main since this release

Data-fetchers can specify an HTTP error statusCode (400, 404, etc) by tacking on a statusCode property to the error object passed into the callback. If the statusCode property exists on the error object, fetcher middleware will use that HTTP response code.

Data-fetchers can now pass a 3rd meta parameter to their CRUD callbacks. If meta.statusCode is set, then fetcher middleware will use that HTTP response code.

Thanks to @mtscout6 for noticing and implementing this in #22.