Subgraph should expose field like lastUpdatedAt to Identify is new data is synced

Currently subgraph clients has no way to identify if any update is made in entities synced by a subgraph.
Field like lastUpdatedAt or lastUpdatedBlockNumber in Meta entity can be an indication to client that new data is synced by subgraph.

This will help subgraph clients to make decision on when to query data.


As i understand, such a thing coud be harmful to the determinism of the data. if the subgraph definition changes and in particular if it would require past data to be updated, it should be launched as a new subgraph.

If subgraph Definition changes then it will be a different subgraph all together(Different IPFS hash).

Can see any harm with that :thinking:

@steve-pro the issue you linked is on the graph-network-subgraph repo, but it sounds like the request is a general one for all subgraphs to have a lastUpdatedAt field on the metadata? Would this be for the subgraph overall (i.e. if any entity has been updated)? Do you ever have a use case where you want to know about specific entity types, or individual entities?

1 Like