cardano-foundation / cardano-graphql

GraphQL API for Cardano
Apache License 2.0
263 stars 104 forks source link

Field "firstAppearedInBlock" is not defined by type Asset_order_by. #764

Open RdeWilde opened 2 years ago

RdeWilde commented 2 years ago

https://github.com/input-output-hk/cardano-graphql/blob/55524476ca625756f45734ce4dbf261910d33278/packages/api-cardano-db-hasura/src/HasuraClient.ts#L299

{
    "errors": [
        {
            "message": "Field \"firstAppearedInBlock\" is not defined by type Asset_order_by.",
            "locations": [
                {
                    "line": 5,
                    "column": 29
                }
            ],
            "extensions": {
                "code": "GRAPHQL_VALIDATION_FAILED",
                "exception": {
                    "stacktrace": [
                        "GraphQLError: Field \"firstAppearedInBlock\" is not defined by type Asset_order_by.",
                        "    at ObjectField (/app/node_modules/graphql/validation/rules/ValuesOfCorrectType.js:103:29)",
                        "    at Object.enter (/app/node_modules/graphql/language/visitor.js:324:29)",
                        "    at Object.enter (/app/node_modules/graphql/language/visitor.js:375:25)",
                        "    at visit (/app/node_modules/graphql/language/visitor.js:242:26)",
                        "    at Object.validate (/app/node_modules/graphql/validation/validate.js:73:24)",
                        "    at validate (/app/node_modules/apollo-server-core/dist/requestPipeline.js:233:34)",
                        "    at Object.<anonymous> (/app/node_modules/apollo-server-core/dist/requestPipeline.js:119:42)",
                        "    at Generator.next (<anonymous>)",
                        "    at fulfilled (/app/node_modules/apollo-server-core/dist/requestPipeline.js:5:58)",
                        "    at runMicrotasks (<anonymous>)"
                    ]
                }
            }
        },
        {
            "message": "Cannot query field \"firstAppearedInBlock\" on type \"Asset\".",
            "locations": [
                {
                    "line": 7,
                    "column": 17
                }
            ],
            "extensions": {
                "code": "GRAPHQL_VALIDATION_FAILED",
                "exception": {
                    "stacktrace": [
                        "GraphQLError: Cannot query field \"firstAppearedInBlock\" on type \"Asset\".",
                        "    at Object.Field (/app/node_modules/graphql/validation/rules/FieldsOnCorrectType.js:53:31)",
                        "    at Object.enter (/app/node_modules/graphql/language/visitor.js:324:29)",
                        "    at Object.enter (/app/node_modules/graphql/language/visitor.js:375:25)",
                        "    at visit (/app/node_modules/graphql/language/visitor.js:242:26)",
                        "    at Object.validate (/app/node_modules/graphql/validation/validate.js:73:24)",
                        "    at validate (/app/node_modules/apollo-server-core/dist/requestPipeline.js:233:34)",
                        "    at Object.<anonymous> (/app/node_modules/apollo-server-core/dist/requestPipeline.js:119:42)",
                        "    at Generator.next (<anonymous>)",
                        "    at fulfilled (/app/node_modules/apollo-server-core/dist/requestPipeline.js:5:58)",
                        "    at runMicrotasks (<anonymous>)"
                    ]
                }
            }
        }
    ]
}

Seems to prevent cardano-graphql from booting, so might require a hotfix.

https://github.com/input-output-hk/cardano-graphql/blob/55524476ca625756f45734ce4dbf261910d33278/packages/api-cardano-db-hasura/schema.graphql#L388

rhyslbw commented 2 years ago

I can't reproduce this. Are you using 7.0.0?