queries.graphql 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. # TODO: remove after issue fix: https://github.com/Joystream/joystream/issues/2811
  2. fragment StorageBucketIds on StorageBucket {
  3. id
  4. }
  5. query getStorageBucketsConnection($limit: Int, $cursor: String) {
  6. storageBucketsConnection(
  7. first: $limit
  8. after: $cursor
  9. where: { operatorStatus_json: { isTypeOf_eq: "StorageBucketOperatorStatusActive" } }
  10. ) {
  11. edges {
  12. cursor
  13. node {
  14. ...StorageBucketIds
  15. }
  16. }
  17. pageInfo {
  18. hasNextPage
  19. endCursor
  20. }
  21. totalCount
  22. }
  23. }
  24. query getStorageBucketDetailsByWorkerId($workerId: ID, $limit: Int, $cursor: String) {
  25. storageBucketsConnection(
  26. first: $limit
  27. after: $cursor
  28. where: { operatorStatus_json: { isTypeOf_eq: "StorageBucketOperatorStatusActive", workerId_eq: $workerId } }
  29. ) {
  30. edges {
  31. cursor
  32. node {
  33. ...StorageBucketIds
  34. }
  35. }
  36. pageInfo {
  37. hasNextPage
  38. endCursor
  39. }
  40. totalCount
  41. }
  42. }
  43. fragment StorageBucketDetails on StorageBucket {
  44. id
  45. operatorMetadata {
  46. id
  47. nodeEndpoint
  48. }
  49. operatorStatus {
  50. ... on StorageBucketOperatorStatusActive {
  51. workerId
  52. }
  53. ... on StorageBucketOperatorStatusInvited {
  54. workerId
  55. }
  56. }
  57. }
  58. query getStorageBucketDetails($ids: [ID!], $offset: Int, $limit: Int) {
  59. storageBuckets(where: { id_in: $ids }, offset: $offset, limit: $limit) {
  60. ...StorageBucketDetails
  61. }
  62. }
  63. fragment StorageBagDetails on StorageBag {
  64. id
  65. storageBuckets {
  66. id
  67. }
  68. }
  69. query getStorageBagDetails($bucketIds: [ID!], $offset: Int, $limit: Int) {
  70. storageBags(offset: $offset, limit: $limit, where: { storageBuckets_some: { id_in: $bucketIds } }) {
  71. ...StorageBagDetails
  72. }
  73. }
  74. query getBagConnection($bucketIds: [ID!], $limit: Int, $cursor: String) {
  75. storageBagsConnection(first: $limit, after: $cursor, where: { storageBuckets_some: { id_in: $bucketIds } }) {
  76. edges {
  77. cursor
  78. node {
  79. ...StorageBagDetails
  80. }
  81. }
  82. pageInfo {
  83. hasNextPage
  84. endCursor
  85. }
  86. totalCount
  87. }
  88. }
  89. fragment DataObjectDetails on StorageDataObject {
  90. id
  91. storageBagId
  92. }
  93. query getDataObjectConnection($bagIds: StorageBagWhereInput, $limit: Int, $cursor: String) {
  94. storageDataObjectsConnection(first: $limit, after: $cursor, where: { storageBag: $bagIds, isAccepted_eq: true }) {
  95. edges {
  96. cursor
  97. node {
  98. ...DataObjectDetails
  99. }
  100. }
  101. pageInfo {
  102. hasNextPage
  103. endCursor
  104. }
  105. totalCount
  106. }
  107. }