-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GraphQL route for dumping entity changes in subgraph and block #3275
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Looks good so far!
This commit changes the GraphQL interface for the `entityChangesInBlock` route to clearly demarcate entity updates and entity deletions. Insertions and updates are still *not* discernible, which is less of a concern. Entity fields and values are returned as JSON strings rather than scalars for simplicity.
4729f6e
to
eafd61b
Compare
2566832
to
4e8c705
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last request: can we ensure that all returned values are sorted deterministically so we don't have to do it in the client? I see we're doing it for entity fields, but not for entities, entity types, deletions etc.
Yeah, that would be a good idea. Any reasonable order (e.g. ID, alphabetic) as long as it's deterministic? |
I'd order type names alphabetically, and then the entities by ID (alphabetically again). |
@neysofu Another small request: There are a few tables in deployment schemas that are internal, e.g. I think after that we're done here, I've tested the PR and it works great! |
@Jannis I'm also removing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fantastic!
Addressed all questions and refactored x-checking logic between updates and deletions.
* store,server: Add GraphQL route for `entitiesChangedInBlock` * graph,store,index-node: Separate deletes & updates This commit changes the GraphQL interface for the `entityChangesInBlock` route to clearly demarcate entity updates and entity deletions. Insertions and updates are still *not* discernible, which is less of a concern. Entity fields and values are returned as JSON strings rather than scalars for simplicity. * store: Optimize query filtering on `block_range` * index-node: Renaming of `EntityData` subfields * graph,index-node,store: Switch to EntityOperation * graph,index-node: Add support for fields as JSONObject * index-node: Aggregate entities with the same type * store: Improve & document deletions x-checking * index-node: Remove bad `subgraph` GraphQL route * index-node: Use object! macro for constructing maps * index-node: Leave it to object! to do type conversions * index-node: Deterministic results in entityChangesInBlock * store: Remove metadata from entity changes results
Closes #3274.
The GraphQL API implemented here looks like the following (a bit different from #3274's first draft; after collecting feedback):