Closed FINDarkside closed 1 year ago
Adds serverSidePostQuery function option to relay-nextjs which allows to access returned query data and NextContext after the query has finished during SSR. This allows to handle stuff like 404 status codes for non-existing pages. Related: #15
serverSidePostQuery
NextContext
Example usage:
serverSidePostQuery: (queryResponse: any, ctx) => { if (!queryResponse?.data?.company && ctx.res) { ctx.res.statusCode = 404; } },
Any feedback welcome.
Added it to docs!
This is now published in v0.10.0 🥳
v0.10.0
Adds
serverSidePostQuery
function option to relay-nextjs which allows to access returned query data andNextContext
after the query has finished during SSR. This allows to handle stuff like 404 status codes for non-existing pages. Related: #15Example usage:
Any feedback welcome.