Skip to content
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

[Query Node] Adds StorageBag.objectsSize field #4818

Merged

Conversation

zeeshanakram3
Copy link
Contributor

addresses #4817

@@ -1047,6 +1047,9 @@ type StorageBag implements BaseGraphQLObject {
deletedById: ID
version: Int!
objects: [StorageDataObject!]!

"""Total size of data objects in Bag"""
objectsSize: BigInt!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just as a general question, if an older version of storage node does a query for StorageBag and they are not aware of the new schema, how will it behave? Will it fail to parse the response or just not be aware of this new field?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a new field to the graphql schema is generally future-proof (unless we make breaking changes to the schema), So if the older version of storage-node is unaware of the new schema and they don't query the new field, the query would work fine.

For example, the storage-node makes use of storageBagsConnection query to get all assigned bags. As you can see the only field being queried is bag id. So being unaware of the new schema does not create the issues.

@mnaamani mnaamani self-requested a review September 23, 2023 19:38
@mnaamani mnaamani merged commit 14b0fa3 into Joystream:master Sep 23, 2023
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants