codegen.yml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. # Run codegen using: npm run generate
  2. # Make sure schema endpoint is accessible!
  3. schema:
  4. - https://query.joystream.org/graphql # Pioneer
  5. documents:
  6. - >
  7. query openingById($openingId: ID!) {
  8. workingGroupOpeningByUniqueInput(where: {id: $openingId}) {
  9. metadata {
  10. applicationDetails
  11. description
  12. hiringLimit
  13. expectedEnding
  14. shortDescription
  15. title
  16. }
  17. id
  18. rewardPerBlock
  19. stakeAmount
  20. unstakingPeriod
  21. }
  22. }
  23. - >
  24. query workerById($workerId: ID!) {
  25. workerByUniqueInput(where: {id: $workerId}) {
  26. membership {
  27. ...MemberFields
  28. }
  29. status {
  30. __typename
  31. }
  32. rewardPerBlock
  33. stake
  34. rewardAccount
  35. roleAccount
  36. stakeAccount
  37. }
  38. }
  39. fragment ForumCategoryFields on ForumCategory {
  40. id
  41. parentId
  42. title
  43. }
  44. fragment MemberFields on Membership {
  45. handle
  46. id
  47. controllerAccount
  48. rootAccount
  49. isVerified
  50. isFoundingMember
  51. isCouncilMember
  52. roles {
  53. id
  54. groupId
  55. status {
  56. ... on WorkerStatusActive {
  57. __typename
  58. }
  59. ... on WorkerStatusLeaving {
  60. __typename
  61. }
  62. ... on WorkerStatusLeft {
  63. __typename
  64. }
  65. ... on WorkerStatusTerminated {
  66. __typename
  67. }
  68. }
  69. isLead
  70. }
  71. }
  72. - >
  73. query applicationById($applicationId: ID!) {
  74. workingGroupApplicationByUniqueInput(where: {id: $applicationId}) {
  75. applicant {
  76. handle
  77. }
  78. openingId
  79. }
  80. }
  81. - >
  82. query memberById($memberId: ID!) {
  83. memberships(where: {id_eq: $memberId}) {
  84. ...MemberFields
  85. }
  86. }
  87. - >
  88. query memberByHandle($handle: String) {
  89. memberships(where: {handle_eq: $handle}) {
  90. ...MemberFields
  91. }
  92. }
  93. - >
  94. query membersByHandles($handles: [String!]) {
  95. memberships(where: {handle_in: $handles}) {
  96. ...MemberFields
  97. }
  98. }
  99. - >
  100. query workersByAccount($account: String!) {
  101. workers(where: {rewardAccount_eq: $account}) {
  102. id
  103. membership {
  104. ...MemberFields
  105. }
  106. }
  107. }
  108. - >
  109. query activeCouncilMembers {
  110. electedCouncils(where: {endedAtBlock_eq: null}) {
  111. councilMembers {
  112. member {
  113. ...MemberFields
  114. }
  115. }
  116. }
  117. }
  118. - >
  119. query forumThreadById($threadId: ID!) {
  120. forumThreadByUniqueInput(where: {id: $threadId}) {
  121. id
  122. title
  123. author {
  124. ...MemberFields
  125. }
  126. category {
  127. ...ForumCategoryFields
  128. }
  129. }
  130. }
  131. - >
  132. query postById($postId: ID!) {
  133. forumPostByUniqueInput(where: {id: $postId}) {
  134. id
  135. author {
  136. ...MemberFields
  137. }
  138. thread {
  139. id
  140. title
  141. author {
  142. ...MemberFields
  143. }
  144. category {
  145. ...ForumCategoryFields
  146. }
  147. }
  148. }
  149. }
  150. - >
  151. query getStorageNodes {
  152. storageBuckets(where: {dataObjectsCount_gt: 0}) {
  153. operatorMetadata {
  154. nodeEndpoint
  155. }
  156. }
  157. }
  158. - >
  159. query getStorageBagsByNodeEndpoint($nodeEndpoint: String!) {
  160. storageBuckets(where: {operatorMetadata: {nodeEndpoint_eq: $nodeEndpoint}}) {
  161. bags {
  162. storageBuckets {
  163. id
  164. }
  165. id
  166. }
  167. }
  168. }
  169. generates:
  170. ./src/qntypes.ts:
  171. plugins:
  172. - typescript
  173. - typescript-operations
  174. - typescript-graphql-request