kodadot / stick

GraphQL service for Uniques and Assets on Asset Hubs
MIT License
4 stars 10 forks source link

[stellate] nftEntities - implement some kind of NullType #263

Open yangwao opened 6 months ago

yangwao commented 6 months ago

To improve cache at Stellate

image

vikiival commented 6 months ago

Hello @yangwao, Can your colleague - guess @preschian give the parameters that were used?

Null entity

We can do custom resolvers, nftentites is a native query

where to improve

Currently our frontend is abusing indexer with bad queries

preschian commented 6 months ago

This one is mostly coming from Novawallet. ref: https://github.com/kodadot/ops-internal/issues/1460#issuecomment-2015283988

vikiival commented 6 months ago

IMG_0670

Also this one ?

[
  {
    "message": "Variable \"$orderBy\" got invalid value \"volume_DESC,supply_ASC\"; Value \"volume_DESC,supply_ASC\" does not exist in \"CollectionEntityOrderByInput\" enum. Did you mean the enum value \"volume_DESC_NULLS_LAST\"?",
    "extensions": {
      "code": "BAD_USER_INPUT",
      "exception": {
        "stacktrace": [
          "GraphQLError: Variable \"$orderBy\" got invalid value \"volume_DESC,supply_ASC\"; Value \"volume_DESC,supply_ASC\" does not exist in \"CollectionEntityOrderByInput\" enum. Did you mean the enum value \"volume_DESC_NULLS_LAST\"?",
          "    at /squid/node_modules/graphql/execution/values.js:116:15",
          "    at coerceInputValueImpl (/squid/node_modules/graphql/utilities/coerceInputValue.js:131:9)",
          "    at coerceInputValueImpl (/squid/node_modules/graphql/utilities/coerceInputValue.js:54:14)",
          "    at coerceInputValueImpl (/squid/node_modules/graphql/utilities/coerceInputValue.js:78:13)",
          "    at coerceInputValue (/squid/node_modules/graphql/utilities/coerceInputValue.js:37:10)",
          "    at _loop (/squid/node_modules/graphql/execution/values.js:109:69)",
          "    at coerceVariableValues (/squid/node_modules/graphql/execution/values.js:121:16)",
          "    at getVariableValues (/squid/node_modules/graphql/execution/values.js:50:19)",
          "    at buildExecutionContext (/squid/node_modules/graphql/execution/execute.js:203:61)",
          "    at validate (/squid/node_modules/@subsquid/openreader/lib/util/execute.js:70:51)"
        ]
      }
    }
  }
]
preschian commented 6 months ago

That one is a different case. You can check on the "Insights" tab from the dashboard.

This compares all requests vs smartphones only on ahk one day.

all request smartphone only
Capture-2024-04-03-163327 Capture-2024-04-03-163400

Please see how many "Passes" requests are different. Most of them come from Novawallet.

Capture-2024-04-03-163842

preschian commented 6 months ago

How to reproduce:

Return empty results always "PASS"

Screenshot 2024-04-03 at 18 03 59

From the chat above, there are two workarounds.

  1. Fix it on our side by implementing NullType
  2. Fix it on the client side by extending the queries. Example:
Screenshot 2024-04-03 at 18 07 27
vikiival commented 6 months ago
{ 
  "currentOwner_eq": ""
}

That should be never called :), Guess some composable is calling query like this

preschian commented 6 months ago

That should be never called :),

that one is only for example. You can change that with another address that doesn't have nft will get the same results

Screenshot 2024-04-03 at 18 52 37