rails-graphql 0.2.1 → 1.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (315) hide show
  1. checksums.yaml +4 -4
  2. data/ext/console.rb +18 -0
  3. data/ext/extconf.h +3 -0
  4. data/ext/extconf.rb +1 -54
  5. data/ext/gql_parser.c +631 -0
  6. data/ext/gql_parser.h +21 -0
  7. data/ext/shared.c +477 -0
  8. data/ext/shared.h +177 -0
  9. data/lib/generators/graphql/channel_generator.rb +27 -0
  10. data/lib/generators/graphql/controller_generator.rb +9 -4
  11. data/lib/generators/graphql/install_generator.rb +49 -0
  12. data/lib/generators/graphql/schema_generator.rb +9 -4
  13. data/lib/generators/graphql/templates/channel.erb +7 -0
  14. data/lib/generators/graphql/templates/config.rb +97 -0
  15. data/lib/generators/graphql/templates/controller.erb +2 -0
  16. data/lib/generators/graphql/templates/schema.erb +5 -3
  17. data/lib/gql_parser.so +0 -0
  18. data/lib/rails/graphql/adapters/mysql_adapter.rb +59 -0
  19. data/lib/rails/graphql/adapters/pg_adapter.rb +25 -22
  20. data/lib/rails/graphql/adapters/sqlite_adapter.rb +17 -14
  21. data/lib/rails/graphql/alternative/field_set.rb +48 -0
  22. data/lib/rails/graphql/alternative/mutation.rb +17 -0
  23. data/lib/rails/graphql/alternative/query.rb +98 -0
  24. data/lib/rails/graphql/alternative/subscription.rb +18 -0
  25. data/lib/rails/graphql/alternative.rb +20 -0
  26. data/lib/rails/graphql/argument.rb +25 -26
  27. data/lib/rails/graphql/callback.rb +30 -14
  28. data/lib/rails/graphql/collectors/hash_collector.rb +26 -7
  29. data/lib/rails/graphql/collectors/idented_collector.rb +10 -7
  30. data/lib/rails/graphql/collectors/json_collector.rb +43 -17
  31. data/lib/rails/graphql/collectors.rb +4 -4
  32. data/lib/rails/graphql/config.rb +154 -23
  33. data/lib/rails/graphql/directive/cached_directive.rb +33 -0
  34. data/lib/rails/graphql/directive/deprecated_directive.rb +10 -10
  35. data/lib/rails/graphql/directive/include_directive.rb +4 -4
  36. data/lib/rails/graphql/directive/skip_directive.rb +4 -4
  37. data/lib/rails/graphql/directive/specified_by_directive.rb +24 -0
  38. data/lib/rails/graphql/directive.rb +134 -73
  39. data/lib/rails/graphql/errors.rb +33 -4
  40. data/lib/rails/graphql/event.rb +21 -9
  41. data/lib/rails/graphql/field/authorized_field.rb +17 -6
  42. data/lib/rails/graphql/field/input_field.rb +8 -12
  43. data/lib/rails/graphql/field/mutation_field.rb +43 -9
  44. data/lib/rails/graphql/field/output_field.rb +112 -12
  45. data/lib/rails/graphql/field/proxied_field.rb +35 -26
  46. data/lib/rails/graphql/field/resolved_field.rb +27 -25
  47. data/lib/rails/graphql/field/scoped_config.rb +10 -4
  48. data/lib/rails/graphql/field/subscription_field.rb +123 -0
  49. data/lib/rails/graphql/field/typed_field.rb +69 -24
  50. data/lib/rails/graphql/field.rb +89 -74
  51. data/lib/rails/graphql/global_id.rb +89 -0
  52. data/lib/rails/graphql/helpers/attribute_delegator.rb +5 -5
  53. data/lib/rails/graphql/helpers/inherited_collection/array.rb +51 -0
  54. data/lib/rails/graphql/helpers/inherited_collection/base.rb +45 -0
  55. data/lib/rails/graphql/helpers/inherited_collection/hash.rb +88 -0
  56. data/lib/rails/graphql/helpers/inherited_collection.rb +25 -76
  57. data/lib/rails/graphql/helpers/instantiable.rb +15 -0
  58. data/lib/rails/graphql/helpers/leaf_from_ar.rb +7 -7
  59. data/lib/rails/graphql/helpers/registerable.rb +44 -62
  60. data/lib/rails/graphql/helpers/unregisterable.rb +16 -0
  61. data/lib/rails/graphql/helpers/with_arguments.rb +33 -28
  62. data/lib/rails/graphql/helpers/with_assignment.rb +6 -6
  63. data/lib/rails/graphql/helpers/with_callbacks.rb +28 -11
  64. data/lib/rails/graphql/helpers/with_description.rb +73 -0
  65. data/lib/rails/graphql/helpers/with_directives.rb +58 -30
  66. data/lib/rails/graphql/helpers/with_events.rb +22 -23
  67. data/lib/rails/graphql/helpers/with_fields.rb +86 -26
  68. data/lib/rails/graphql/helpers/with_global_id.rb +22 -0
  69. data/lib/rails/graphql/helpers/with_name.rb +44 -0
  70. data/lib/rails/graphql/helpers/with_namespace.rb +7 -4
  71. data/lib/rails/graphql/helpers/with_owner.rb +8 -7
  72. data/lib/rails/graphql/helpers/with_schema_fields.rb +162 -56
  73. data/lib/rails/graphql/helpers/with_validator.rb +9 -9
  74. data/lib/rails/graphql/helpers.rb +10 -3
  75. data/lib/rails/graphql/introspection.rb +43 -36
  76. data/lib/rails/graphql/railtie.rb +89 -33
  77. data/lib/rails/graphql/railties/app/base_channel.rb +10 -0
  78. data/lib/rails/graphql/railties/app/base_controller.rb +12 -0
  79. data/lib/rails/graphql/railties/app/views/_cable.js.erb +56 -0
  80. data/lib/rails/graphql/railties/app/views/_fetch.js.erb +20 -0
  81. data/lib/rails/graphql/railties/app/views/graphiql.html.erb +101 -0
  82. data/lib/rails/graphql/railties/base_generator.rb +5 -17
  83. data/lib/rails/graphql/railties/channel.rb +157 -0
  84. data/lib/rails/graphql/railties/controller.rb +91 -25
  85. data/lib/rails/graphql/railties/controller_runtime.rb +5 -5
  86. data/lib/rails/graphql/railties/log_subscriber.rb +81 -14
  87. data/lib/rails/graphql/request/arguments.rb +26 -50
  88. data/lib/rails/graphql/request/backtrace.rb +212 -0
  89. data/lib/rails/graphql/request/component/field.rb +98 -70
  90. data/lib/rails/graphql/request/component/fragment.rb +80 -26
  91. data/lib/rails/graphql/request/component/operation/subscription.rb +162 -4
  92. data/lib/rails/graphql/request/component/operation.rb +73 -34
  93. data/lib/rails/graphql/request/component/spread.rb +79 -27
  94. data/lib/rails/graphql/request/component/typename.rb +28 -13
  95. data/lib/rails/graphql/request/component.rb +77 -36
  96. data/lib/rails/graphql/request/context.rb +19 -9
  97. data/lib/rails/graphql/request/errors.rb +16 -6
  98. data/lib/rails/graphql/request/event.rb +23 -8
  99. data/lib/rails/graphql/request/helpers/directives.rb +69 -27
  100. data/lib/rails/graphql/request/helpers/selection_set.rb +57 -25
  101. data/lib/rails/graphql/request/helpers/value_writers.rb +24 -19
  102. data/lib/rails/graphql/request/prepared_data.rb +100 -0
  103. data/lib/rails/graphql/request/steps/authorizable.rb +24 -14
  104. data/lib/rails/graphql/request/steps/organizable.rb +111 -49
  105. data/lib/rails/graphql/request/steps/{prepareable.rb → preparable.rb} +21 -8
  106. data/lib/rails/graphql/request/steps/{resolveable.rb → resolvable.rb} +16 -7
  107. data/lib/rails/graphql/request/strategy/cached_strategy.rb +64 -0
  108. data/lib/rails/graphql/request/strategy/dynamic_instance.rb +6 -6
  109. data/lib/rails/graphql/request/strategy/multi_query_strategy.rb +6 -13
  110. data/lib/rails/graphql/request/strategy/sequenced_strategy.rb +9 -9
  111. data/lib/rails/graphql/request/strategy.rb +147 -77
  112. data/lib/rails/graphql/request/subscription.rb +82 -0
  113. data/lib/rails/graphql/request.rb +353 -104
  114. data/lib/rails/graphql/schema.rb +251 -106
  115. data/lib/rails/graphql/shortcuts.rb +33 -8
  116. data/lib/rails/graphql/source/active_record/builders.rb +64 -51
  117. data/lib/rails/graphql/source/active_record_source.rb +158 -82
  118. data/lib/rails/graphql/source/base.rb +83 -0
  119. data/lib/rails/graphql/source/builder.rb +115 -0
  120. data/lib/rails/graphql/source/scoped_arguments.rb +39 -21
  121. data/lib/rails/graphql/source.rb +90 -228
  122. data/lib/rails/graphql/subscription/provider/action_cable.rb +113 -0
  123. data/lib/rails/graphql/subscription/provider/base.rb +192 -0
  124. data/lib/rails/graphql/subscription/provider.rb +18 -0
  125. data/lib/rails/graphql/subscription/store/base.rb +141 -0
  126. data/lib/rails/graphql/subscription/store/memory.rb +136 -0
  127. data/lib/rails/graphql/subscription/store.rb +19 -0
  128. data/lib/rails/graphql/subscription.rb +17 -0
  129. data/lib/rails/graphql/to_gql.rb +29 -32
  130. data/lib/rails/graphql/type/creator.rb +196 -0
  131. data/lib/rails/graphql/type/enum/directive_location_enum.rb +11 -11
  132. data/lib/rails/graphql/type/enum/type_kind_enum.rb +3 -3
  133. data/lib/rails/graphql/type/enum.rb +44 -50
  134. data/lib/rails/graphql/type/input.rb +92 -25
  135. data/lib/rails/graphql/type/interface.rb +29 -28
  136. data/lib/rails/graphql/type/object/directive_object.rb +10 -9
  137. data/lib/rails/graphql/type/object/enum_value_object.rb +3 -3
  138. data/lib/rails/graphql/type/object/field_object.rb +24 -6
  139. data/lib/rails/graphql/type/object/input_value_object.rb +6 -7
  140. data/lib/rails/graphql/type/object/schema_object.rb +5 -8
  141. data/lib/rails/graphql/type/object/type_object.rb +62 -25
  142. data/lib/rails/graphql/type/object.rb +34 -26
  143. data/lib/rails/graphql/type/scalar/any_scalar.rb +30 -0
  144. data/lib/rails/graphql/type/scalar/bigint_scalar.rb +5 -5
  145. data/lib/rails/graphql/type/scalar/binary_scalar.rb +5 -3
  146. data/lib/rails/graphql/type/scalar/boolean_scalar.rb +8 -8
  147. data/lib/rails/graphql/type/scalar/date_scalar.rb +5 -3
  148. data/lib/rails/graphql/type/scalar/date_time_scalar.rb +5 -3
  149. data/lib/rails/graphql/type/scalar/decimal_scalar.rb +5 -3
  150. data/lib/rails/graphql/type/scalar/float_scalar.rb +5 -5
  151. data/lib/rails/graphql/type/scalar/id_scalar.rb +6 -5
  152. data/lib/rails/graphql/type/scalar/int_scalar.rb +6 -5
  153. data/lib/rails/graphql/type/scalar/json_scalar.rb +41 -0
  154. data/lib/rails/graphql/type/scalar/string_scalar.rb +18 -4
  155. data/lib/rails/graphql/type/scalar/time_scalar.rb +8 -6
  156. data/lib/rails/graphql/type/scalar.rb +26 -23
  157. data/lib/rails/graphql/type/union.rb +21 -18
  158. data/lib/rails/graphql/type.rb +43 -26
  159. data/lib/rails/graphql/type_map.rb +268 -165
  160. data/lib/rails/graphql/uri.rb +167 -0
  161. data/lib/rails/graphql/version.rb +19 -3
  162. data/lib/rails/graphql.rake +3 -0
  163. data/lib/rails/graphql.rb +91 -56
  164. data/lib/rails-graphql.rb +1 -1
  165. data/test/assets/en.yml +29 -0
  166. data/test/assets/introspection-mem.txt +1 -1
  167. data/test/assets/introspection.gql +2 -0
  168. data/test/assets/mem.gql +86 -99
  169. data/test/assets/mysql.gql +406 -0
  170. data/test/assets/sqlite.gql +96 -73
  171. data/test/assets/translate.gql +346 -0
  172. data/test/config.rb +19 -8
  173. data/test/graphql/schema_test.rb +14 -50
  174. data/test/graphql/source_test.rb +8 -85
  175. data/test/graphql/type/enum_test.rb +207 -203
  176. data/test/graphql/type/input_test.rb +14 -9
  177. data/test/graphql/type/interface_test.rb +12 -9
  178. data/test/graphql/type/object_test.rb +8 -2
  179. data/test/graphql/type/scalar/any_scalar_test.rb +38 -0
  180. data/test/graphql/type/scalar/boolean_scalar_test.rb +6 -3
  181. data/test/graphql/type/scalar/json_scalar_test.rb +23 -0
  182. data/test/graphql/type_map_test.rb +63 -81
  183. data/test/graphql/type_test.rb +0 -19
  184. data/test/graphql_test.rb +1 -1
  185. data/test/integration/{authorization/authorization_test.rb → authorization_test.rb} +40 -14
  186. data/test/integration/config.rb +36 -3
  187. data/test/integration/customization_test.rb +39 -0
  188. data/test/integration/global_id_test.rb +99 -0
  189. data/test/integration/memory/star_wars_introspection_test.rb +24 -16
  190. data/test/integration/memory/star_wars_query_test.rb +54 -3
  191. data/test/integration/memory/star_wars_validation_test.rb +3 -3
  192. data/test/integration/mysql/star_wars_introspection_test.rb +25 -0
  193. data/test/integration/persisted_query_test.rb +87 -0
  194. data/test/integration/resolver_precedence_test.rb +154 -0
  195. data/test/integration/schemas/memory.rb +24 -10
  196. data/test/integration/schemas/mysql.rb +62 -0
  197. data/test/integration/schemas/sqlite.rb +21 -12
  198. data/test/integration/sqlite/star_wars_global_id_test.rb +89 -0
  199. data/test/integration/sqlite/star_wars_introspection_test.rb +10 -0
  200. data/test/integration/sqlite/star_wars_query_test.rb +14 -1
  201. data/test/integration/translate_test.rb +73 -0
  202. data/test/test_ext.rb +16 -13
  203. metadata +125 -161
  204. data/ext/depend +0 -3
  205. data/ext/graphqlparser/Ast.cpp +0 -346
  206. data/ext/graphqlparser/Ast.h +0 -1214
  207. data/ext/graphqlparser/AstNode.h +0 -36
  208. data/ext/graphqlparser/AstVisitor.h +0 -137
  209. data/ext/graphqlparser/GraphQLParser.cpp +0 -76
  210. data/ext/graphqlparser/GraphQLParser.h +0 -55
  211. data/ext/graphqlparser/JsonVisitor.cpp +0 -161
  212. data/ext/graphqlparser/JsonVisitor.cpp.inc +0 -456
  213. data/ext/graphqlparser/JsonVisitor.h +0 -121
  214. data/ext/graphqlparser/JsonVisitor.h.inc +0 -110
  215. data/ext/graphqlparser/VERSION +0 -1
  216. data/ext/graphqlparser/c/GraphQLAst.cpp +0 -324
  217. data/ext/graphqlparser/c/GraphQLAst.h +0 -180
  218. data/ext/graphqlparser/c/GraphQLAstForEachConcreteType.h +0 -44
  219. data/ext/graphqlparser/c/GraphQLAstNode.cpp +0 -25
  220. data/ext/graphqlparser/c/GraphQLAstNode.h +0 -33
  221. data/ext/graphqlparser/c/GraphQLAstToJSON.cpp +0 -21
  222. data/ext/graphqlparser/c/GraphQLAstToJSON.h +0 -24
  223. data/ext/graphqlparser/c/GraphQLAstVisitor.cpp +0 -55
  224. data/ext/graphqlparser/c/GraphQLAstVisitor.h +0 -53
  225. data/ext/graphqlparser/c/GraphQLParser.cpp +0 -35
  226. data/ext/graphqlparser/c/GraphQLParser.h +0 -54
  227. data/ext/graphqlparser/dump_json_ast.cpp +0 -48
  228. data/ext/graphqlparser/lexer.lpp +0 -324
  229. data/ext/graphqlparser/parser.ypp +0 -693
  230. data/ext/graphqlparser/parsergen/lexer.cpp +0 -2633
  231. data/ext/graphqlparser/parsergen/lexer.h +0 -528
  232. data/ext/graphqlparser/parsergen/location.hh +0 -189
  233. data/ext/graphqlparser/parsergen/parser.tab.cpp +0 -3300
  234. data/ext/graphqlparser/parsergen/parser.tab.hpp +0 -646
  235. data/ext/graphqlparser/parsergen/position.hh +0 -179
  236. data/ext/graphqlparser/parsergen/stack.hh +0 -156
  237. data/ext/graphqlparser/syntaxdefs.h +0 -19
  238. data/ext/libgraphqlparser/AstNode.h +0 -36
  239. data/ext/libgraphqlparser/CMakeLists.txt +0 -148
  240. data/ext/libgraphqlparser/CONTRIBUTING.md +0 -23
  241. data/ext/libgraphqlparser/GraphQLParser.cpp +0 -76
  242. data/ext/libgraphqlparser/GraphQLParser.h +0 -55
  243. data/ext/libgraphqlparser/JsonVisitor.cpp +0 -161
  244. data/ext/libgraphqlparser/JsonVisitor.h +0 -121
  245. data/ext/libgraphqlparser/LICENSE +0 -22
  246. data/ext/libgraphqlparser/README.clang-tidy +0 -7
  247. data/ext/libgraphqlparser/README.md +0 -84
  248. data/ext/libgraphqlparser/ast/ast.ast +0 -203
  249. data/ext/libgraphqlparser/ast/ast.py +0 -61
  250. data/ext/libgraphqlparser/ast/c.py +0 -100
  251. data/ext/libgraphqlparser/ast/c.pyc +0 -0
  252. data/ext/libgraphqlparser/ast/c_impl.py +0 -61
  253. data/ext/libgraphqlparser/ast/c_impl.pyc +0 -0
  254. data/ext/libgraphqlparser/ast/c_visitor_impl.py +0 -39
  255. data/ext/libgraphqlparser/ast/c_visitor_impl.pyc +0 -0
  256. data/ext/libgraphqlparser/ast/casing.py +0 -26
  257. data/ext/libgraphqlparser/ast/casing.pyc +0 -0
  258. data/ext/libgraphqlparser/ast/cxx.py +0 -197
  259. data/ext/libgraphqlparser/ast/cxx.pyc +0 -0
  260. data/ext/libgraphqlparser/ast/cxx_impl.py +0 -61
  261. data/ext/libgraphqlparser/ast/cxx_impl.pyc +0 -0
  262. data/ext/libgraphqlparser/ast/cxx_json_visitor_header.py +0 -42
  263. data/ext/libgraphqlparser/ast/cxx_json_visitor_header.pyc +0 -0
  264. data/ext/libgraphqlparser/ast/cxx_json_visitor_impl.py +0 -80
  265. data/ext/libgraphqlparser/ast/cxx_json_visitor_impl.pyc +0 -0
  266. data/ext/libgraphqlparser/ast/cxx_visitor.py +0 -64
  267. data/ext/libgraphqlparser/ast/cxx_visitor.pyc +0 -0
  268. data/ext/libgraphqlparser/ast/js.py +0 -65
  269. data/ext/libgraphqlparser/ast/license.py +0 -10
  270. data/ext/libgraphqlparser/ast/license.pyc +0 -0
  271. data/ext/libgraphqlparser/c/GraphQLAstNode.cpp +0 -25
  272. data/ext/libgraphqlparser/c/GraphQLAstNode.h +0 -33
  273. data/ext/libgraphqlparser/c/GraphQLAstToJSON.cpp +0 -21
  274. data/ext/libgraphqlparser/c/GraphQLAstToJSON.h +0 -24
  275. data/ext/libgraphqlparser/c/GraphQLAstVisitor.cpp +0 -55
  276. data/ext/libgraphqlparser/c/GraphQLAstVisitor.h +0 -53
  277. data/ext/libgraphqlparser/c/GraphQLParser.cpp +0 -35
  278. data/ext/libgraphqlparser/c/GraphQLParser.h +0 -54
  279. data/ext/libgraphqlparser/clang-tidy-all.sh +0 -3
  280. data/ext/libgraphqlparser/cmake/version.cmake +0 -16
  281. data/ext/libgraphqlparser/dump_json_ast.cpp +0 -48
  282. data/ext/libgraphqlparser/go/README.md +0 -20
  283. data/ext/libgraphqlparser/go/callbacks.go +0 -18
  284. data/ext/libgraphqlparser/go/gotest.go +0 -64
  285. data/ext/libgraphqlparser/lexer.lpp +0 -324
  286. data/ext/libgraphqlparser/libgraphqlparser.pc.in +0 -11
  287. data/ext/libgraphqlparser/parser.ypp +0 -693
  288. data/ext/libgraphqlparser/parsergen/lexer.cpp +0 -2633
  289. data/ext/libgraphqlparser/parsergen/lexer.h +0 -528
  290. data/ext/libgraphqlparser/parsergen/location.hh +0 -189
  291. data/ext/libgraphqlparser/parsergen/parser.tab.cpp +0 -3300
  292. data/ext/libgraphqlparser/parsergen/parser.tab.hpp +0 -646
  293. data/ext/libgraphqlparser/parsergen/position.hh +0 -179
  294. data/ext/libgraphqlparser/parsergen/stack.hh +0 -156
  295. data/ext/libgraphqlparser/python/CMakeLists.txt +0 -14
  296. data/ext/libgraphqlparser/python/README.md +0 -5
  297. data/ext/libgraphqlparser/python/example.py +0 -31
  298. data/ext/libgraphqlparser/syntaxdefs.h +0 -19
  299. data/ext/libgraphqlparser/test/BuildCAPI.c +0 -5
  300. data/ext/libgraphqlparser/test/CMakeLists.txt +0 -25
  301. data/ext/libgraphqlparser/test/JsonVisitorTests.cpp +0 -28
  302. data/ext/libgraphqlparser/test/ParserTests.cpp +0 -352
  303. data/ext/libgraphqlparser/test/kitchen-sink.graphql +0 -59
  304. data/ext/libgraphqlparser/test/kitchen-sink.json +0 -1
  305. data/ext/libgraphqlparser/test/schema-kitchen-sink.graphql +0 -78
  306. data/ext/libgraphqlparser/test/schema-kitchen-sink.json +0 -1
  307. data/ext/libgraphqlparser/test/valgrind.supp +0 -33
  308. data/ext/version.cpp +0 -21
  309. data/lib/graphqlparser.so +0 -0
  310. data/lib/rails/graphql/native/functions.rb +0 -38
  311. data/lib/rails/graphql/native/location.rb +0 -41
  312. data/lib/rails/graphql/native/pointers.rb +0 -23
  313. data/lib/rails/graphql/native/visitor.rb +0 -349
  314. data/lib/rails/graphql/native.rb +0 -56
  315. data/test/integration/schemas/authorization.rb +0 -12
@@ -0,0 +1,167 @@
1
+ # frozen_string_literal: true
2
+
3
+ module URI
4
+ # URI::GLQ encodes objects from a GraphQL server as an URI.
5
+ # It has the components:
6
+ # All components except version and params are required.
7
+ #
8
+ # The URI format looks like "glq://namespace/class_name/gql_name".
9
+ # There are some cases where the name will be further scoped like fields in a
10
+ # query.
11
+ #
12
+ # Params use the power of +Rack::Utils.parse_nested_query+ to make sure that
13
+ # nested elements can be correctly parsed. In the presence of params, even
14
+ # with just a simple +?+ with no actual params, it indicates an instance of
15
+ # the object.
16
+ #
17
+ # TODO: Implement version
18
+ class GQL < Generic
19
+ COMPONENT = %i[scheme namespace class_name scope name params].freeze
20
+
21
+ attr_reader :class_name, :scope, :name, :params
22
+
23
+ class << self
24
+ # Create a new URI::GQL by parsing a gid string with argument check.
25
+ #
26
+ # URI::GQL.parse 'glq://base/Directive/deprecated'
27
+ #
28
+ # This differs from URI() and URI.parse which do not check arguments.
29
+ #
30
+ # URI('gql://bcx') # => URI::GQL instance
31
+ # URI.parse('gql://bcx') # => URI::GQL instance
32
+ # URI::GQL.parse('gql://bcx/') # => raises URI::InvalidComponentError
33
+ def parse(uri)
34
+ generic_components = URI.split(uri) << nil << true # nil parser, true arg_check
35
+ new(*generic_components)
36
+ end
37
+
38
+ # Shorthand to build a URI::GQL from an object and optional scope
39
+ # and params.
40
+ #
41
+ # URI::GQL.create(GraphQL::Directive::DeprecatedDirective)
42
+ def create(object, scope = nil, params = nil)
43
+ namespace = Rails::GraphQL.enumerate(object.namespaces).first || :base
44
+ klass = object.gid_base_class
45
+ klass = klass.class unless klass.is_a?(Module)
46
+
47
+ xargs = { namespace: namespace, scope: scope, params: params }
48
+ xargs[:name] = object.gql_name unless klass == Rails::GraphQL::Schema
49
+ xargs[:class_name] =
50
+ case
51
+ when klass <= Rails::GraphQL::Schema then 'Schema'
52
+ when klass <= Rails::GraphQL::Source then 'Schema'
53
+ when klass <= Rails::GraphQL::Directive then 'Directive'
54
+ when klass.superclass == Rails::GraphQL::Type then 'Type'
55
+ else klass.gql_name
56
+ end
57
+
58
+ build(xargs)
59
+ end
60
+
61
+ # Create a new URI::GQL from components with argument check.
62
+ #
63
+ # Using a hash:
64
+ #
65
+ # URI::GQL.build(app: 'bcx', model_name: 'Person', model_id: '1', params: { key: 'value' })
66
+ #
67
+ # Using an array, the arguments must be in order [app, model_name, model_id, params]:
68
+ #
69
+ # URI::GQL.build(['bcx', 'Person', '1', key: 'value'])
70
+ def build(args)
71
+ parts = Util.make_components_hash(self, args)
72
+ parts[:host] = parts[:namespace].to_s.tr('_', '-')
73
+ parts[:path] = [parts[:class_name], parts[:scope], parts[:name]].compact.join('/')
74
+ parts[:path].prepend('/')
75
+
76
+ parts[:query] = parts[:params].to_param unless parts[:params].nil?
77
+
78
+ super parts
79
+ end
80
+ end
81
+
82
+ # Make sure to convert dashes into underscore
83
+ def namespace
84
+ host.tr('-', '_').to_sym
85
+ end
86
+
87
+ # Check if the object should be instantiated
88
+ def instantiate?
89
+ !query.nil?
90
+ end
91
+
92
+ # Implement #to_s to avoid no implicit conversion of nil into string when path is nil
93
+ def to_s
94
+ +"gql://#{host}#{path}#{'?' + query if query}"
95
+ end
96
+
97
+ protected
98
+
99
+ def set_path(path)
100
+ set_components(path) unless defined?(@class_name) && @name
101
+ super
102
+ end
103
+
104
+ def query=(query)
105
+ set_params parse_query_params(query)
106
+ super
107
+ end
108
+
109
+ def set_params(params)
110
+ @params = params
111
+ end
112
+
113
+ private
114
+
115
+ def check_host(host)
116
+ validate_component(host)
117
+ super
118
+ end
119
+
120
+ def check_path(path)
121
+ validate_component(path)
122
+ set_components(path, true)
123
+ end
124
+
125
+ def check_scheme(scheme)
126
+ return super if scheme == 'gql'
127
+ raise URI::BadURIError, +"Not a gql:// URI scheme: #{inspect}"
128
+ end
129
+
130
+ def set_components(path, validate = false)
131
+ parts = path.split('/').slice(1, 3)
132
+ class_name = parts.shift
133
+ name = parts.pop
134
+
135
+ validate_component(class_name) && validate_object_name(name, class_name) if validate
136
+
137
+ @class_name = class_name
138
+ @scope = parts.shift
139
+ @name = name
140
+ end
141
+
142
+ def parse_query_params(query)
143
+ return if query.nil?
144
+ return {} if query.empty?
145
+ Rack::Utils.parse_nested_query(query)
146
+ end
147
+
148
+ def validate_component(component)
149
+ raise URI::InvalidComponentError, (+<<~MSG).squish if component.blank?
150
+ Expected a URI like gql://base/Directive/deprecated: #{inspect}.
151
+ MSG
152
+ end
153
+
154
+ def validate_object_name(name, class_name)
155
+ raise URI::InvalidComponentError, (+<<~MSG).squish if name.blank?
156
+ Unable to create a GraphQL ID for #{class_name} without an object name.
157
+ MSG
158
+ end
159
+
160
+ end
161
+
162
+ if respond_to?(:register_scheme)
163
+ register_scheme('GQL', GQL)
164
+ else
165
+ @@schemes['GQL'] = GQL
166
+ end
167
+ end
@@ -1,7 +1,23 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Rails # :nodoc:
4
- module GraphQL # :nodoc:
5
- VERSION = '0.2.1'
3
+ module Rails
4
+ module GraphQL
5
+ # Returns the currently loaded version of the GraphQL as a <tt>Gem::Version</tt>.
6
+ def self.gem_version
7
+ Gem::Version.new(version)
8
+ end
9
+
10
+ def self.version
11
+ VERSION::STRING
12
+ end
13
+
14
+ module VERSION
15
+ MAJOR = 1
16
+ MINOR = 0
17
+ TINY = 0
18
+ PRE = 'rc1'
19
+
20
+ STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
21
+ end
6
22
  end
7
23
  end
@@ -1 +1,4 @@
1
1
  # frozen_string_literal: true
2
+
3
+ # version
4
+ # cache
data/lib/rails/graphql.rb CHANGED
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'i18n'
4
+ require 'zlib'
3
5
  require 'active_model'
4
6
  require 'active_support'
5
7
 
@@ -7,14 +9,15 @@ require 'active_support/core_ext/module/attribute_accessors_per_thread'
7
9
  require 'active_support/core_ext/string/strip'
8
10
 
9
11
  require 'rails/graphql/version'
12
+ require 'rails/graphql/uri'
10
13
 
11
14
  ActiveSupport::Inflector.inflections(:en) do |inflect|
12
15
  inflect.acronym 'GraphiQL'
13
16
  inflect.acronym 'GraphQL'
14
- inflect.acronym 'GQLAst'
17
+ inflect.acronym 'URL'
15
18
  end
16
19
 
17
- module Rails # :nodoc:
20
+ module Rails
18
21
  # = Rails GraphQL
19
22
  #
20
23
  # This implementation tries to be as close as the GraphQL spec as possible,
@@ -40,45 +43,56 @@ module Rails # :nodoc:
40
43
  # * <tt>Fields:</tt> Many other types and helper containers holds a serie of
41
44
  # fields, which means that fields with the same name will probably behave
42
45
  # differently.
43
- #
44
- # TODO: Create the concept of MutationSet as a way to group mutations under
45
- # the same class but placed onto a reference
46
46
  module GraphQL
47
47
  extend ActiveSupport::Autoload
48
48
 
49
49
  include ActiveSupport::Configurable
50
50
 
51
51
  # Stores the version of the GraphQL spec used for this implementation
52
- SPEC_VERSION = 'June 2018'
52
+ SPEC_VERSION = ::GQLParser::VERSION
53
+
54
+ # Just a reusable instances of an empty array and empty hash
55
+ EMPTY_ARRAY = [].freeze
56
+ EMPTY_HASH = {}.freeze
53
57
 
54
58
  # Runtime registry for request execution time
55
59
  RuntimeRegistry = Class.new { thread_mattr_accessor :gql_runtime }
56
60
 
61
+ # Helper class to produce a ActiveSupport-compatible versioned cache key
62
+ CacheKey = Struct.new(:cache_key, :cache_version) do
63
+ def inspect
64
+ cache_version ? +"#{cache_key}[#{cache_version}]" : cache_key
65
+ end
66
+ end
67
+
57
68
  autoload :ToGQL
69
+ autoload :Event
70
+ autoload :Source
58
71
  autoload :Helpers
72
+ autoload :Callback
73
+ autoload :GlobalID
59
74
  autoload :Collectors
75
+ autoload :Alternative
76
+ autoload :Subscription
77
+
78
+ autoload :Argument
79
+ autoload :Directive
80
+ autoload :Field
81
+ autoload :Introspection
82
+ autoload :Schema
83
+ autoload :Type
84
+
85
+ autoload_under :railties do
86
+ autoload :BaseGenerator
87
+ autoload :Channel
88
+ autoload :Controller
89
+ autoload :ControllerRuntime
90
+ autoload :LogSubscriber
91
+ end
60
92
 
61
93
  eager_autoload do
62
- autoload_under :railties do
63
- autoload :BaseGenerator
64
- autoload :Controller
65
- autoload :ControllerRuntime
66
- autoload :LogSubscriber
67
- end
68
-
69
- autoload :Callback
70
- autoload :Event
71
- autoload :Native
72
- autoload :Request
73
- autoload :Source
74
94
  autoload :TypeMap
75
-
76
- autoload :Argument
77
- autoload :Directive
78
- autoload :Field
79
- autoload :Introspection
80
- autoload :Schema
81
- autoload :Type
95
+ autoload :Request
82
96
  end
83
97
 
84
98
  class << self
@@ -89,7 +103,7 @@ module Rails # :nodoc:
89
103
 
90
104
  # Find the key associated with the given +adapter_name+
91
105
  def ar_adapter_key(adapter_name)
92
- config.ar_adapters[adapter_name]
106
+ config.ar_adapters.dig(adapter_name, :key)
93
107
  end
94
108
 
95
109
  # This is a little helper to require ActiveRecord adapter specific
@@ -97,13 +111,11 @@ module Rails # :nodoc:
97
111
  def enable_ar_adapter(adapter_name)
98
112
  return if (@@loaded_adapters ||= Set.new).include?(adapter_name)
99
113
 
100
- path = "adapters/#{ar_adapter_key(adapter_name)}_adapter"
101
- $LOAD_PATH.any? do |load_path|
102
- next unless load_path.to_s =~ %r{\/app\/graphql$}
103
- next unless File.exist?("#{load_path}/#{path}.rb")
104
- load "#{load_path}/#{path}.rb"
105
- end || load("#{__dir__}/graphql/#{path}.rb")
114
+ raise ::ArgumentError, (+<<~MSG).squish unless config.ar_adapters.key?(adapter_name)
115
+ There is no GraphQL mapping for #{adapter_name} ActiveRecord adapter.
116
+ MSG
106
117
 
118
+ require(config.ar_adapters.dig(adapter_name, :path))
107
119
  @@loaded_adapters << adapter_name
108
120
  end
109
121
 
@@ -122,6 +134,30 @@ module Rails # :nodoc:
122
134
 
123
135
  alias to_graphql to_gql
124
136
 
137
+ # A generic helper to not create a new array when just iterating over
138
+ # something that may or may not be an array
139
+ def enumerate(value)
140
+ (value.is_a?(Enumerable) || value.respond_to?(:to_ary)) ? value : value.then
141
+ end
142
+
143
+ # Load a given +list+ of dependencies from the given +type+
144
+ def add_dependencies(type, *list, to: :base)
145
+ ref = config.known_dependencies
146
+
147
+ raise ArgumentError, (+<<~MSG).squish if (ref = ref[type]).nil?
148
+ There are no #{type} known dependencies.
149
+ MSG
150
+
151
+ list = list.flatten.compact.map do |item|
152
+ next item unless (item = ref[item]).nil?
153
+ raise ArgumentError, (+<<~MSG).squish
154
+ Unable to find #{item} as #{type} in known dependencies.
155
+ MSG
156
+ end
157
+
158
+ type_map.add_dependencies(list, to: to)
159
+ end
160
+
125
161
  # Returns a set instance with uniq directives from the given list.
126
162
  # If the same directive class is given twice, it will raise an exception,
127
163
  # since they must be uniq within a list of directives.
@@ -130,49 +166,46 @@ module Rails # :nodoc:
130
166
  # so the check can be performed using a +inherited_collection+.
131
167
  #
132
168
  # If a +source+ is provided, then an +:attach+ event will be triggered
133
- # for each directive on the givem source element.
134
- def directives_to_set(list, others = [], event = nil, **xargs)
135
- others = others.dup
169
+ # for each directive on the given source element.
170
+ def directives_to_set(list, others = nil, event = nil, **xargs)
171
+ return if list.blank?
136
172
 
137
173
  if (source = xargs.delete(:source)).present?
138
174
  location = xargs.delete(:location) || source.try(:directive_location)
139
175
  event ||= GraphQL::Event.new(:attach, source, phase: :definition, **xargs)
140
176
  end
141
177
 
142
- Array.wrap(list).each_with_object(Set.new) do |item, result|
143
- raise ArgumentError, <<~MSG.squish unless item.kind_of?(GraphQL::Directive)
178
+ others = others&.to_set
179
+ enumerate(list).each_with_object(Set.new) do |item, result|
180
+ raise ArgumentError, (+<<~MSG).squish unless item.kind_of?(GraphQL::Directive)
144
181
  The "#{item.class}" is not a valid directive.
145
182
  MSG
146
183
 
147
- invalid = others.present? && (others.any? { |k| k.class.eql?(item.class) })
148
- raise DuplicatedError, <<~MSG.squish if invalid
149
- A @#{item.gql_name} directive have already been provided.
184
+ check_location = location.present? && !item.locations.include?(location)
185
+ raise ArgumentError, (+<<~MSG).squish if check_location
186
+ You cannot use @#{item.gql_name} directive due to location restriction.
150
187
  MSG
151
188
 
152
- invalid_location = location.present? && !item.locations.include?(location)
153
- raise ArgumentError, <<~MSG.squish if invalid_location
154
- You cannot use @#{item.gql_name} directive due to location restriction.
189
+ check_uniqueness = !item.repeatable? && (others&.any?(item) || result.any?(item))
190
+ raise DuplicatedError, (+<<~MSG).squish if check_uniqueness
191
+ A @#{item.gql_name} directive have already been provided.
155
192
  MSG
156
193
 
157
194
  unless event.nil?
158
- item.assing_owner!(event.source)
159
- event.trigger_object(item)
195
+ begin
196
+ item.assign_owner!(event.source)
197
+ event.trigger_object(item)
198
+ item.validate!
199
+ rescue => error
200
+ raise StandardError, (+<<~MSG).squish
201
+ Unable to #{event.event_name} the @#{item.gql_name} directive: #{error.message}
202
+ MSG
203
+ end
160
204
  end
161
205
 
162
- others << item
163
206
  result << item
164
207
  end
165
208
  end
166
-
167
- def eager_load! # :nodoc:
168
- super
169
-
170
- GraphQL::Request.eager_load!
171
- GraphQL::Source.eager_load!
172
-
173
- GraphQL::Directive.eager_load!
174
- GraphQL::Type.eager_load!
175
- end
176
209
  end
177
210
  end
178
211
  end
@@ -181,3 +214,5 @@ require 'rails/graphql/config'
181
214
  require 'rails/graphql/errors'
182
215
  require 'rails/graphql/shortcuts'
183
216
  require 'rails/graphql/railtie'
217
+
218
+ ActiveSupport.run_load_hooks(:graphql, Rails::GraphQL)
data/lib/rails-graphql.rb CHANGED
@@ -1,2 +1,2 @@
1
- require 'graphqlparser'
1
+ require 'gql_parser'
2
2
  require 'rails/graphql'
@@ -0,0 +1,29 @@
1
+ en:
2
+ graphql:
3
+ sample_a: A
4
+ translate:
5
+ sample_b: B
6
+ field:
7
+ sample_c: C
8
+ schema:
9
+ sample_field: Field
10
+ sample_d: D
11
+ argument:
12
+ sample_field:
13
+ arg_sample: Argument
14
+ interface:
15
+ interface_desc: Interface
16
+ enum:
17
+ enum_desc: Enum
18
+ object:
19
+ object_desc: Object
20
+ union:
21
+ union_desc: Union
22
+ input_object:
23
+ input_desc_input: Input
24
+ scalar:
25
+ scalar_desc: Scalar
26
+ field:
27
+ sample_e: E
28
+ schema:
29
+ sample_f: F
@@ -1 +1 @@
1
- {"data":{"__schema":{"queryType":{"name":"_Query"},"mutationType":{"name":"_Mutation"},"subscriptionType":{"name":"_Subscription"},"types":[{"kind":"ENUM","name":"Episode","description":"One of the films in the Star Wars Trilogy","fields":[],"inputFields":[],"interfaces":[],"enumValues":[{"name":"NEW_HOPE","description":"Released in 1977.","isDeprecated":false,"deprecationReason":null},{"name":"EMPIRE","description":"Released in 1980.","isDeprecated":false,"deprecationReason":null},{"name":"JEDI","description":"Released in 1983.","isDeprecated":false,"deprecationReason":null}],"possibleTypes":[]},{"kind":"INTERFACE","name":"Character","description":"A character in the Star Wars Trilogy","fields":[{"name":"id","description":"The id of the character","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"ID","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"name","description":"The name of the character","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"friends","description":"The friends of the character, or an empty list if they have none","args":[],"type":{"kind":"LIST","name":null,"ofType":{"kind":"INTERFACE","name":"Character","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"appearsIn","description":"Which movies they appear in","args":[],"type":{"kind":"LIST","name":null,"ofType":{"kind":"ENUM","name":"Episode","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"secretBackstory","description":"All secrets about their past","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[{"kind":"OBJECT","name":"Human","ofType":null},{"kind":"OBJECT","name":"Droid","ofType":null}]},{"kind":"OBJECT","name":"Human","description":"A humanoid creature in the Star Wars universe","fields":[{"name":"id","description":"The id of the character","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"ID","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"name","description":"The name of the character","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"friends","description":"The friends of the character, or an empty list if they have none","args":[],"type":{"kind":"LIST","name":null,"ofType":{"kind":"INTERFACE","name":"Character","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"appearsIn","description":"Which movies they appear in","args":[],"type":{"kind":"LIST","name":null,"ofType":{"kind":"ENUM","name":"Episode","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"secretBackstory","description":"All secrets about their past","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"homePlanet","description":"The home planet of the human, or null if unknown","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":[],"interfaces":[{"kind":"INTERFACE","name":"Character","ofType":null}],"enumValues":[],"possibleTypes":[]},{"kind":"OBJECT","name":"Droid","description":"A mechanical creature in the Star Wars universe","fields":[{"name":"id","description":"The id of the character","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"ID","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"name","description":"The name of the character","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"friends","description":"The friends of the character, or an empty list if they have none","args":[],"type":{"kind":"LIST","name":null,"ofType":{"kind":"INTERFACE","name":"Character","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"appearsIn","description":"Which movies they appear in","args":[],"type":{"kind":"LIST","name":null,"ofType":{"kind":"ENUM","name":"Episode","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"secretBackstory","description":"All secrets about their past","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"primaryFunction","description":"The primary function of the droid","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":[],"interfaces":[{"kind":"INTERFACE","name":"Character","ofType":null}],"enumValues":[],"possibleTypes":[]},{"kind":"OBJECT","name":"_Query","description":null,"fields":[{"name":"__schema","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Schema","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"__type","description":null,"args":[{"name":"name","description":null,"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"defaultValue":null}],"type":{"kind":"OBJECT","name":"__Type","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"hero","description":"Find the hero of the whole saga","args":[{"name":"episode","description":"Return for a specific episode","type":{"kind":"ENUM","name":"Episode","ofType":null},"defaultValue":null}],"type":{"kind":"INTERFACE","name":"Character","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"human","description":"Find a human character","args":[{"name":"id","description":"ID of the human","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"ID","ofType":null}},"defaultValue":null}],"type":{"kind":"OBJECT","name":"Human","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"droid","description":"Find a droid character","args":[{"name":"id","description":"ID of the droid","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"ID","ofType":null}},"defaultValue":null}],"type":{"kind":"OBJECT","name":"Droid","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[]},{"kind":"OBJECT","name":"_Mutation","description":null,"fields":[{"name":"changeHuman","description":"Change the episodes of a human and return a set of characters","args":[{"name":"id","description":"The ID of the human to be changed","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"ID","ofType":null}},"defaultValue":null},{"name":"episodes","description":null,"type":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"ENUM","name":"Episode","ofType":null}}},"defaultValue":null}],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"INTERFACE","name":"Character","ofType":null}}}},"isDeprecated":false,"deprecationReason":null}],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[]},{"kind":"ENUM","name":"__TypeKind","description":"The fundamental unit of any GraphQL Schema is the type.\nThis enum enlist all the valid base types.","fields":[],"inputFields":[],"interfaces":[],"enumValues":[{"name":"SCALAR","description":"Scalar types represent primitive leaf values in a GraphQL type system.\n","isDeprecated":false,"deprecationReason":null},{"name":"OBJECT","description":"Objects represent a list of named fields, each of which yield a value of a\nspecific type.\n","isDeprecated":false,"deprecationReason":null},{"name":"INTERFACE","description":"Interfaces represent a list of named fields and their types.\n","isDeprecated":false,"deprecationReason":null},{"name":"UNION","description":"Unions represent an object that could be one of a list of GraphQL Object types.\n","isDeprecated":false,"deprecationReason":null},{"name":"ENUM","description":"Enum types, like scalar types, also represent leaf values in a GraphQL\ntype system. However Enum types describe the set of possible values.\n","isDeprecated":false,"deprecationReason":null},{"name":"INPUT_OBJECT","description":"Objects represent a list of named fields, each of which yield a value of\na specific type.\n","isDeprecated":false,"deprecationReason":null},{"name":"LIST","description":"A GraphQL list is a special collection type which declares the type of\neach item in the List (referred to as the item type of the list).\n","isDeprecated":false,"deprecationReason":null},{"name":"NON_NULL","description":"This type wraps an underlying type, and this type acts identically to that wrapped\ntype, with the exception that null is not a valid response for the wrapping type.\n","isDeprecated":false,"deprecationReason":null}],"possibleTypes":[]},{"kind":"OBJECT","name":"__Directive","description":"Directives provide a way to describe alternate runtime execution\nand type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL’s execution\nbehavior in ways field arguments will not suffice, such as conditionally\nincluding or skipping a field. Directives provide this by describing\nadditional information to the executor.","fields":[{"name":"name","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"description","description":null,"args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"locations","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"ENUM","name":"__DirectiveLocation","ofType":null}}}},"isDeprecated":false,"deprecationReason":null},{"name":"args","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__InputValue","ofType":null}}}},"isDeprecated":false,"deprecationReason":null}],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[]},{"kind":"OBJECT","name":"__EnumValue","description":"One of the values of an Enum object. It is unique within the Enum set\nof values. It's a string representation, not a numeric representation,\nof a value kept as all caps (ie. ONE_VALUE).","fields":[{"name":"name","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"description","description":null,"args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"isDeprecated","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"deprecationReason","description":null,"args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[]},{"kind":"OBJECT","name":"__Field","description":"Fields are the elements that compose both Objects and Interfaces. Each\nfield in these other objects may contain arguments and always yields\na value of a specific type.","fields":[{"name":"name","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"description","description":null,"args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"args","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__InputValue","ofType":null}}}},"isDeprecated":false,"deprecationReason":null},{"name":"type","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Type","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"isDeprecated","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"deprecationReason","description":null,"args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[]},{"kind":"OBJECT","name":"__InputValue","description":"Alongside with scalars and enums, input value objects allow the user\nto provide values to arguments on fields and directives. Different\nfrom those, input values accepts a list of keyed values, instead of\na single value.","fields":[{"name":"name","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"description","description":null,"args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"type","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Type","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"defaultValue","description":null,"args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[]},{"kind":"OBJECT","name":"__Schema","description":"A GraphQL service’s collective type system capabilities are referred\nto as that service’s \"schema\". A schema is defined in terms of the\ntypes and directives it supports as well as the root operation types\nfor each kind of operation: query, mutation, and subscription; this\ndetermines the place in the type system where those operations begin.","fields":[{"name":"types","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Type","ofType":null}}}},"isDeprecated":false,"deprecationReason":null},{"name":"queryType","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Type","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"mutationType","description":null,"args":[],"type":{"kind":"OBJECT","name":"__Type","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"subscriptionType","description":null,"args":[],"type":{"kind":"OBJECT","name":"__Type","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"directives","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Directive","ofType":null}}}},"isDeprecated":false,"deprecationReason":null}],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[]},{"kind":"OBJECT","name":"__Type","description":"The fundamental unit of any GraphQL Schema is the type. There are six\nkinds of named type definitions in GraphQL, and two wrapping types.\n\nThe most basic type is a +Scalar+. A scalar represents a primitive value,\nlike a string or an integer.\n\n+Scalars+ and +Enums+ form the leaves in response trees; the intermediate\nlevels are +Object+ types, which define a set of fields.\n\nAn +Interface+ defines a list of fields; +Object+ types that implement\nthat interface are guaranteed to implement those fields.\n\nA +Union+ defines a list of possible types; similar to interfaces,\nwhenever the type system claims a union will be returned, one of the\npossible types will be returned.\n\nFinally, oftentimes it is useful to provide complex structs as inputs\nto GraphQL field arguments or variables; the +Input Object+ type allows\nthe schema to define exactly what data is expected.","fields":[{"name":"kind","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"ENUM","name":"__TypeKind","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"name","description":null,"args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"description","description":null,"args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"fields","description":"OBJECT and INTERFACE only","args":[{"name":"includeDeprecated","description":null,"type":{"kind":"SCALAR","name":"Boolean","ofType":null},"defaultValue":"false"}],"type":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Field","ofType":null}}},"isDeprecated":false,"deprecationReason":null},{"name":"interfaces","description":"OBJECT only","args":[],"type":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Type","ofType":null}}},"isDeprecated":false,"deprecationReason":null},{"name":"possibleTypes","description":"INTERFACE and UNION only","args":[],"type":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Type","ofType":null}}},"isDeprecated":false,"deprecationReason":null},{"name":"enumValues","description":"ENUM only","args":[{"name":"includeDeprecated","description":null,"type":{"kind":"SCALAR","name":"Boolean","ofType":null},"defaultValue":"false"}],"type":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__EnumValue","ofType":null}}},"isDeprecated":false,"deprecationReason":null},{"name":"inputFields","description":"INPUT_OBJECT only","args":[],"type":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__InputValue","ofType":null}}},"isDeprecated":false,"deprecationReason":null},{"name":"ofType","description":"NON_NULL and LIST only","args":[],"type":{"kind":"OBJECT","name":"__Type","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[]},{"kind":"SCALAR","name":"String","description":"The String scalar type represents textual data, represented as UTF‐8 character\nsequences.","fields":[],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[]},{"kind":"SCALAR","name":"Boolean","description":"The Boolean scalar type represents true or false.","fields":[],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[]},{"kind":"SCALAR","name":"ID","description":"The ID scalar type represents a unique identifier and it is serialized in the same\nway as a String but it accepts both numeric and string based values as input.","fields":[],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[]},{"kind":"SCALAR","name":"Bigint","description":"The Bigint scalar type represents a signed numeric non‐fractional value.\nIt can go beyond the Int 32‐bit limit, but it's exchanged as a string.","fields":[],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[]},{"kind":"SCALAR","name":"Binary","description":"The Binary scalar type represents a Base64 string.\nNormally used to share files and uploads.","fields":[],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[]},{"kind":"SCALAR","name":"Date","description":"The Date scalar type represents a ISO 8601 string value.","fields":[],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[]},{"kind":"SCALAR","name":"DateTime","description":"The DateTime scalar type represents a ISO 8601 string value.","fields":[],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[]},{"kind":"SCALAR","name":"Decimal","description":"The Decimal scalar type represents signed fractional values with extra precision.\nThe values are exchange as string.","fields":[],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[]},{"kind":"SCALAR","name":"Time","description":"The Time scalar type that represents a distance in time using hours,\nminutes, seconds, and miliseconds.","fields":[],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[]},{"kind":"ENUM","name":"__DirectiveLocation","description":"The valid locations that a directive may be placed.","fields":[],"inputFields":[],"interfaces":[],"enumValues":[{"name":"QUERY","description":"Mark as a executable directive usable on query objects.","isDeprecated":false,"deprecationReason":null},{"name":"MUTATION","description":"Mark as a executable directive usable on mutation objects.","isDeprecated":false,"deprecationReason":null},{"name":"SUBSCRIPTION","description":"Mark as a executable directive usable on subscription objects.","isDeprecated":false,"deprecationReason":null},{"name":"FIELD","description":"Mark as a executable directive usable on field objects.","isDeprecated":false,"deprecationReason":null},{"name":"FRAGMENT_DEFINITION","description":"Mark as a executable directive usable on fragment definition objects.","isDeprecated":false,"deprecationReason":null},{"name":"FRAGMENT_SPREAD","description":"Mark as a executable directive usable on fragment spread objects.","isDeprecated":false,"deprecationReason":null},{"name":"INLINE_FRAGMENT","description":"Mark as a executable directive usable on inline fragment objects.","isDeprecated":false,"deprecationReason":null},{"name":"SCHEMA","description":"Mark as a type system directive usable on schema definitions.","isDeprecated":false,"deprecationReason":null},{"name":"SCALAR","description":"Mark as a type system directive usable on scalar definitions.","isDeprecated":false,"deprecationReason":null},{"name":"OBJECT","description":"Mark as a type system directive usable on object definitions.","isDeprecated":false,"deprecationReason":null},{"name":"FIELD_DEFINITION","description":"Mark as a type system directive usable on field definitions.","isDeprecated":false,"deprecationReason":null},{"name":"ARGUMENT_DEFINITION","description":"Mark as a type system directive usable on argument definitions.","isDeprecated":false,"deprecationReason":null},{"name":"INTERFACE","description":"Mark as a type system directive usable on interface definitions.","isDeprecated":false,"deprecationReason":null},{"name":"UNION","description":"Mark as a type system directive usable on union definitions.","isDeprecated":false,"deprecationReason":null},{"name":"ENUM","description":"Mark as a type system directive usable on enum definitions.","isDeprecated":false,"deprecationReason":null},{"name":"ENUM_VALUE","description":"Mark as a type system directive usable on enum value definitions.","isDeprecated":false,"deprecationReason":null},{"name":"INPUT_OBJECT","description":"Mark as a type system directive usable on input object definitions.","isDeprecated":false,"deprecationReason":null},{"name":"INPUT_FIELD_DEFINITION","description":"Mark as a type system directive usable on input field definitions.","isDeprecated":false,"deprecationReason":null}],"possibleTypes":[]},{"kind":"SCALAR","name":"Int","description":"The Int scalar type represents a signed 32‐bit numeric non‐fractional value.","fields":[],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[]},{"kind":"SCALAR","name":"Float","description":"The Float scalar type represents signed double‐precision fractional values.","fields":[],"inputFields":[],"interfaces":[],"enumValues":[],"possibleTypes":[]}],"directives":[{"name":"deprecated","description":"Indicate deprecated portions of a GraphQL service’s schema, such as deprecated\nfields on a type or deprecated enum values.","locations":["FIELD_DEFINITION","ENUM_VALUE"],"args":[{"name":"reason","description":"Explain why the underlying element was marked as deprecated. If possible,\nindicate what element should be used instead. This description is formatted\nusing Markdown syntax (as specified by [CommonMark](http://commonmark.org/)).","type":{"kind":"SCALAR","name":"String","ofType":null},"defaultValue":null}]},{"name":"include","description":"Allows for conditional inclusion during execution as described by the if argument.","locations":["FIELD","FRAGMENT_SPREAD","INLINE_FRAGMENT"],"args":[{"name":"if","description":"When false, the underlying element will be automatically marked as null.","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"defaultValue":null}]},{"name":"skip","description":"Allows for conditional exclusion during execution as described by the if argument.","locations":["FIELD","FRAGMENT_SPREAD","INLINE_FRAGMENT"],"args":[{"name":"if","description":"When true, the underlying element will be automatically marked as null.","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"defaultValue":null}]}]}}}
1
+ {"data":{"__schema":{"queryType":{"name":"_Query"},"mutationType":{"name":"_Mutation"},"subscriptionType":null,"types":[{"kind":"OBJECT","name":"Human","description":"A humanoid creature in the Star Wars universe","specifiedByURL":null,"fields":[{"name":"id","description":"The id of the human","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"ID","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"appearsIn","description":"Which movies they appear in","args":[],"type":{"kind":"LIST","name":null,"ofType":{"kind":"ENUM","name":"Episode","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"friends","description":"The friends of the human, or an empty list if they have none","args":[],"type":{"kind":"LIST","name":null,"ofType":{"kind":"INTERFACE","name":"Character","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"greeting","description":"A greeting phrase from this person to someone","args":[{"name":"name","description":null,"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"defaultValue":null}],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"homePlanet","description":"The home planet of the human, or null if unknown","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"name","description":"The name of the human","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"secretBackstory","description":"Where are they from and how they came to be who they are","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[{"kind":"INTERFACE","name":"Character","ofType":null}],"enumValues":null,"possibleTypes":null},{"kind":"INTERFACE","name":"Character","description":"A character in the Star Wars Trilogy","specifiedByURL":null,"fields":[{"name":"id","description":"The id of the character","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"ID","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"appearsIn","description":"Which movies they appear in","args":[],"type":{"kind":"LIST","name":null,"ofType":{"kind":"ENUM","name":"Episode","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"friends","description":"The friends of the character, or an empty list if they have none","args":[],"type":{"kind":"LIST","name":null,"ofType":{"kind":"INTERFACE","name":"Character","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"name","description":"The name of the character","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"secretBackstory","description":"All secrets about their past","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":[{"kind":"OBJECT","name":"Droid","ofType":null},{"kind":"OBJECT","name":"Human","ofType":null}]},{"kind":"ENUM","name":"Episode","description":"One of the films in the Star Wars Trilogy","specifiedByURL":null,"fields":null,"inputFields":null,"interfaces":null,"enumValues":[{"name":"NEW_HOPE","description":"Released in 1977.","isDeprecated":false,"deprecationReason":null},{"name":"EMPIRE","description":"Released in 1980.","isDeprecated":false,"deprecationReason":null},{"name":"JEDI","description":"Released in 1983.","isDeprecated":false,"deprecationReason":null}],"possibleTypes":null},{"kind":"OBJECT","name":"Droid","description":"A mechanical creature in the Star Wars universe","specifiedByURL":null,"fields":[{"name":"id","description":"The id of the droid","args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"ID","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"appearsIn","description":"Which movies they appear in","args":[],"type":{"kind":"LIST","name":null,"ofType":{"kind":"ENUM","name":"Episode","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"friends","description":"The friends of the droid, or an empty list if they have none","args":[],"type":{"kind":"LIST","name":null,"ofType":{"kind":"INTERFACE","name":"Character","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"name","description":"The name of the droid","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"primaryFunction","description":"The primary function of the droid","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"secretBackstory","description":"Construction date and the name of the designer","args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[{"kind":"INTERFACE","name":"Character","ofType":null}],"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"_Query","description":null,"specifiedByURL":null,"fields":[{"name":"droid","description":"Find a droid character","args":[{"name":"id","description":"ID of the droid","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"ID","ofType":null}},"defaultValue":null}],"type":{"kind":"OBJECT","name":"Droid","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"hero","description":"Find the hero of the whole saga","args":[{"name":"episode","description":"Return for a specific episode","type":{"kind":"ENUM","name":"Episode","ofType":null},"defaultValue":null}],"type":{"kind":"INTERFACE","name":"Character","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"human","description":"Find a human character","args":[{"name":"id","description":"ID of the human","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"ID","ofType":null}},"defaultValue":null}],"type":{"kind":"OBJECT","name":"Human","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"_Mutation","description":null,"specifiedByURL":null,"fields":[{"name":"changeHuman","description":"Change the episodes of a human and return a set of characters","args":[{"name":"id","description":"The ID of the human to be changed","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"ID","ofType":null}},"defaultValue":null},{"name":"episodes","description":null,"type":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"ENUM","name":"Episode","ofType":null}}},"defaultValue":null}],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"INTERFACE","name":"Character","ofType":null}}}},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"SCALAR","name":"Boolean","description":"The Boolean scalar type represents true or false.","specifiedByURL":null,"fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null},{"kind":"SCALAR","name":"String","description":"The String scalar type represents textual data, represented as UTF-8 character\nsequences.","specifiedByURL":null,"fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null},{"kind":"SCALAR","name":"Float","description":"The Float scalar type represents signed double-precision fractional values.","specifiedByURL":null,"fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null},{"kind":"SCALAR","name":"Int","description":"The Int scalar type represents a signed 32-bit numeric non-fractional value.","specifiedByURL":null,"fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null},{"kind":"SCALAR","name":"ID","description":"The ID scalar type represents a unique identifier and it is serialized in the same\nway as a String but it accepts both numeric and string based values as input.","specifiedByURL":null,"fields":null,"inputFields":null,"interfaces":null,"enumValues":null,"possibleTypes":null},{"kind":"ENUM","name":"__TypeKind","description":"The fundamental unit of any GraphQL Schema is the type.\nThis enum enlist all the valid base types.","specifiedByURL":null,"fields":null,"inputFields":null,"interfaces":null,"enumValues":[{"name":"SCALAR","description":"Scalar types represent primitive leaf values in a GraphQL type system.\n","isDeprecated":false,"deprecationReason":null},{"name":"OBJECT","description":"Objects represent a list of named fields, each of which yield a value of a\nspecific type.\n","isDeprecated":false,"deprecationReason":null},{"name":"INTERFACE","description":"Interfaces represent a list of named fields and their types.\n","isDeprecated":false,"deprecationReason":null},{"name":"UNION","description":"Unions represent an object that could be one of a list of GraphQL Object types.\n","isDeprecated":false,"deprecationReason":null},{"name":"ENUM","description":"Enum types, like scalar types, also represent leaf values in a GraphQL\ntype system. However Enum types describe the set of possible values.\n","isDeprecated":false,"deprecationReason":null},{"name":"INPUT_OBJECT","description":"Objects represent a list of named fields, each of which yield a value of\na specific type.\n","isDeprecated":false,"deprecationReason":null},{"name":"LIST","description":"A GraphQL list is a special collection type which declares the type of\neach item in the List (referred to as the item type of the list).\n","isDeprecated":false,"deprecationReason":null},{"name":"NON_NULL","description":"This type wraps an underlying type, and this type acts identically to that wrapped\ntype, with the exception that null is not a valid response for the wrapping type.\n","isDeprecated":false,"deprecationReason":null}],"possibleTypes":null},{"kind":"ENUM","name":"__DirectiveLocation","description":"The valid locations that a directive may be placed.","specifiedByURL":null,"fields":null,"inputFields":null,"interfaces":null,"enumValues":[{"name":"QUERY","description":"Mark as a executable directive usable on query objects.","isDeprecated":false,"deprecationReason":null},{"name":"MUTATION","description":"Mark as a executable directive usable on mutation objects.","isDeprecated":false,"deprecationReason":null},{"name":"SUBSCRIPTION","description":"Mark as a executable directive usable on subscription objects.","isDeprecated":false,"deprecationReason":null},{"name":"FIELD","description":"Mark as a executable directive usable on field objects.","isDeprecated":false,"deprecationReason":null},{"name":"FRAGMENT_DEFINITION","description":"Mark as a executable directive usable on fragment definition objects.","isDeprecated":false,"deprecationReason":null},{"name":"FRAGMENT_SPREAD","description":"Mark as a executable directive usable on fragment spread objects.","isDeprecated":false,"deprecationReason":null},{"name":"INLINE_FRAGMENT","description":"Mark as a executable directive usable on inline fragment objects.","isDeprecated":false,"deprecationReason":null},{"name":"SCHEMA","description":"Mark as a type system directive usable on schema definitions.","isDeprecated":false,"deprecationReason":null},{"name":"SCALAR","description":"Mark as a type system directive usable on scalar definitions.","isDeprecated":false,"deprecationReason":null},{"name":"OBJECT","description":"Mark as a type system directive usable on object definitions.","isDeprecated":false,"deprecationReason":null},{"name":"FIELD_DEFINITION","description":"Mark as a type system directive usable on field definitions.","isDeprecated":false,"deprecationReason":null},{"name":"ARGUMENT_DEFINITION","description":"Mark as a type system directive usable on argument definitions.","isDeprecated":false,"deprecationReason":null},{"name":"INTERFACE","description":"Mark as a type system directive usable on interface definitions.","isDeprecated":false,"deprecationReason":null},{"name":"UNION","description":"Mark as a type system directive usable on union definitions.","isDeprecated":false,"deprecationReason":null},{"name":"ENUM","description":"Mark as a type system directive usable on enum definitions.","isDeprecated":false,"deprecationReason":null},{"name":"ENUM_VALUE","description":"Mark as a type system directive usable on enum value definitions.","isDeprecated":false,"deprecationReason":null},{"name":"INPUT_OBJECT","description":"Mark as a type system directive usable on input object definitions.","isDeprecated":false,"deprecationReason":null},{"name":"INPUT_FIELD_DEFINITION","description":"Mark as a type system directive usable on input field definitions.","isDeprecated":false,"deprecationReason":null}],"possibleTypes":null},{"kind":"OBJECT","name":"__InputValue","description":"Arguments provided to Fields or Directives and the input fields of an\nInputObject are represented as Input Values which describe their type\nand optionally a default value.","specifiedByURL":null,"fields":[{"name":"defaultValue","description":null,"args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"description","description":null,"args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"name","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"type","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Type","ofType":null}},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"__Field","description":"Fields are the elements that compose both Objects and Interfaces. Each\nfield in these other objects may contain arguments and always yields\na value of a specific type.","specifiedByURL":null,"fields":[{"name":"args","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__InputValue","ofType":null}}}},"isDeprecated":false,"deprecationReason":null},{"name":"deprecationReason","description":null,"args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"description","description":null,"args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"isDeprecated","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"name","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"type","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Type","ofType":null}},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"__EnumValue","description":"One of the values of an Enum object. It is unique within the Enum set\nof values. It's a string representation, not a numeric representation,\nof a value kept as all caps (ie. ONE_VALUE).","specifiedByURL":null,"fields":[{"name":"deprecationReason","description":null,"args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"description","description":null,"args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"isDeprecated","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"name","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"__Directive","description":"Directives provide a way to describe alternate runtime execution\nand type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution\nbehavior in ways field arguments will not suffice, such as conditionally\nincluding or skipping a field. Directives provide this by describing\nadditional information to the executor.","specifiedByURL":null,"fields":[{"name":"args","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__InputValue","ofType":null}}}},"isDeprecated":false,"deprecationReason":null},{"name":"description","description":null,"args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"isRepeatable","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"locations","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"ENUM","name":"__DirectiveLocation","ofType":null}}}},"isDeprecated":false,"deprecationReason":null},{"name":"name","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"__Type","description":"The fundamental unit of any GraphQL Schema is the type. There are six\nkinds of named type definitions in GraphQL, and two wrapping types.\n\nThe most basic type is a +Scalar+. A scalar represents a primitive value,\nlike a string or an integer.\n\n+Scalars+ and +Enums+ form the leaves in response trees; the intermediate\nlevels are +Object+ types, which define a set of fields.\n\nAn +Interface+ defines a list of fields; +Object+ types that implement\nthat interface are guaranteed to implement those fields.\n\nA +Union+ defines a list of possible types; similar to interfaces,\nwhenever the type system claims a union will be returned, one of the\npossible types will be returned.\n\nFinally, oftentimes it is useful to provide complex structs as inputs\nto GraphQL field arguments or variables; the +Input Object+ type allows\nthe schema to define exactly what data is expected.","specifiedByURL":null,"fields":[{"name":"description","description":null,"args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"enumValues","description":"ENUM only","args":[{"name":"includeDeprecated","description":null,"type":{"kind":"SCALAR","name":"Boolean","ofType":null},"defaultValue":"false"}],"type":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__EnumValue","ofType":null}}},"isDeprecated":false,"deprecationReason":null},{"name":"fields","description":"OBJECT and INTERFACE only","args":[{"name":"includeDeprecated","description":null,"type":{"kind":"SCALAR","name":"Boolean","ofType":null},"defaultValue":"false"}],"type":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Field","ofType":null}}},"isDeprecated":false,"deprecationReason":null},{"name":"inputFields","description":"INPUT_OBJECT only","args":[],"type":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__InputValue","ofType":null}}},"isDeprecated":false,"deprecationReason":null},{"name":"interfaces","description":"OBJECT only","args":[],"type":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Type","ofType":null}}},"isDeprecated":false,"deprecationReason":null},{"name":"kind","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"ENUM","name":"__TypeKind","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"name","description":null,"args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"ofType","description":"NON_NULL and LIST only","args":[],"type":{"kind":"OBJECT","name":"__Type","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"possibleTypes","description":"INTERFACE and UNION only","args":[],"type":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Type","ofType":null}}},"isDeprecated":false,"deprecationReason":null},{"name":"specifiedByURL","description":null,"args":[],"type":{"kind":"SCALAR","name":"String","ofType":null},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null},{"kind":"OBJECT","name":"__Schema","description":"A GraphQL service's collective type system capabilities are referred\nto as that service's \"schema\". A schema is defined in terms of the\ntypes and directives it supports as well as the root operation types\nfor each kind of operation: query, mutation, and subscription; this\ndetermines the place in the type system where those operations begin.","specifiedByURL":null,"fields":[{"name":"directives","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Directive","ofType":null}}}},"isDeprecated":false,"deprecationReason":null},{"name":"mutationType","description":null,"args":[],"type":{"kind":"OBJECT","name":"__Type","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"queryType","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Type","ofType":null}},"isDeprecated":false,"deprecationReason":null},{"name":"subscriptionType","description":null,"args":[],"type":{"kind":"OBJECT","name":"__Type","ofType":null},"isDeprecated":false,"deprecationReason":null},{"name":"types","description":null,"args":[],"type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Type","ofType":null}}}},"isDeprecated":false,"deprecationReason":null}],"inputFields":null,"interfaces":[],"enumValues":null,"possibleTypes":null}],"directives":[{"name":"specifiedBy","description":"A built-in directive used within the type system definition language to provide\na scalar specification URL for specifying the behavior of custom scalar types.","locations":["SCALAR"],"args":[{"name":"url","description":"Point to a human-readable specification of the data format.","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}},"defaultValue":null}],"isRepeatable":false},{"name":"skip","description":"Allows for conditional exclusion during execution as described by the if argument.","locations":["FIELD","FRAGMENT_SPREAD","INLINE_FRAGMENT"],"args":[{"name":"if","description":"When true, the underlying element will be automatically marked as null.","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"defaultValue":null}],"isRepeatable":false},{"name":"include","description":"Allows for conditional inclusion during execution as described by the if argument.","locations":["FIELD","FRAGMENT_SPREAD","INLINE_FRAGMENT"],"args":[{"name":"if","description":"When false, the underlying element will be automatically marked as null.","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}},"defaultValue":null}],"isRepeatable":false},{"name":"deprecated","description":"Indicate deprecated portions of a GraphQL service's schema, such as deprecated\nfields on a type or deprecated enum values.","locations":["FIELD_DEFINITION","ENUM_VALUE"],"args":[{"name":"reason","description":"Explain why the underlying element was marked as deprecated. If possible,\nindicate what element should be used instead. This description is formatted\nusing Markdown syntax (as specified by [CommonMark](http://commonmark.org/)).","type":{"kind":"SCALAR","name":"String","ofType":null},"defaultValue":null}],"isRepeatable":false}]}}}