storage.graphql 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. fragment StorageNodeInfo on StorageBucket {
  2. id
  3. operatorMetadata {
  4. nodeEndpoint
  5. }
  6. }
  7. query getStorageNodesInfoByBagId($bagId: ID) {
  8. storageBuckets(
  9. where: {
  10. operatorStatus_json: { isTypeOf_eq: "StorageBucketOperatorStatusActive" }
  11. bags_some: { id_eq: $bagId }
  12. operatorMetadata: { nodeEndpoint_contains: "http" }
  13. }
  14. ) {
  15. ...StorageNodeInfo
  16. }
  17. }
  18. fragment DataObjectInfo on StorageDataObject {
  19. id
  20. size
  21. deletionPrize
  22. type {
  23. __typename
  24. ... on DataObjectTypeVideoMedia {
  25. video {
  26. id
  27. }
  28. }
  29. ... on DataObjectTypeVideoThumbnail {
  30. video {
  31. id
  32. }
  33. }
  34. ... on DataObjectTypeChannelAvatar {
  35. channel {
  36. id
  37. }
  38. }
  39. ... on DataObjectTypeChannelCoverPhoto {
  40. channel {
  41. id
  42. }
  43. }
  44. }
  45. }
  46. query getDataObjectsByBagId($bagId: ID) {
  47. storageDataObjects(where: { storageBag: { id_eq: $bagId } }) {
  48. ...DataObjectInfo
  49. }
  50. }
  51. query getDataObjectsByChannelId($channelId: ID) {
  52. storageDataObjects(where: { type_json: { channelId_eq: $channelId } }) {
  53. ...DataObjectInfo
  54. }
  55. }
  56. query getDataObjectsByVideoId($videoId: ID) {
  57. storageDataObjects(where: { type_json: { videoId_eq: $videoId } }) {
  58. ...DataObjectInfo
  59. }
  60. }