rails-graphql 0.2.0 → 1.0.0.beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (297) 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 +646 -0
  6. data/ext/shared.c +482 -0
  7. data/ext/shared.h +177 -0
  8. data/lib/gql_parser.so +0 -0
  9. data/lib/rails/graphql/adapters/mysql_adapter.rb +59 -0
  10. data/lib/rails/graphql/adapters/pg_adapter.rb +25 -22
  11. data/lib/rails/graphql/adapters/sqlite_adapter.rb +17 -14
  12. data/lib/rails/graphql/alternative/field_set.rb +36 -0
  13. data/lib/rails/graphql/alternative/mutation.rb +17 -0
  14. data/lib/rails/graphql/alternative/query.rb +93 -0
  15. data/lib/rails/graphql/alternative/subscription.rb +17 -0
  16. data/lib/rails/graphql/alternative.rb +20 -0
  17. data/lib/rails/graphql/argument.rb +21 -24
  18. data/lib/rails/graphql/callback.rb +24 -9
  19. data/lib/rails/graphql/collectors/hash_collector.rb +14 -6
  20. data/lib/rails/graphql/collectors/idented_collector.rb +10 -7
  21. data/lib/rails/graphql/collectors/json_collector.rb +22 -17
  22. data/lib/rails/graphql/collectors.rb +4 -4
  23. data/lib/rails/graphql/config.rb +130 -15
  24. data/lib/rails/graphql/directive/cached_directive.rb +33 -0
  25. data/lib/rails/graphql/directive/deprecated_directive.rb +10 -10
  26. data/lib/rails/graphql/directive/include_directive.rb +5 -4
  27. data/lib/rails/graphql/directive/skip_directive.rb +5 -4
  28. data/lib/rails/graphql/directive.rb +118 -63
  29. data/lib/rails/graphql/errors.rb +33 -4
  30. data/lib/rails/graphql/event.rb +16 -5
  31. data/lib/rails/graphql/field/authorized_field.rb +19 -3
  32. data/lib/rails/graphql/field/input_field.rb +11 -10
  33. data/lib/rails/graphql/field/mutation_field.rb +42 -7
  34. data/lib/rails/graphql/field/output_field.rb +102 -13
  35. data/lib/rails/graphql/field/proxied_field.rb +31 -22
  36. data/lib/rails/graphql/field/resolved_field.rb +26 -24
  37. data/lib/rails/graphql/field/scoped_config.rb +10 -4
  38. data/lib/rails/graphql/field/subscription_field.rb +140 -0
  39. data/lib/rails/graphql/field/typed_field.rb +43 -22
  40. data/lib/rails/graphql/field.rb +70 -56
  41. data/lib/rails/graphql/global_id.rb +85 -0
  42. data/lib/rails/graphql/helpers/attribute_delegator.rb +5 -5
  43. data/lib/rails/graphql/helpers/inherited_collection/array.rb +50 -0
  44. data/lib/rails/graphql/helpers/inherited_collection/base.rb +43 -0
  45. data/lib/rails/graphql/helpers/inherited_collection/hash.rb +87 -0
  46. data/lib/rails/graphql/helpers/inherited_collection.rb +25 -76
  47. data/lib/rails/graphql/helpers/instantiable.rb +15 -0
  48. data/lib/rails/graphql/helpers/leaf_from_ar.rb +7 -7
  49. data/lib/rails/graphql/helpers/registerable.rb +44 -62
  50. data/lib/rails/graphql/helpers/unregisterable.rb +16 -0
  51. data/lib/rails/graphql/helpers/with_arguments.rb +31 -27
  52. data/lib/rails/graphql/helpers/with_assignment.rb +10 -8
  53. data/lib/rails/graphql/helpers/with_callbacks.rb +25 -8
  54. data/lib/rails/graphql/helpers/with_description.rb +71 -0
  55. data/lib/rails/graphql/helpers/with_directives.rb +54 -30
  56. data/lib/rails/graphql/helpers/with_events.rb +21 -23
  57. data/lib/rails/graphql/helpers/with_fields.rb +76 -22
  58. data/lib/rails/graphql/helpers/with_global_id.rb +22 -0
  59. data/lib/rails/graphql/helpers/with_name.rb +43 -0
  60. data/lib/rails/graphql/helpers/with_namespace.rb +7 -4
  61. data/lib/rails/graphql/helpers/with_owner.rb +8 -7
  62. data/lib/rails/graphql/helpers/with_schema_fields.rb +137 -55
  63. data/lib/rails/graphql/helpers/with_validator.rb +9 -9
  64. data/lib/rails/graphql/helpers.rb +10 -3
  65. data/lib/rails/graphql/introspection.rb +43 -36
  66. data/lib/rails/graphql/railtie.rb +88 -33
  67. data/lib/rails/graphql/railties/base_generator.rb +3 -9
  68. data/lib/rails/graphql/railties/channel.rb +157 -0
  69. data/lib/rails/graphql/railties/controller.rb +62 -17
  70. data/lib/rails/graphql/railties/controller_runtime.rb +5 -5
  71. data/lib/rails/graphql/railties/log_subscriber.rb +81 -14
  72. data/lib/rails/graphql/request/arguments.rb +24 -49
  73. data/lib/rails/graphql/request/backtrace.rb +191 -0
  74. data/lib/rails/graphql/request/component/field.rb +86 -65
  75. data/lib/rails/graphql/request/component/fragment.rb +72 -24
  76. data/lib/rails/graphql/request/component/operation/subscription.rb +164 -4
  77. data/lib/rails/graphql/request/component/operation.rb +63 -31
  78. data/lib/rails/graphql/request/component/spread.rb +68 -25
  79. data/lib/rails/graphql/request/component/typename.rb +27 -12
  80. data/lib/rails/graphql/request/component.rb +75 -36
  81. data/lib/rails/graphql/request/context.rb +18 -8
  82. data/lib/rails/graphql/request/errors.rb +16 -6
  83. data/lib/rails/graphql/request/event.rb +19 -8
  84. data/lib/rails/graphql/request/helpers/directives.rb +68 -27
  85. data/lib/rails/graphql/request/helpers/selection_set.rb +51 -25
  86. data/lib/rails/graphql/request/helpers/value_writers.rb +18 -16
  87. data/lib/rails/graphql/request/prepared_data.rb +98 -0
  88. data/lib/rails/graphql/request/steps/authorizable.rb +24 -14
  89. data/lib/rails/graphql/request/steps/organizable.rb +110 -48
  90. data/lib/rails/graphql/request/steps/{prepareable.rb → preparable.rb} +20 -7
  91. data/lib/rails/graphql/request/steps/{resolveable.rb → resolvable.rb} +15 -6
  92. data/lib/rails/graphql/request/strategy/cached_strategy.rb +64 -0
  93. data/lib/rails/graphql/request/strategy/dynamic_instance.rb +6 -6
  94. data/lib/rails/graphql/request/strategy/multi_query_strategy.rb +6 -13
  95. data/lib/rails/graphql/request/strategy/sequenced_strategy.rb +9 -9
  96. data/lib/rails/graphql/request/strategy.rb +131 -75
  97. data/lib/rails/graphql/request/subscription.rb +80 -0
  98. data/lib/rails/graphql/request.rb +305 -86
  99. data/lib/rails/graphql/schema.rb +240 -48
  100. data/lib/rails/graphql/shortcuts.rb +22 -3
  101. data/lib/rails/graphql/source/active_record/builders.rb +50 -36
  102. data/lib/rails/graphql/source/active_record_source.rb +70 -54
  103. data/lib/rails/graphql/source/base.rb +111 -0
  104. data/lib/rails/graphql/source/builder.rb +128 -0
  105. data/lib/rails/graphql/source/scoped_arguments.rb +31 -19
  106. data/lib/rails/graphql/source.rb +89 -213
  107. data/lib/rails/graphql/subscription/provider/action_cable.rb +112 -0
  108. data/lib/rails/graphql/subscription/provider/base.rb +191 -0
  109. data/lib/rails/graphql/subscription/provider.rb +18 -0
  110. data/lib/rails/graphql/subscription/store/base.rb +145 -0
  111. data/lib/rails/graphql/subscription/store/memory.rb +127 -0
  112. data/lib/rails/graphql/subscription/store.rb +19 -0
  113. data/lib/rails/graphql/subscription.rb +17 -0
  114. data/lib/rails/graphql/to_gql.rb +29 -32
  115. data/lib/rails/graphql/type/enum/directive_location_enum.rb +11 -11
  116. data/lib/rails/graphql/type/enum/type_kind_enum.rb +3 -3
  117. data/lib/rails/graphql/type/enum.rb +34 -48
  118. data/lib/rails/graphql/type/input.rb +74 -23
  119. data/lib/rails/graphql/type/interface.rb +16 -26
  120. data/lib/rails/graphql/type/object/directive_object.rb +4 -4
  121. data/lib/rails/graphql/type/object/enum_value_object.rb +3 -3
  122. data/lib/rails/graphql/type/object/field_object.rb +24 -6
  123. data/lib/rails/graphql/type/object/input_value_object.rb +3 -3
  124. data/lib/rails/graphql/type/object/schema_object.rb +5 -8
  125. data/lib/rails/graphql/type/object/type_object.rb +29 -19
  126. data/lib/rails/graphql/type/object.rb +26 -23
  127. data/lib/rails/graphql/type/scalar/any_scalar.rb +30 -0
  128. data/lib/rails/graphql/type/scalar/bigint_scalar.rb +5 -5
  129. data/lib/rails/graphql/type/scalar/binary_scalar.rb +3 -3
  130. data/lib/rails/graphql/type/scalar/boolean_scalar.rb +8 -8
  131. data/lib/rails/graphql/type/scalar/date_scalar.rb +3 -3
  132. data/lib/rails/graphql/type/scalar/date_time_scalar.rb +3 -3
  133. data/lib/rails/graphql/type/scalar/decimal_scalar.rb +3 -3
  134. data/lib/rails/graphql/type/scalar/float_scalar.rb +5 -5
  135. data/lib/rails/graphql/type/scalar/id_scalar.rb +6 -5
  136. data/lib/rails/graphql/type/scalar/int_scalar.rb +6 -5
  137. data/lib/rails/graphql/type/scalar/json_scalar.rb +39 -0
  138. data/lib/rails/graphql/type/scalar/string_scalar.rb +18 -4
  139. data/lib/rails/graphql/type/scalar/time_scalar.rb +5 -5
  140. data/lib/rails/graphql/type/scalar.rb +25 -22
  141. data/lib/rails/graphql/type/union.rb +14 -16
  142. data/lib/rails/graphql/type.rb +34 -25
  143. data/lib/rails/graphql/type_map.rb +257 -165
  144. data/lib/rails/graphql/uri.rb +166 -0
  145. data/lib/rails/graphql/version.rb +15 -3
  146. data/lib/rails/graphql.rake +3 -0
  147. data/lib/rails/graphql.rb +85 -52
  148. data/lib/rails-graphql.rb +1 -1
  149. data/test/assets/en.yml +29 -0
  150. data/test/assets/introspection-mem.txt +1 -1
  151. data/test/assets/mem.gql +18 -45
  152. data/test/assets/mysql.gql +392 -0
  153. data/test/assets/sqlite.gql +21 -12
  154. data/test/assets/translate.gql +335 -0
  155. data/test/config.rb +18 -8
  156. data/test/graphql/schema_test.rb +12 -19
  157. data/test/graphql/source_test.rb +8 -75
  158. data/test/graphql/type/enum_test.rb +207 -203
  159. data/test/graphql/type/input_test.rb +14 -9
  160. data/test/graphql/type/interface_test.rb +4 -4
  161. data/test/graphql/type/scalar/any_scalar_test.rb +38 -0
  162. data/test/graphql/type/scalar/boolean_scalar_test.rb +6 -3
  163. data/test/graphql/type/scalar/json_scalar_test.rb +23 -0
  164. data/test/graphql/type_map_test.rb +51 -66
  165. data/test/graphql/type_test.rb +0 -19
  166. data/test/graphql_test.rb +1 -1
  167. data/test/integration/{authorization/authorization_test.rb → authorization_test.rb} +40 -14
  168. data/test/integration/config.rb +36 -3
  169. data/test/integration/customization_test.rb +39 -0
  170. data/test/integration/global_id_test.rb +99 -0
  171. data/test/integration/memory/star_wars_introspection_test.rb +24 -16
  172. data/test/integration/memory/star_wars_query_test.rb +54 -3
  173. data/test/integration/memory/star_wars_validation_test.rb +1 -1
  174. data/test/integration/mysql/star_wars_introspection_test.rb +25 -0
  175. data/test/integration/persisted_query_test.rb +87 -0
  176. data/test/integration/resolver_precedence_test.rb +154 -0
  177. data/test/integration/schemas/memory.rb +22 -7
  178. data/test/integration/schemas/mysql.rb +62 -0
  179. data/test/integration/schemas/sqlite.rb +21 -12
  180. data/test/integration/sqlite/star_wars_global_id_test.rb +83 -0
  181. data/test/integration/sqlite/star_wars_introspection_test.rb +10 -0
  182. data/test/integration/sqlite/star_wars_query_test.rb +14 -1
  183. data/test/integration/translate_test.rb +61 -0
  184. data/test/test_ext.rb +16 -13
  185. metadata +108 -157
  186. data/ext/depend +0 -3
  187. data/ext/graphqlparser/Ast.cpp +0 -346
  188. data/ext/graphqlparser/Ast.h +0 -1214
  189. data/ext/graphqlparser/AstNode.h +0 -36
  190. data/ext/graphqlparser/AstVisitor.h +0 -137
  191. data/ext/graphqlparser/GraphQLParser.cpp +0 -76
  192. data/ext/graphqlparser/GraphQLParser.h +0 -55
  193. data/ext/graphqlparser/JsonVisitor.cpp +0 -161
  194. data/ext/graphqlparser/JsonVisitor.cpp.inc +0 -456
  195. data/ext/graphqlparser/JsonVisitor.h +0 -121
  196. data/ext/graphqlparser/JsonVisitor.h.inc +0 -110
  197. data/ext/graphqlparser/VERSION +0 -1
  198. data/ext/graphqlparser/c/GraphQLAst.cpp +0 -324
  199. data/ext/graphqlparser/c/GraphQLAst.h +0 -180
  200. data/ext/graphqlparser/c/GraphQLAstForEachConcreteType.h +0 -44
  201. data/ext/graphqlparser/c/GraphQLAstNode.cpp +0 -25
  202. data/ext/graphqlparser/c/GraphQLAstNode.h +0 -33
  203. data/ext/graphqlparser/c/GraphQLAstToJSON.cpp +0 -21
  204. data/ext/graphqlparser/c/GraphQLAstToJSON.h +0 -24
  205. data/ext/graphqlparser/c/GraphQLAstVisitor.cpp +0 -55
  206. data/ext/graphqlparser/c/GraphQLAstVisitor.h +0 -53
  207. data/ext/graphqlparser/c/GraphQLParser.cpp +0 -35
  208. data/ext/graphqlparser/c/GraphQLParser.h +0 -54
  209. data/ext/graphqlparser/dump_json_ast.cpp +0 -48
  210. data/ext/graphqlparser/lexer.lpp +0 -324
  211. data/ext/graphqlparser/parser.ypp +0 -693
  212. data/ext/graphqlparser/parsergen/lexer.cpp +0 -2633
  213. data/ext/graphqlparser/parsergen/lexer.h +0 -528
  214. data/ext/graphqlparser/parsergen/location.hh +0 -189
  215. data/ext/graphqlparser/parsergen/parser.tab.cpp +0 -3300
  216. data/ext/graphqlparser/parsergen/parser.tab.hpp +0 -646
  217. data/ext/graphqlparser/parsergen/position.hh +0 -179
  218. data/ext/graphqlparser/parsergen/stack.hh +0 -156
  219. data/ext/graphqlparser/syntaxdefs.h +0 -19
  220. data/ext/libgraphqlparser/AstNode.h +0 -36
  221. data/ext/libgraphqlparser/CMakeLists.txt +0 -148
  222. data/ext/libgraphqlparser/CONTRIBUTING.md +0 -23
  223. data/ext/libgraphqlparser/GraphQLParser.cpp +0 -76
  224. data/ext/libgraphqlparser/GraphQLParser.h +0 -55
  225. data/ext/libgraphqlparser/JsonVisitor.cpp +0 -161
  226. data/ext/libgraphqlparser/JsonVisitor.h +0 -121
  227. data/ext/libgraphqlparser/LICENSE +0 -22
  228. data/ext/libgraphqlparser/README.clang-tidy +0 -7
  229. data/ext/libgraphqlparser/README.md +0 -84
  230. data/ext/libgraphqlparser/ast/ast.ast +0 -203
  231. data/ext/libgraphqlparser/ast/ast.py +0 -61
  232. data/ext/libgraphqlparser/ast/c.py +0 -100
  233. data/ext/libgraphqlparser/ast/c.pyc +0 -0
  234. data/ext/libgraphqlparser/ast/c_impl.py +0 -61
  235. data/ext/libgraphqlparser/ast/c_impl.pyc +0 -0
  236. data/ext/libgraphqlparser/ast/c_visitor_impl.py +0 -39
  237. data/ext/libgraphqlparser/ast/c_visitor_impl.pyc +0 -0
  238. data/ext/libgraphqlparser/ast/casing.py +0 -26
  239. data/ext/libgraphqlparser/ast/casing.pyc +0 -0
  240. data/ext/libgraphqlparser/ast/cxx.py +0 -197
  241. data/ext/libgraphqlparser/ast/cxx.pyc +0 -0
  242. data/ext/libgraphqlparser/ast/cxx_impl.py +0 -61
  243. data/ext/libgraphqlparser/ast/cxx_impl.pyc +0 -0
  244. data/ext/libgraphqlparser/ast/cxx_json_visitor_header.py +0 -42
  245. data/ext/libgraphqlparser/ast/cxx_json_visitor_header.pyc +0 -0
  246. data/ext/libgraphqlparser/ast/cxx_json_visitor_impl.py +0 -80
  247. data/ext/libgraphqlparser/ast/cxx_json_visitor_impl.pyc +0 -0
  248. data/ext/libgraphqlparser/ast/cxx_visitor.py +0 -64
  249. data/ext/libgraphqlparser/ast/cxx_visitor.pyc +0 -0
  250. data/ext/libgraphqlparser/ast/js.py +0 -65
  251. data/ext/libgraphqlparser/ast/license.py +0 -10
  252. data/ext/libgraphqlparser/ast/license.pyc +0 -0
  253. data/ext/libgraphqlparser/c/GraphQLAstNode.cpp +0 -25
  254. data/ext/libgraphqlparser/c/GraphQLAstNode.h +0 -33
  255. data/ext/libgraphqlparser/c/GraphQLAstToJSON.cpp +0 -21
  256. data/ext/libgraphqlparser/c/GraphQLAstToJSON.h +0 -24
  257. data/ext/libgraphqlparser/c/GraphQLAstVisitor.cpp +0 -55
  258. data/ext/libgraphqlparser/c/GraphQLAstVisitor.h +0 -53
  259. data/ext/libgraphqlparser/c/GraphQLParser.cpp +0 -35
  260. data/ext/libgraphqlparser/c/GraphQLParser.h +0 -54
  261. data/ext/libgraphqlparser/clang-tidy-all.sh +0 -3
  262. data/ext/libgraphqlparser/cmake/version.cmake +0 -16
  263. data/ext/libgraphqlparser/dump_json_ast.cpp +0 -48
  264. data/ext/libgraphqlparser/go/README.md +0 -20
  265. data/ext/libgraphqlparser/go/callbacks.go +0 -18
  266. data/ext/libgraphqlparser/go/gotest.go +0 -64
  267. data/ext/libgraphqlparser/lexer.lpp +0 -324
  268. data/ext/libgraphqlparser/libgraphqlparser.pc.in +0 -11
  269. data/ext/libgraphqlparser/parser.ypp +0 -693
  270. data/ext/libgraphqlparser/parsergen/lexer.cpp +0 -2633
  271. data/ext/libgraphqlparser/parsergen/lexer.h +0 -528
  272. data/ext/libgraphqlparser/parsergen/location.hh +0 -189
  273. data/ext/libgraphqlparser/parsergen/parser.tab.cpp +0 -3300
  274. data/ext/libgraphqlparser/parsergen/parser.tab.hpp +0 -646
  275. data/ext/libgraphqlparser/parsergen/position.hh +0 -179
  276. data/ext/libgraphqlparser/parsergen/stack.hh +0 -156
  277. data/ext/libgraphqlparser/python/CMakeLists.txt +0 -14
  278. data/ext/libgraphqlparser/python/README.md +0 -5
  279. data/ext/libgraphqlparser/python/example.py +0 -31
  280. data/ext/libgraphqlparser/syntaxdefs.h +0 -19
  281. data/ext/libgraphqlparser/test/BuildCAPI.c +0 -5
  282. data/ext/libgraphqlparser/test/CMakeLists.txt +0 -25
  283. data/ext/libgraphqlparser/test/JsonVisitorTests.cpp +0 -28
  284. data/ext/libgraphqlparser/test/ParserTests.cpp +0 -352
  285. data/ext/libgraphqlparser/test/kitchen-sink.graphql +0 -59
  286. data/ext/libgraphqlparser/test/kitchen-sink.json +0 -1
  287. data/ext/libgraphqlparser/test/schema-kitchen-sink.graphql +0 -78
  288. data/ext/libgraphqlparser/test/schema-kitchen-sink.json +0 -1
  289. data/ext/libgraphqlparser/test/valgrind.supp +0 -33
  290. data/ext/version.cpp +0 -21
  291. data/lib/graphqlparser.so +0 -0
  292. data/lib/rails/graphql/native/functions.rb +0 -38
  293. data/lib/rails/graphql/native/location.rb +0 -41
  294. data/lib/rails/graphql/native/pointers.rb +0 -23
  295. data/lib/rails/graphql/native/visitor.rb +0 -349
  296. data/lib/rails/graphql/native.rb +0 -56
  297. data/test/integration/schemas/authorization.rb +0 -12
@@ -0,0 +1,166 @@
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
+
46
+ xargs = { namespace: namespace, scope: scope, params: params }
47
+ xargs[:name] = object.gql_name unless klass == Rails::GraphQL::Schema
48
+ xargs[:class_name] =
49
+ case
50
+ when klass <= Rails::GraphQL::Schema then 'Schema'
51
+ when klass.superclass == Rails::GraphQL::Type then 'Type'
52
+ else
53
+ klass_name = klass.is_a?(Module) ? klass.name : klass.class.name
54
+ klass_name.split('GraphQL::').last
55
+ end
56
+
57
+ build(xargs)
58
+ end
59
+
60
+ # Create a new URI::GQL from components with argument check.
61
+ #
62
+ # Using a hash:
63
+ #
64
+ # URI::GQL.build(app: 'bcx', model_name: 'Person', model_id: '1', params: { key: 'value' })
65
+ #
66
+ # Using an array, the arguments must be in order [app, model_name, model_id, params]:
67
+ #
68
+ # URI::GQL.build(['bcx', 'Person', '1', key: 'value'])
69
+ def build(args)
70
+ parts = Util.make_components_hash(self, args)
71
+ parts[:host] = parts[:namespace].to_s.tr('_', '-')
72
+ parts[:path] = [parts[:class_name], parts[:scope], parts[:name]].compact.join('/')
73
+ parts[:path].prepend('/')
74
+
75
+ parts[:query] = parts[:params].to_param unless parts[:params].nil?
76
+
77
+ super parts
78
+ end
79
+ end
80
+
81
+ # Make sure to convert dashes into underscore
82
+ def namespace
83
+ host.tr('-', '_')
84
+ end
85
+
86
+ # Check if the object should be instantiated
87
+ def instantiate?
88
+ !query.nil?
89
+ end
90
+
91
+ # Implement #to_s to avoid no implicit conversion of nil into string when path is nil
92
+ def to_s
93
+ +"gql://#{host}#{path}#{'?' + query if query}"
94
+ end
95
+
96
+ protected
97
+
98
+ def set_path(path)
99
+ set_components(path) unless defined?(@class_name) && @name
100
+ super
101
+ end
102
+
103
+ def query=(query)
104
+ set_params parse_query_params(query)
105
+ super
106
+ end
107
+
108
+ def set_params(params)
109
+ @params = params
110
+ end
111
+
112
+ private
113
+
114
+ def check_host(host)
115
+ validate_component(host)
116
+ super
117
+ end
118
+
119
+ def check_path(path)
120
+ validate_component(path)
121
+ set_components(path, true)
122
+ end
123
+
124
+ def check_scheme(scheme)
125
+ return super if scheme == 'gql'
126
+ raise URI::BadURIError, +"Not a gql:// URI scheme: #{inspect}"
127
+ end
128
+
129
+ def set_components(path, validate = false)
130
+ parts = path.split('/').slice(1, 3)
131
+ class_name = parts.shift
132
+ name = parts.pop
133
+
134
+ validate_component(class_name) && validate_object_name(name, class_name) if validate
135
+
136
+ @class_name = class_name
137
+ @scope = parts.shift
138
+ @name = name
139
+ end
140
+
141
+ def parse_query_params(query)
142
+ return if query.nil?
143
+ return {} if query.empty?
144
+ Rack::Utils.parse_nested_query(query)
145
+ end
146
+
147
+ def validate_component(component)
148
+ raise URI::InvalidComponentError, (+<<~MSG).squish if component.blank?
149
+ Expected a URI like gql://base/Directive/deprecated: #{inspect}.
150
+ MSG
151
+ end
152
+
153
+ def validate_object_name(name, class_name)
154
+ raise URI::InvalidComponentError, (+<<~MSG).squish if name.blank?
155
+ Unable to create a GraphQL ID for #{class_name} without an object name.
156
+ MSG
157
+ end
158
+
159
+ end
160
+
161
+ if respond_to?(:register_scheme)
162
+ register_scheme('GQL', GQL)
163
+ else
164
+ @@schemes['GQL'] = GQL
165
+ end
166
+ end
@@ -1,7 +1,19 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Rails # :nodoc:
4
- module GraphQL # :nodoc:
5
- VERSION = '0.2.0'
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::STRING
8
+ end
9
+
10
+ module VERSION
11
+ MAJOR = 1
12
+ MINOR = 0
13
+ TINY = 0
14
+ PRE = 'beta'
15
+
16
+ STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
17
+ end
6
18
  end
7
19
  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,14 @@ 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'
15
17
  end
16
18
 
17
- module Rails # :nodoc:
19
+ module Rails
18
20
  # = Rails GraphQL
19
21
  #
20
22
  # This implementation tries to be as close as the GraphQL spec as possible,
@@ -40,45 +42,56 @@ module Rails # :nodoc:
40
42
  # * <tt>Fields:</tt> Many other types and helper containers holds a serie of
41
43
  # fields, which means that fields with the same name will probably behave
42
44
  # 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
45
  module GraphQL
47
46
  extend ActiveSupport::Autoload
48
47
 
49
48
  include ActiveSupport::Configurable
50
49
 
51
50
  # Stores the version of the GraphQL spec used for this implementation
52
- SPEC_VERSION = 'June 2018'
51
+ SPEC_VERSION = ::GQLParser::VERSION
52
+
53
+ # Just a reusable instances of an empty array and empty hash
54
+ EMPTY_ARRAY = [].freeze
55
+ EMPTY_HASH = {}.freeze
53
56
 
54
57
  # Runtime registry for request execution time
55
58
  RuntimeRegistry = Class.new { thread_mattr_accessor :gql_runtime }
56
59
 
60
+ # Helper class to produce a ActiveSupport-compatible versioned cache key
61
+ CacheKey = Struct.new(:cache_key, :cache_version) do
62
+ def inspect
63
+ cache_version ? +"#{cache_key}[#{cache_version}]" : cache_key
64
+ end
65
+ end
66
+
57
67
  autoload :ToGQL
68
+ autoload :Event
69
+ autoload :Source
58
70
  autoload :Helpers
71
+ autoload :Callback
72
+ autoload :GlobalID
59
73
  autoload :Collectors
74
+ autoload :Alternative
75
+ autoload :Subscription
76
+
77
+ autoload :Argument
78
+ autoload :Directive
79
+ autoload :Field
80
+ autoload :Introspection
81
+ autoload :Schema
82
+ autoload :Type
83
+
84
+ autoload_under :railties do
85
+ autoload :BaseGenerator
86
+ autoload :Channel
87
+ autoload :Controller
88
+ autoload :ControllerRuntime
89
+ autoload :LogSubscriber
90
+ end
60
91
 
61
92
  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
93
  autoload :TypeMap
75
-
76
- autoload :Argument
77
- autoload :Directive
78
- autoload :Field
79
- autoload :Introspection
80
- autoload :Schema
81
- autoload :Type
94
+ autoload :Request
82
95
  end
83
96
 
84
97
  class << self
@@ -89,7 +102,7 @@ module Rails # :nodoc:
89
102
 
90
103
  # Find the key associated with the given +adapter_name+
91
104
  def ar_adapter_key(adapter_name)
92
- config.ar_adapters[adapter_name]
105
+ config.ar_adapters.dig(adapter_name, :key)
93
106
  end
94
107
 
95
108
  # This is a little helper to require ActiveRecord adapter specific
@@ -97,13 +110,11 @@ module Rails # :nodoc:
97
110
  def enable_ar_adapter(adapter_name)
98
111
  return if (@@loaded_adapters ||= Set.new).include?(adapter_name)
99
112
 
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")
113
+ raise ::ArgumentError, (+<<~MSG).squish unless config.ar_adapters.key?(adapter_name)
114
+ There is no GraphQL mapping for #{adapter_name} ActiveRecord adapter.
115
+ MSG
106
116
 
117
+ require(config.ar_adapters.dig(adapter_name, :path))
107
118
  @@loaded_adapters << adapter_name
108
119
  end
109
120
 
@@ -122,6 +133,30 @@ module Rails # :nodoc:
122
133
 
123
134
  alias to_graphql to_gql
124
135
 
136
+ # A generic helper to not create a new array when just iterating over
137
+ # something that may or may not be an array
138
+ def enumerate(value)
139
+ (value.is_a?(Enumerable) || value.respond_to?(:to_ary)) ? value : value.then
140
+ end
141
+
142
+ # Load a given +list+ of dependencies from the given +type+
143
+ def add_dependencies(type, *list, to: :base)
144
+ ref = config.known_dependencies
145
+
146
+ raise ArgumentError, (+<<~MSG).squish if (ref = ref[type]).nil?
147
+ There are no #{type} known dependencies.
148
+ MSG
149
+
150
+ list = list.flatten.compact.map do |item|
151
+ next item unless (item = ref[item]).nil?
152
+ raise ArgumentError, (+<<~MSG).squish
153
+ Unable to find #{item} as #{type} in known dependencies.
154
+ MSG
155
+ end
156
+
157
+ type_map.add_dependencies(list, to: to)
158
+ end
159
+
125
160
  # Returns a set instance with uniq directives from the given list.
126
161
  # If the same directive class is given twice, it will raise an exception,
127
162
  # since they must be uniq within a list of directives.
@@ -131,48 +166,44 @@ module Rails # :nodoc:
131
166
  #
132
167
  # If a +source+ is provided, then an +:attach+ event will be triggered
133
168
  # for each directive on the givem source element.
134
- def directives_to_set(list, others = [], event = nil, **xargs)
135
- others = others.dup
169
+ def directives_to_set(list, others = nil, event = nil, **xargs)
170
+ return if list.blank?
136
171
 
137
172
  if (source = xargs.delete(:source)).present?
138
173
  location = xargs.delete(:location) || source.try(:directive_location)
139
174
  event ||= GraphQL::Event.new(:attach, source, phase: :definition, **xargs)
140
175
  end
141
176
 
142
- Array.wrap(list).each_with_object(Set.new) do |item, result|
143
- raise ArgumentError, <<~MSG.squish unless item.kind_of?(GraphQL::Directive)
177
+ others = others&.to_set
178
+ enumerate(list).each_with_object(Set.new) do |item, result|
179
+ raise ArgumentError, (+<<~MSG).squish unless item.kind_of?(GraphQL::Directive)
144
180
  The "#{item.class}" is not a valid directive.
145
181
  MSG
146
182
 
147
- invalid = others.present? && (others.any? { |k| k.class.eql?(item.class) })
148
- raise DuplicatedError, <<~MSG.squish if invalid
183
+ raise DuplicatedError, (+<<~MSG).squish if others&.any?(item) || result.any?(item)
149
184
  A @#{item.gql_name} directive have already been provided.
150
185
  MSG
151
186
 
152
187
  invalid_location = location.present? && !item.locations.include?(location)
153
- raise ArgumentError, <<~MSG.squish if invalid_location
188
+ raise ArgumentError, (+<<~MSG).squish if invalid_location
154
189
  You cannot use @#{item.gql_name} directive due to location restriction.
155
190
  MSG
156
191
 
157
192
  unless event.nil?
158
- item.assing_owner!(event.source)
159
- event.trigger_object(item)
193
+ begin
194
+ item.assign_owner!(event.source)
195
+ event.trigger_object(item)
196
+ item.validate!
197
+ rescue => error
198
+ raise StandardError, (+<<~MSG).squish
199
+ Unable to #{event.name} the @#{item.gql_name} directive: #{error.message}
200
+ MSG
201
+ end
160
202
  end
161
203
 
162
- others << item
163
204
  result << item
164
205
  end
165
206
  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
207
  end
177
208
  end
178
209
  end
@@ -181,3 +212,5 @@ require 'rails/graphql/config'
181
212
  require 'rails/graphql/errors'
182
213
  require 'rails/graphql/shortcuts'
183
214
  require 'rails/graphql/railtie'
215
+
216
+ 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":"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":"Droid","ofType":null},{"kind":"OBJECT","name":"Human","ofType":null}]},{"kind":"OBJECT","name":"Human","description":"A humanoid creature in the Star Wars universe","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":"name","description":"The name of the human","args":[],"type":{"kind":"SCALAR","name":"String","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":"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":"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},{"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":"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}],"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 droid","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 droid","args":[],"type":{"kind":"SCALAR","name":"String","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":"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":"Construction date and the name of the designer","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":"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":"SCALAR","name":"Boolean","description":"The Boolean scalar type represents true or false.","fields":[],"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":"Float","description":"The Float scalar type represents signed double-precision fractional values.","fields":[],"inputFields":[],"interfaces":[],"enumValues":[],"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":"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":"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":"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":"__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":"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":[]}],"directives":[{"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}]},{"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}]}]}}}