Skip to content

Cannot return null for non-nullable field Epoch.number. #2148

Description

@rdewildebd

OS
Your OS: Ubuntu Noble

Versions
The db-sync version (eg cardano-db-sync --version): 13.7.2.1
PostgreSQL version: 17.9

Build/Install Method
The method you use to build or install cardano-db-sync: docker

Run method
The method you used to run cardano-db-sync (eg Nix/Docker/systemd/none): docker

Additional context
Add any other context about the problem here.

Problem Report
When running this query:

{
    "query": "query MyQuery ($whereEpochs: Epoch_bool_exp){epochs(where: $whereEpochs) {fees number output startedAt transactionsCount lastBlockTime } }",
    "variables": {
        "whereEpochs": {
        "number": {
            "_eq": 636
        }
    }
    }
}

I get an empty output + error:

{
    "data": {
        "epochs": [
            null
        ]
    },
    "errors": [
        {
            "message": "Cannot return null for non-nullable field Epoch.number.",
            "path": [
                "epochs",
                0,
                "number"
            ],
            "locations": [
                {
                    "line": 1,
                    "column": 80
                }
            ],
            "extensions": {
                "code": "INTERNAL_SERVER_ERROR",
                "exception": {
                    "stacktrace": [
                        "Error: Cannot return null for non-nullable field Epoch.number.",
                        "    at completeValue (/app/node_modules/graphql/execution/execute.js:560:13)",
                        "    at completeValueCatchingError (/app/node_modules/graphql/execution/execute.js:495:19)",
                        "    at resolveField (/app/node_modules/graphql/execution/execute.js:435:10)",
                        "    at executeFields (/app/node_modules/graphql/execution/execute.js:275:18)",
                        "    at collectAndExecuteSubfields (/app/node_modules/graphql/execution/execute.js:713:10)",
                        "    at completeObjectValue (/app/node_modules/graphql/execution/execute.js:703:10)",
                        "    at completeValue (/app/node_modules/graphql/execution/execute.js:591:12)",
                        "    at completeValueCatchingError (/app/node_modules/graphql/execution/execute.js:495:19)",
                        "    at /app/node_modules/graphql/execution/execute.js:618:25",
                        "    at Array.forEach (<anonymous>)"
                    ]
                }
            }
        }
    ]
}

I guess this is due to redesign of the epochs table, but that would mean it isn't backwards compatible?

number always seems to be null

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions