Skip to content

fix: home page reports a 500 when the subgraph returns no data #746

Description

@rickstaa

pages/index.tsx:316-318 renders Next's error component for any data failure:

if (hadError) {
  return <ErrorComponent statusCode={500} />;
}

The HTTP response is 200 — getStaticProps catches the failure and returns hadError — but the page paints "500 Internal Server Error". So a subgraph that is unreachable, erroring, or serving an empty deployment presents to users as a broken server, and to anyone debugging as an HTTP status that never appears in the logs.

Observed while the configured subgraph returned protocol: null: every route logged 200, the gateway returned 200, and the page still showed 500.

Fix

Distinguish "our server failed" from "the data source is unavailable". The latter deserves a degraded or empty state — the banner from #733 already exists for this — rather than a server-error page.

Needs a design decision on what the home page shows when the subgraph has nothing, so it is more than a copy change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions