cardano-graphql icon indicating copy to clipboard operation
cardano-graphql copied to clipboard

"unexpected" error in query to get filtered incoming transaction

Open puruoni opened this issue 2 years ago • 0 comments

Summary

I would like to filter incoming transactions by block. The following error response was returned.

Steps to reproduce the bug

Execute a request like the following

query latestTxs(
  $addresses: [String!]!
  $number: Int!
) {
  transactions(
    where: {
      inputs: { address: { _nin: $addresses} }
      outputs: { address: { _in: $addresses } }
      block: { number: { _gte: $number } }
    }
    order_by: { includedAt: desc }
    limit: 100
  )   {
    hash
    includedAt
    block {
      number
    }
    inputs {
      address
    }
    outputs {
      address
    }
  }
}

Actual Result

{
  "errors": [
    {
      "message": "database query error",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "transactions"
      ],
      "extensions": {
        "path": "$",
        "code": "unexpected",
        "exception": {
          "message": "database query error",
          "stacktrace": [
            "GraphQLError: database query error",
            "    at Object.relocatedError (/app/node_modules/@graphql-tools/utils/index.cjs.js:3350:12)",
            "    at handleNull (/app/node_modules/@graphql-tools/delegate/index.cjs.js:744:49)",
            "    at handleResult (/app/node_modules/@graphql-tools/delegate/index.cjs.js:1007:16)",
            "    at checkResultAndHandleErrors (/app/node_modules/@graphql-tools/delegate/index.cjs.js:1036:12)",
            "    at CheckResultAndHandleErrors.transformResult (/app/node_modules/@graphql-tools/delegate/index.cjs.js:1030:16)",
            "    at /app/node_modules/@graphql-tools/delegate/index.cjs.js:1187:40",
            "    at Array.reduceRight (<anonymous>)",
            "    at Transformer.transformResult (/app/node_modules/@graphql-tools/delegate/index.cjs.js:1186:37)",
            "    at /app/node_modules/@graphql-tools/delegate/index.cjs.js:1290:71",
            "    at runMicrotasks (<anonymous>)"
          ]
        }
      }
    }
  ],
  "data": null
}

Expected Result

Response narrowed down by block number for incoming transactions

Environment

Cardano-graphql 7.0.X

https://graphql-api.mainnet.dandelion.link/

Platform

  • [ ] Linux (Ubuntu)
  • [ ] Linux (Other)
  • [ ] macOS
  • [ ] Windows

Platform version

No response

Runtime

  • [ ] Node.js
  • [ ] Docker

Runtime version

No response

puruoni avatar Dec 23 '22 09:12 puruoni