graphprotocol / graph-node

Graph Node indexes data from blockchains such as Ethereum and serves it over GraphQL
https://thegraph.com
Apache License 2.0
2.91k stars 969 forks source link

[Bug] Sorting subgraphs by nested FDS field throws error #5168

Open cmwhited opened 9 months ago

cmwhited commented 9 months ago

Bug report

Querying the graph-network arbitrum subgraph and sorting by metadata__displayName; throws an error (see log output). There was a recent change to the network subgraph to support File Data Services; this change moved the displayName field from the top-level Subgraph entity to be in a nested SubgraphMetadata entity that is controlled by FDS. Sorting by any field in the metadata entity throws this error.

Relevant log output

Results in this error message from graph-node

message: `Failed to get entities from store: column cc.block_range does not exist, query = /* controller='filter',application='sgd675036',route='d8217ff92881cd2a-9ef95e8b5fa290fd',action='174820478' */\nselect 'Subgraph' as entity, to_jsonb(c.*) as data from (select c.*\n from "sgd675036"."subgraph" c left join "sgd675036"."subgraph_metadata" as cc on (cc."id" = c."metadata" and cc."block_range" @> $1) \n where c.block_range @> $2 and (c."active" = $3 and c."entity_version" = $4 and exists (select 1 from "sgd675036"."subgraph_metadata" as i where i."id" = c."metadata" and i.block$ <= $5 and (left("display_name", 256) != left($6, 256))))\n\n order by cc."display_name" asc, c."id" asc\n limit 20) c -- binds: [174820478, 174820478, true, 2, 174820478, ""]

IPFS hash

No response

Subgraph name or link to explorer

https://api.thegraph.com/subgraphs/name/graphprotocol/graph-network-arbitrum

Some information to help us out

OS information

None

github-actions[bot] commented 2 months ago

Looks like this issue has been open for 6 months with no activity. Is it still relevant? If not, please remember to close it.