schema.graphql 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. """
  2. Autogenerated return type of CreatePokemon
  3. """
  4. type CreatePokemonPayload {
  5. errors: [Error!]!
  6. pokemon: Pokemon
  7. }
  8. type Error {
  9. message: String!
  10. type: String
  11. }
  12. type Mutation {
  13. createPokemon(nickname: String, pokedexNumber: ID!): CreatePokemonPayload
  14. uploadManyPokemon(base64EncodedPokemonFiles: [String!]!): UploadManyPokemonPayload
  15. uploadPokemon(base64EncodedPokemonFile: String!): UploadPokemonPayload
  16. }
  17. """
  18. An object with an ID.
  19. """
  20. interface Node {
  21. """
  22. ID of the object.
  23. """
  24. id: ID!
  25. }
  26. """
  27. Information about pagination in a connection.
  28. """
  29. type PageInfo {
  30. """
  31. When paginating forwards, the cursor to continue.
  32. """
  33. endCursor: String
  34. """
  35. When paginating forwards, are there more items?
  36. """
  37. hasNextPage: Boolean!
  38. """
  39. When paginating backwards, are there more items?
  40. """
  41. hasPreviousPage: Boolean!
  42. """
  43. When paginating backwards, the cursor to continue.
  44. """
  45. startCursor: String
  46. }
  47. """
  48. Returns a singular pokemon
  49. """
  50. type Pokemon implements Node {
  51. createdAt: Time
  52. id: ID!
  53. iid: ID!
  54. nickname: String
  55. pokedexNumber: Int
  56. updatedAt: Time
  57. }
  58. """
  59. The connection type for Pokemon.
  60. """
  61. type PokemonConnection {
  62. """
  63. A list of edges.
  64. """
  65. edges: [PokemonEdge]
  66. """
  67. A list of nodes.
  68. """
  69. nodes: [Pokemon]
  70. """
  71. Information to aid in pagination.
  72. """
  73. pageInfo: PageInfo!
  74. }
  75. """
  76. An edge in a connection.
  77. """
  78. type PokemonEdge {
  79. """
  80. A cursor for use in pagination.
  81. """
  82. cursor: String!
  83. """
  84. The item at the end of the edge.
  85. """
  86. node: Pokemon
  87. }
  88. """
  89. The root of this schema
  90. """
  91. type Query {
  92. """
  93. Fetches one or more pokemon
  94. """
  95. manyPokemon(id: String, ids: [String!], iid: ID, iids: [ID!], nickname: String, nicknames: [String!], pokedexNumber: Int, pokedexNumbers: [Int!]): [Pokemon!]!
  96. """
  97. Fetches an object given its ID.
  98. """
  99. node(
  100. """
  101. ID of the object.
  102. """
  103. id: ID!
  104. ): Node
  105. """
  106. Fetches a list of objects given a list of IDs.
  107. """
  108. nodes(
  109. """
  110. IDs of the objects.
  111. """
  112. ids: [ID!]!
  113. ): [Node]!
  114. """
  115. Fetches exactly zero or one pokemon
  116. """
  117. pokemon(id: String, ids: [String!], iid: ID, iids: [ID!], nickname: String, nicknames: [String!], pokedexNumber: Int, pokedexNumbers: [Int!]): Pokemon
  118. """
  119. Fetches one or more pokemon for Relay
  120. """
  121. pokemonConnection(
  122. """
  123. Returns the elements in the list that come after the specified cursor.
  124. """
  125. after: String
  126. """
  127. Returns the elements in the list that come before the specified cursor.
  128. """
  129. before: String
  130. """
  131. Returns the first _n_ elements from the list.
  132. """
  133. first: Int
  134. id: String
  135. ids: [String!]
  136. iid: ID
  137. iids: [ID!]
  138. """
  139. Returns the last _n_ elements from the list.
  140. """
  141. last: Int
  142. nickname: String
  143. nicknames: [String!]
  144. pokedexNumber: Int
  145. pokedexNumbers: [Int!]
  146. ): PokemonConnection!
  147. }
  148. """
  149. Time represented in ISO 8601
  150. """
  151. scalar Time
  152. """
  153. Autogenerated return type of UploadManyPokemon
  154. """
  155. type UploadManyPokemonPayload {
  156. errors: [Error!]!
  157. pokemon: [Pokemon!]
  158. }
  159. """
  160. Autogenerated return type of UploadPokemon
  161. """
  162. type UploadPokemonPayload {
  163. errors: [Error!]!
  164. pokemon: Pokemon
  165. }