Skip to content

[Query Node] Adds StorageBag.objectsSize field#4818

Merged
mnaamani merged 2 commits intoJoystream:masterfrom
zeeshanakram3:qn_add_storage_bag_size_field
Sep 23, 2023
Merged

[Query Node] Adds StorageBag.objectsSize field#4818
mnaamani merged 2 commits intoJoystream:masterfrom
zeeshanakram3:qn_add_storage_bag_size_field

Conversation

@zeeshanakram3
Copy link
Copy Markdown
Contributor

addresses #4817

objects: [StorageDataObject!]!

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

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
Copy Markdown
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
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.

2 participants