rails-graphql 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (266) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.rdoc +19 -0
  4. data/Rakefile +31 -0
  5. data/ext/depend +3 -0
  6. data/ext/extconf.rb +57 -0
  7. data/ext/graphqlparser/Ast.cpp +346 -0
  8. data/ext/graphqlparser/Ast.h +1214 -0
  9. data/ext/graphqlparser/AstNode.h +36 -0
  10. data/ext/graphqlparser/AstVisitor.h +137 -0
  11. data/ext/graphqlparser/GraphQLParser.cpp +76 -0
  12. data/ext/graphqlparser/GraphQLParser.h +55 -0
  13. data/ext/graphqlparser/JsonVisitor.cpp +161 -0
  14. data/ext/graphqlparser/JsonVisitor.cpp.inc +456 -0
  15. data/ext/graphqlparser/JsonVisitor.h +121 -0
  16. data/ext/graphqlparser/JsonVisitor.h.inc +110 -0
  17. data/ext/graphqlparser/VERSION +1 -0
  18. data/ext/graphqlparser/c/GraphQLAst.cpp +324 -0
  19. data/ext/graphqlparser/c/GraphQLAst.h +180 -0
  20. data/ext/graphqlparser/c/GraphQLAstForEachConcreteType.h +44 -0
  21. data/ext/graphqlparser/c/GraphQLAstNode.cpp +25 -0
  22. data/ext/graphqlparser/c/GraphQLAstNode.h +33 -0
  23. data/ext/graphqlparser/c/GraphQLAstToJSON.cpp +21 -0
  24. data/ext/graphqlparser/c/GraphQLAstToJSON.h +24 -0
  25. data/ext/graphqlparser/c/GraphQLAstVisitor.cpp +55 -0
  26. data/ext/graphqlparser/c/GraphQLAstVisitor.h +53 -0
  27. data/ext/graphqlparser/c/GraphQLParser.cpp +35 -0
  28. data/ext/graphqlparser/c/GraphQLParser.h +54 -0
  29. data/ext/graphqlparser/dump_json_ast.cpp +48 -0
  30. data/ext/graphqlparser/lexer.lpp +324 -0
  31. data/ext/graphqlparser/parser.ypp +693 -0
  32. data/ext/graphqlparser/parsergen/lexer.cpp +2633 -0
  33. data/ext/graphqlparser/parsergen/lexer.h +528 -0
  34. data/ext/graphqlparser/parsergen/location.hh +189 -0
  35. data/ext/graphqlparser/parsergen/parser.tab.cpp +3300 -0
  36. data/ext/graphqlparser/parsergen/parser.tab.hpp +646 -0
  37. data/ext/graphqlparser/parsergen/position.hh +179 -0
  38. data/ext/graphqlparser/parsergen/stack.hh +156 -0
  39. data/ext/graphqlparser/syntaxdefs.h +19 -0
  40. data/ext/libgraphqlparser/AstNode.h +36 -0
  41. data/ext/libgraphqlparser/CMakeLists.txt +148 -0
  42. data/ext/libgraphqlparser/CONTRIBUTING.md +23 -0
  43. data/ext/libgraphqlparser/GraphQLParser.cpp +76 -0
  44. data/ext/libgraphqlparser/GraphQLParser.h +55 -0
  45. data/ext/libgraphqlparser/JsonVisitor.cpp +161 -0
  46. data/ext/libgraphqlparser/JsonVisitor.h +121 -0
  47. data/ext/libgraphqlparser/LICENSE +22 -0
  48. data/ext/libgraphqlparser/README.clang-tidy +7 -0
  49. data/ext/libgraphqlparser/README.md +84 -0
  50. data/ext/libgraphqlparser/ast/ast.ast +203 -0
  51. data/ext/libgraphqlparser/ast/ast.py +61 -0
  52. data/ext/libgraphqlparser/ast/c.py +100 -0
  53. data/ext/libgraphqlparser/ast/c.pyc +0 -0
  54. data/ext/libgraphqlparser/ast/c_impl.py +61 -0
  55. data/ext/libgraphqlparser/ast/c_impl.pyc +0 -0
  56. data/ext/libgraphqlparser/ast/c_visitor_impl.py +39 -0
  57. data/ext/libgraphqlparser/ast/c_visitor_impl.pyc +0 -0
  58. data/ext/libgraphqlparser/ast/casing.py +26 -0
  59. data/ext/libgraphqlparser/ast/casing.pyc +0 -0
  60. data/ext/libgraphqlparser/ast/cxx.py +197 -0
  61. data/ext/libgraphqlparser/ast/cxx.pyc +0 -0
  62. data/ext/libgraphqlparser/ast/cxx_impl.py +61 -0
  63. data/ext/libgraphqlparser/ast/cxx_impl.pyc +0 -0
  64. data/ext/libgraphqlparser/ast/cxx_json_visitor_header.py +42 -0
  65. data/ext/libgraphqlparser/ast/cxx_json_visitor_header.pyc +0 -0
  66. data/ext/libgraphqlparser/ast/cxx_json_visitor_impl.py +80 -0
  67. data/ext/libgraphqlparser/ast/cxx_json_visitor_impl.pyc +0 -0
  68. data/ext/libgraphqlparser/ast/cxx_visitor.py +64 -0
  69. data/ext/libgraphqlparser/ast/cxx_visitor.pyc +0 -0
  70. data/ext/libgraphqlparser/ast/js.py +65 -0
  71. data/ext/libgraphqlparser/ast/license.py +10 -0
  72. data/ext/libgraphqlparser/ast/license.pyc +0 -0
  73. data/ext/libgraphqlparser/c/GraphQLAstNode.cpp +25 -0
  74. data/ext/libgraphqlparser/c/GraphQLAstNode.h +33 -0
  75. data/ext/libgraphqlparser/c/GraphQLAstToJSON.cpp +21 -0
  76. data/ext/libgraphqlparser/c/GraphQLAstToJSON.h +24 -0
  77. data/ext/libgraphqlparser/c/GraphQLAstVisitor.cpp +55 -0
  78. data/ext/libgraphqlparser/c/GraphQLAstVisitor.h +53 -0
  79. data/ext/libgraphqlparser/c/GraphQLParser.cpp +35 -0
  80. data/ext/libgraphqlparser/c/GraphQLParser.h +54 -0
  81. data/ext/libgraphqlparser/clang-tidy-all.sh +3 -0
  82. data/ext/libgraphqlparser/cmake/version.cmake +16 -0
  83. data/ext/libgraphqlparser/dump_json_ast.cpp +48 -0
  84. data/ext/libgraphqlparser/go/README.md +20 -0
  85. data/ext/libgraphqlparser/go/callbacks.go +18 -0
  86. data/ext/libgraphqlparser/go/gotest.go +64 -0
  87. data/ext/libgraphqlparser/lexer.lpp +324 -0
  88. data/ext/libgraphqlparser/libgraphqlparser.pc.in +11 -0
  89. data/ext/libgraphqlparser/parser.ypp +693 -0
  90. data/ext/libgraphqlparser/parsergen/lexer.cpp +2633 -0
  91. data/ext/libgraphqlparser/parsergen/lexer.h +528 -0
  92. data/ext/libgraphqlparser/parsergen/location.hh +189 -0
  93. data/ext/libgraphqlparser/parsergen/parser.tab.cpp +3300 -0
  94. data/ext/libgraphqlparser/parsergen/parser.tab.hpp +646 -0
  95. data/ext/libgraphqlparser/parsergen/position.hh +179 -0
  96. data/ext/libgraphqlparser/parsergen/stack.hh +156 -0
  97. data/ext/libgraphqlparser/python/CMakeLists.txt +14 -0
  98. data/ext/libgraphqlparser/python/README.md +5 -0
  99. data/ext/libgraphqlparser/python/example.py +31 -0
  100. data/ext/libgraphqlparser/syntaxdefs.h +19 -0
  101. data/ext/libgraphqlparser/test/BuildCAPI.c +5 -0
  102. data/ext/libgraphqlparser/test/CMakeLists.txt +25 -0
  103. data/ext/libgraphqlparser/test/JsonVisitorTests.cpp +28 -0
  104. data/ext/libgraphqlparser/test/ParserTests.cpp +352 -0
  105. data/ext/libgraphqlparser/test/kitchen-sink.graphql +59 -0
  106. data/ext/libgraphqlparser/test/kitchen-sink.json +1 -0
  107. data/ext/libgraphqlparser/test/schema-kitchen-sink.graphql +78 -0
  108. data/ext/libgraphqlparser/test/schema-kitchen-sink.json +1 -0
  109. data/ext/libgraphqlparser/test/valgrind.supp +33 -0
  110. data/ext/version.cpp +21 -0
  111. data/lib/generators/graphql/controller_generator.rb +22 -0
  112. data/lib/generators/graphql/schema_generator.rb +22 -0
  113. data/lib/generators/graphql/templates/controller.erb +5 -0
  114. data/lib/generators/graphql/templates/schema.erb +6 -0
  115. data/lib/graphqlparser.so +0 -0
  116. data/lib/rails-graphql.rb +2 -0
  117. data/lib/rails/graphql.rake +1 -0
  118. data/lib/rails/graphql.rb +185 -0
  119. data/lib/rails/graphql/adapters/mysql_adapter.rb +0 -0
  120. data/lib/rails/graphql/adapters/pg_adapter.rb +50 -0
  121. data/lib/rails/graphql/adapters/sqlite_adapter.rb +39 -0
  122. data/lib/rails/graphql/argument.rb +220 -0
  123. data/lib/rails/graphql/callback.rb +124 -0
  124. data/lib/rails/graphql/collectors.rb +14 -0
  125. data/lib/rails/graphql/collectors/hash_collector.rb +83 -0
  126. data/lib/rails/graphql/collectors/idented_collector.rb +73 -0
  127. data/lib/rails/graphql/collectors/json_collector.rb +114 -0
  128. data/lib/rails/graphql/config.rb +61 -0
  129. data/lib/rails/graphql/directive.rb +203 -0
  130. data/lib/rails/graphql/directive/deprecated_directive.rb +59 -0
  131. data/lib/rails/graphql/directive/include_directive.rb +24 -0
  132. data/lib/rails/graphql/directive/skip_directive.rb +24 -0
  133. data/lib/rails/graphql/errors.rb +42 -0
  134. data/lib/rails/graphql/event.rb +141 -0
  135. data/lib/rails/graphql/field.rb +318 -0
  136. data/lib/rails/graphql/field/input_field.rb +92 -0
  137. data/lib/rails/graphql/field/mutation_field.rb +52 -0
  138. data/lib/rails/graphql/field/output_field.rb +96 -0
  139. data/lib/rails/graphql/field/proxied_field.rb +131 -0
  140. data/lib/rails/graphql/field/resolved_field.rb +96 -0
  141. data/lib/rails/graphql/field/scoped_config.rb +22 -0
  142. data/lib/rails/graphql/field/typed_field.rb +104 -0
  143. data/lib/rails/graphql/helpers.rb +40 -0
  144. data/lib/rails/graphql/helpers/attribute_delegator.rb +39 -0
  145. data/lib/rails/graphql/helpers/inherited_collection.rb +152 -0
  146. data/lib/rails/graphql/helpers/leaf_from_ar.rb +141 -0
  147. data/lib/rails/graphql/helpers/registerable.rb +103 -0
  148. data/lib/rails/graphql/helpers/with_arguments.rb +125 -0
  149. data/lib/rails/graphql/helpers/with_assignment.rb +113 -0
  150. data/lib/rails/graphql/helpers/with_callbacks.rb +55 -0
  151. data/lib/rails/graphql/helpers/with_directives.rb +126 -0
  152. data/lib/rails/graphql/helpers/with_events.rb +81 -0
  153. data/lib/rails/graphql/helpers/with_fields.rb +141 -0
  154. data/lib/rails/graphql/helpers/with_namespace.rb +40 -0
  155. data/lib/rails/graphql/helpers/with_owner.rb +35 -0
  156. data/lib/rails/graphql/helpers/with_schema_fields.rb +230 -0
  157. data/lib/rails/graphql/helpers/with_validator.rb +52 -0
  158. data/lib/rails/graphql/introspection.rb +53 -0
  159. data/lib/rails/graphql/native.rb +56 -0
  160. data/lib/rails/graphql/native/functions.rb +38 -0
  161. data/lib/rails/graphql/native/location.rb +41 -0
  162. data/lib/rails/graphql/native/pointers.rb +23 -0
  163. data/lib/rails/graphql/native/visitor.rb +349 -0
  164. data/lib/rails/graphql/railtie.rb +85 -0
  165. data/lib/rails/graphql/railties/base_generator.rb +35 -0
  166. data/lib/rails/graphql/railties/controller.rb +101 -0
  167. data/lib/rails/graphql/railties/controller_runtime.rb +40 -0
  168. data/lib/rails/graphql/railties/log_subscriber.rb +62 -0
  169. data/lib/rails/graphql/request.rb +343 -0
  170. data/lib/rails/graphql/request/arguments.rb +93 -0
  171. data/lib/rails/graphql/request/component.rb +100 -0
  172. data/lib/rails/graphql/request/component/field.rb +225 -0
  173. data/lib/rails/graphql/request/component/fragment.rb +118 -0
  174. data/lib/rails/graphql/request/component/operation.rb +178 -0
  175. data/lib/rails/graphql/request/component/operation/subscription.rb +16 -0
  176. data/lib/rails/graphql/request/component/spread.rb +119 -0
  177. data/lib/rails/graphql/request/component/typename.rb +82 -0
  178. data/lib/rails/graphql/request/context.rb +51 -0
  179. data/lib/rails/graphql/request/errors.rb +54 -0
  180. data/lib/rails/graphql/request/event.rb +112 -0
  181. data/lib/rails/graphql/request/helpers/directives.rb +64 -0
  182. data/lib/rails/graphql/request/helpers/selection_set.rb +87 -0
  183. data/lib/rails/graphql/request/helpers/value_writers.rb +115 -0
  184. data/lib/rails/graphql/request/steps/organizable.rb +146 -0
  185. data/lib/rails/graphql/request/steps/prepareable.rb +33 -0
  186. data/lib/rails/graphql/request/steps/resolveable.rb +32 -0
  187. data/lib/rails/graphql/request/strategy.rb +249 -0
  188. data/lib/rails/graphql/request/strategy/dynamic_instance.rb +41 -0
  189. data/lib/rails/graphql/request/strategy/multi_query_strategy.rb +36 -0
  190. data/lib/rails/graphql/request/strategy/sequenced_strategy.rb +28 -0
  191. data/lib/rails/graphql/schema.rb +272 -0
  192. data/lib/rails/graphql/shortcuts.rb +77 -0
  193. data/lib/rails/graphql/source.rb +371 -0
  194. data/lib/rails/graphql/source/active_record/builders.rb +154 -0
  195. data/lib/rails/graphql/source/active_record_source.rb +231 -0
  196. data/lib/rails/graphql/source/scoped_arguments.rb +87 -0
  197. data/lib/rails/graphql/to_gql.rb +368 -0
  198. data/lib/rails/graphql/type.rb +138 -0
  199. data/lib/rails/graphql/type/enum.rb +206 -0
  200. data/lib/rails/graphql/type/enum/directive_location_enum.rb +30 -0
  201. data/lib/rails/graphql/type/enum/type_kind_enum.rb +57 -0
  202. data/lib/rails/graphql/type/input.rb +134 -0
  203. data/lib/rails/graphql/type/interface.rb +82 -0
  204. data/lib/rails/graphql/type/object.rb +111 -0
  205. data/lib/rails/graphql/type/object/directive_object.rb +34 -0
  206. data/lib/rails/graphql/type/object/enum_value_object.rb +25 -0
  207. data/lib/rails/graphql/type/object/field_object.rb +54 -0
  208. data/lib/rails/graphql/type/object/input_value_object.rb +49 -0
  209. data/lib/rails/graphql/type/object/schema_object.rb +40 -0
  210. data/lib/rails/graphql/type/object/type_object.rb +136 -0
  211. data/lib/rails/graphql/type/scalar.rb +71 -0
  212. data/lib/rails/graphql/type/scalar/bigint_scalar.rb +34 -0
  213. data/lib/rails/graphql/type/scalar/binary_scalar.rb +30 -0
  214. data/lib/rails/graphql/type/scalar/boolean_scalar.rb +37 -0
  215. data/lib/rails/graphql/type/scalar/date_scalar.rb +34 -0
  216. data/lib/rails/graphql/type/scalar/date_time_scalar.rb +32 -0
  217. data/lib/rails/graphql/type/scalar/decimal_scalar.rb +35 -0
  218. data/lib/rails/graphql/type/scalar/float_scalar.rb +32 -0
  219. data/lib/rails/graphql/type/scalar/id_scalar.rb +39 -0
  220. data/lib/rails/graphql/type/scalar/int_scalar.rb +36 -0
  221. data/lib/rails/graphql/type/scalar/string_scalar.rb +28 -0
  222. data/lib/rails/graphql/type/scalar/time_scalar.rb +40 -0
  223. data/lib/rails/graphql/type/union.rb +87 -0
  224. data/lib/rails/graphql/type_map.rb +347 -0
  225. data/lib/rails/graphql/version.rb +7 -0
  226. data/test/assets/introspection-db.json +0 -0
  227. data/test/assets/introspection-mem.txt +1 -0
  228. data/test/assets/introspection.gql +91 -0
  229. data/test/assets/luke.jpg +0 -0
  230. data/test/assets/mem.gql +428 -0
  231. data/test/assets/sqlite.gql +423 -0
  232. data/test/config.rb +80 -0
  233. data/test/graphql/request/context_test.rb +70 -0
  234. data/test/graphql/schema_test.rb +190 -0
  235. data/test/graphql/source_test.rb +237 -0
  236. data/test/graphql/type/enum_test.rb +203 -0
  237. data/test/graphql/type/input_test.rb +138 -0
  238. data/test/graphql/type/interface_test.rb +72 -0
  239. data/test/graphql/type/object_test.rb +104 -0
  240. data/test/graphql/type/scalar/bigint_scalar_test.rb +42 -0
  241. data/test/graphql/type/scalar/binary_scalar_test.rb +17 -0
  242. data/test/graphql/type/scalar/boolean_scalar_test.rb +40 -0
  243. data/test/graphql/type/scalar/date_scalar_test.rb +29 -0
  244. data/test/graphql/type/scalar/date_time_scalar_test.rb +29 -0
  245. data/test/graphql/type/scalar/decimal_scalar_test.rb +28 -0
  246. data/test/graphql/type/scalar/float_scalar_test.rb +22 -0
  247. data/test/graphql/type/scalar/id_scalar_test.rb +26 -0
  248. data/test/graphql/type/scalar/int_scalar_test.rb +26 -0
  249. data/test/graphql/type/scalar/string_scalar_test.rb +17 -0
  250. data/test/graphql/type/scalar/time_scalar_test.rb +36 -0
  251. data/test/graphql/type/scalar_test.rb +45 -0
  252. data/test/graphql/type/union_test.rb +82 -0
  253. data/test/graphql/type_map_test.rb +362 -0
  254. data/test/graphql/type_test.rb +68 -0
  255. data/test/graphql_test.rb +55 -0
  256. data/test/integration/config.rb +56 -0
  257. data/test/integration/memory/star_wars_introspection_test.rb +144 -0
  258. data/test/integration/memory/star_wars_query_test.rb +184 -0
  259. data/test/integration/memory/star_wars_validation_test.rb +99 -0
  260. data/test/integration/schemas/memory.rb +232 -0
  261. data/test/integration/schemas/sqlite.rb +82 -0
  262. data/test/integration/sqlite/star_wars_introspection_test.rb +15 -0
  263. data/test/integration/sqlite/star_wars_mutation_test.rb +82 -0
  264. data/test/integration/sqlite/star_wars_query_test.rb +71 -0
  265. data/test/test_ext.rb +48 -0
  266. metadata +509 -0
Binary file
@@ -0,0 +1,428 @@
1
+ schema {
2
+ query: _Query
3
+ mutation: _Mutation
4
+ }
5
+
6
+ """
7
+ The Bigint scalar type represents a signed numeric non‐fractional value.
8
+ It can go beyond the Int 32‐bit limit, but it's exchanged as a string.
9
+ """
10
+ scalar Bigint
11
+
12
+ """
13
+ The Binary scalar type represents a Base64 string.
14
+ Normally used to share files and uploads.
15
+ """
16
+ scalar Binary
17
+
18
+ "The Boolean scalar type represents true or false."
19
+ scalar Boolean
20
+
21
+ "The Date scalar type represents a ISO 8601 string value."
22
+ scalar Date
23
+
24
+ "The DateTime scalar type represents a ISO 8601 string value."
25
+ scalar DateTime
26
+
27
+ """
28
+ The Decimal scalar type represents signed fractional values with extra precision.
29
+ The values are exchange as string.
30
+ """
31
+ scalar Decimal
32
+
33
+ "The Float scalar type represents signed double‐precision fractional values."
34
+ scalar Float
35
+
36
+ """
37
+ The ID scalar type represents a unique identifier and it is serialized in the same
38
+ way as a String but it accepts both numeric and string based values as input.
39
+ """
40
+ scalar ID
41
+
42
+ "The Int scalar type represents a signed 32‐bit numeric non‐fractional value."
43
+ scalar Int
44
+
45
+ """
46
+ The String scalar type represents textual data, represented as UTF‐8 character
47
+ sequences.
48
+ """
49
+ scalar String
50
+
51
+ """
52
+ The Time scalar type that represents a distance in time using hours,
53
+ minutes, seconds, and miliseconds.
54
+ """
55
+ scalar Time
56
+
57
+ "One of the films in the Star Wars Trilogy"
58
+ enum Episode {
59
+ "Released in 1977."
60
+ NEW_HOPE
61
+
62
+ "Released in 1980."
63
+ EMPIRE
64
+
65
+ "Released in 1983."
66
+ JEDI
67
+ }
68
+
69
+ "The valid locations that a directive may be placed."
70
+ enum __DirectiveLocation {
71
+ "Mark as a executable directive usable on query objects."
72
+ QUERY
73
+
74
+ "Mark as a executable directive usable on mutation objects."
75
+ MUTATION
76
+
77
+ "Mark as a executable directive usable on subscription objects."
78
+ SUBSCRIPTION
79
+
80
+ "Mark as a executable directive usable on field objects."
81
+ FIELD
82
+
83
+ "Mark as a executable directive usable on fragment definition objects."
84
+ FRAGMENT_DEFINITION
85
+
86
+ "Mark as a executable directive usable on fragment spread objects."
87
+ FRAGMENT_SPREAD
88
+
89
+ "Mark as a executable directive usable on inline fragment objects."
90
+ INLINE_FRAGMENT
91
+
92
+ "Mark as a type system directive usable on schema definitions."
93
+ SCHEMA
94
+
95
+ "Mark as a type system directive usable on scalar definitions."
96
+ SCALAR
97
+
98
+ "Mark as a type system directive usable on object definitions."
99
+ OBJECT
100
+
101
+ "Mark as a type system directive usable on field definitions."
102
+ FIELD_DEFINITION
103
+
104
+ "Mark as a type system directive usable on argument definitions."
105
+ ARGUMENT_DEFINITION
106
+
107
+ "Mark as a type system directive usable on interface definitions."
108
+ INTERFACE
109
+
110
+ "Mark as a type system directive usable on union definitions."
111
+ UNION
112
+
113
+ "Mark as a type system directive usable on enum definitions."
114
+ ENUM
115
+
116
+ "Mark as a type system directive usable on enum value definitions."
117
+ ENUM_VALUE
118
+
119
+ "Mark as a type system directive usable on input object definitions."
120
+ INPUT_OBJECT
121
+
122
+ "Mark as a type system directive usable on input field definitions."
123
+ INPUT_FIELD_DEFINITION
124
+ }
125
+
126
+ """
127
+ The fundamental unit of any GraphQL Schema is the type.
128
+ This enum enlist all the valid base types.
129
+ """
130
+ enum __TypeKind {
131
+ "Scalar types represent primitive leaf values in a GraphQL type system.\n"
132
+ SCALAR
133
+
134
+ "Objects represent a list of named fields, each of which yield a value of a\nspecific type.\n"
135
+ OBJECT
136
+
137
+ "Interfaces represent a list of named fields and their types.\n"
138
+ INTERFACE
139
+
140
+ "Unions represent an object that could be one of a list of GraphQL Object types.\n"
141
+ UNION
142
+
143
+ "Enum types, like scalar types, also represent leaf values in a GraphQL\ntype system. However Enum types describe the set of possible values.\n"
144
+ ENUM
145
+
146
+ "Objects represent a list of named fields, each of which yield a value of\na specific type.\n"
147
+ INPUT_OBJECT
148
+
149
+ "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"
150
+ LIST
151
+
152
+ "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"
153
+ NON_NULL
154
+ }
155
+
156
+ "A character in the Star Wars Trilogy"
157
+ interface Character {
158
+ "The id of the character"
159
+ id: ID!
160
+
161
+ "The name of the character"
162
+ name: String
163
+
164
+ "The friends of the character, or an empty list if they have none"
165
+ friends: [Character]
166
+
167
+ "Which movies they appear in"
168
+ appearsIn: [Episode]
169
+
170
+ "All secrets about their past"
171
+ secretBackstory: String
172
+ }
173
+
174
+ "A mechanical creature in the Star Wars universe"
175
+ # Assigned to MemoryTest::Droid class
176
+ type Droid implements Character {
177
+ "The id of the character"
178
+ id: ID!
179
+
180
+ "The name of the character"
181
+ name: String
182
+
183
+ "The friends of the character, or an empty list if they have none"
184
+ friends: [Character]
185
+
186
+ "Which movies they appear in"
187
+ appearsIn: [Episode]
188
+
189
+ "All secrets about their past"
190
+ secretBackstory: String
191
+
192
+ "The primary function of the droid"
193
+ primaryFunction: String
194
+ }
195
+
196
+ "A humanoid creature in the Star Wars universe"
197
+ # Assigned to MemoryTest::Human class
198
+ type Human implements Character {
199
+ "The id of the character"
200
+ id: ID!
201
+
202
+ "The name of the character"
203
+ name: String
204
+
205
+ "The friends of the character, or an empty list if they have none"
206
+ friends: [Character]
207
+
208
+ "Which movies they appear in"
209
+ appearsIn: [Episode]
210
+
211
+ "All secrets about their past"
212
+ secretBackstory: String
213
+
214
+ "The home planet of the human, or null if unknown"
215
+ homePlanet: String
216
+ }
217
+
218
+ type _Mutation {
219
+ "Change the episodes of a human and return a set of characters"
220
+ changeHuman(
221
+
222
+ "The ID of the human to be changed"
223
+ id: ID!,
224
+ episodes: [Episode!]
225
+
226
+ ): [Character!]!
227
+ }
228
+
229
+ type _Query {
230
+ __schema: __Schema!
231
+
232
+ __type(name: String!): __Type
233
+
234
+ "Find the hero of the whole saga"
235
+ hero(
236
+
237
+ "Return for a specific episode"
238
+ episode: Episode
239
+
240
+ ): Character
241
+
242
+ "Find a human character"
243
+ human(
244
+
245
+ "ID of the human"
246
+ id: ID!
247
+
248
+ ): Human
249
+
250
+ "Find a droid character"
251
+ droid(
252
+
253
+ "ID of the droid"
254
+ id: ID!
255
+
256
+ ): Droid
257
+ }
258
+
259
+ """
260
+ Directives provide a way to describe alternate runtime execution
261
+ and type validation behavior in a GraphQL document.
262
+
263
+ In some cases, you need to provide options to alter GraphQL’s execution
264
+ behavior in ways field arguments will not suffice, such as conditionally
265
+ including or skipping a field. Directives provide this by describing
266
+ additional information to the executor.
267
+ """
268
+ # Assigned to Rails::GraphQL::Directive class
269
+ type __Directive {
270
+ name: String!
271
+
272
+ description: String
273
+
274
+ locations: [__DirectiveLocation!]!
275
+
276
+ args: [__InputValue!]!
277
+ }
278
+
279
+ """
280
+ One of the values of an Enum object. It is unique within the Enum set
281
+ of values. It's a string representation, not a numeric representation,
282
+ of a value kept as all caps (ie. ONE_VALUE).
283
+ """
284
+ type __EnumValue {
285
+ name: String!
286
+
287
+ description: String
288
+
289
+ isDeprecated: Boolean!
290
+
291
+ deprecationReason: String
292
+ }
293
+
294
+ """
295
+ Fields are the elements that compose both Objects and Interfaces. Each
296
+ field in these other objects may contain arguments and always yields
297
+ a value of a specific type.
298
+ """
299
+ # Assigned to Rails::GraphQL::Field class
300
+ type __Field {
301
+ name: String!
302
+
303
+ description: String
304
+
305
+ args: [__InputValue!]!
306
+
307
+ type: __Type!
308
+
309
+ isDeprecated: Boolean!
310
+
311
+ deprecationReason: String
312
+ }
313
+
314
+ """
315
+ Alongside with scalars and enums, input value objects allow the user
316
+ to provide values to arguments on fields and directives. Different
317
+ from those, input values accepts a list of keyed values, instead of
318
+ a single value.
319
+ """
320
+ # Assigned to Rails::GraphQL::Field::InputField class
321
+ type __InputValue {
322
+ name: String!
323
+
324
+ description: String
325
+
326
+ type: __Type!
327
+
328
+ defaultValue: String
329
+ }
330
+
331
+ """
332
+ A GraphQL service’s collective type system capabilities are referred
333
+ to as that service’s "schema". A schema is defined in terms of the
334
+ types and directives it supports as well as the root operation types
335
+ for each kind of operation: query, mutation, and subscription; this
336
+ determines the place in the type system where those operations begin.
337
+ """
338
+ # Assigned to Rails::GraphQL::Schema class
339
+ type __Schema {
340
+ types: [__Type!]!
341
+
342
+ queryType: __Type!
343
+
344
+ mutationType: __Type
345
+
346
+ subscriptionType: __Type
347
+
348
+ directives: [__Directive!]!
349
+ }
350
+
351
+ """
352
+ The fundamental unit of any GraphQL Schema is the type. There are six
353
+ kinds of named type definitions in GraphQL, and two wrapping types.
354
+
355
+ The most basic type is a +Scalar+. A scalar represents a primitive value,
356
+ like a string or an integer.
357
+
358
+ +Scalars+ and +Enums+ form the leaves in response trees; the intermediate
359
+ levels are +Object+ types, which define a set of fields.
360
+
361
+ An +Interface+ defines a list of fields; +Object+ types that implement
362
+ that interface are guaranteed to implement those fields.
363
+
364
+ A +Union+ defines a list of possible types; similar to interfaces,
365
+ whenever the type system claims a union will be returned, one of the
366
+ possible types will be returned.
367
+
368
+ Finally, oftentimes it is useful to provide complex structs as inputs
369
+ to GraphQL field arguments or variables; the +Input Object+ type allows
370
+ the schema to define exactly what data is expected.
371
+ """
372
+ # Assigned to Rails::GraphQL::Type class
373
+ type __Type {
374
+ kind: __TypeKind!
375
+
376
+ name: String
377
+
378
+ description: String
379
+
380
+ "OBJECT and INTERFACE only"
381
+ fields(includeDeprecated: Boolean = false): [__Field!]
382
+
383
+ "OBJECT only"
384
+ interfaces: [__Type!]
385
+
386
+ "INTERFACE and UNION only"
387
+ possibleTypes: [__Type!]
388
+
389
+ "ENUM only"
390
+ enumValues(includeDeprecated: Boolean = false): [__EnumValue!]
391
+
392
+ "INPUT_OBJECT only"
393
+ inputFields: [__InputValue!]
394
+
395
+ "NON_NULL and LIST only"
396
+ ofType: __Type
397
+ }
398
+
399
+ """
400
+ Indicate deprecated portions of a GraphQL service’s schema, such as deprecated
401
+ fields on a type or deprecated enum values.
402
+ """
403
+ directive @deprecated(
404
+
405
+ """
406
+ Explain why the underlying element was marked as deprecated. If possible,
407
+ indicate what element should be used instead. This description is formatted
408
+ using Markdown syntax (as specified by [CommonMark](http://commonmark.org/)).
409
+ """
410
+ reason: String
411
+
412
+ ) on FIELD_DEFINITION | ENUM_VALUE
413
+
414
+ "Allows for conditional inclusion during execution as described by the if argument."
415
+ directive @include(
416
+
417
+ "When false, the underlying element will be automatically marked as null."
418
+ if: Boolean!
419
+
420
+ ) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
421
+
422
+ "Allows for conditional exclusion during execution as described by the if argument."
423
+ directive @skip(
424
+
425
+ "When true, the underlying element will be automatically marked as null."
426
+ if: Boolean!
427
+
428
+ ) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
@@ -0,0 +1,423 @@
1
+ schema {
2
+ query: _Query
3
+ mutation: _Mutation
4
+ }
5
+
6
+ """
7
+ The Bigint scalar type represents a signed numeric non‐fractional value.
8
+ It can go beyond the Int 32‐bit limit, but it's exchanged as a string.
9
+ """
10
+ scalar Bigint
11
+
12
+ """
13
+ The Binary scalar type represents a Base64 string.
14
+ Normally used to share files and uploads.
15
+ """
16
+ scalar Binary
17
+
18
+ "The Boolean scalar type represents true or false."
19
+ scalar Boolean
20
+
21
+ "The Date scalar type represents a ISO 8601 string value."
22
+ scalar Date
23
+
24
+ "The DateTime scalar type represents a ISO 8601 string value."
25
+ scalar DateTime
26
+
27
+ """
28
+ The Decimal scalar type represents signed fractional values with extra precision.
29
+ The values are exchange as string.
30
+ """
31
+ scalar Decimal
32
+
33
+ "The Float scalar type represents signed double‐precision fractional values."
34
+ scalar Float
35
+
36
+ """
37
+ The ID scalar type represents a unique identifier and it is serialized in the same
38
+ way as a String but it accepts both numeric and string based values as input.
39
+ """
40
+ scalar ID
41
+
42
+ "The Int scalar type represents a signed 32‐bit numeric non‐fractional value."
43
+ scalar Int
44
+
45
+ """
46
+ The String scalar type represents textual data, represented as UTF‐8 character
47
+ sequences.
48
+ """
49
+ scalar String
50
+
51
+ """
52
+ The Time scalar type that represents a distance in time using hours,
53
+ minutes, seconds, and miliseconds.
54
+ """
55
+ scalar Time
56
+
57
+ "The valid locations that a directive may be placed."
58
+ enum __DirectiveLocation {
59
+ "Mark as a executable directive usable on query objects."
60
+ QUERY
61
+
62
+ "Mark as a executable directive usable on mutation objects."
63
+ MUTATION
64
+
65
+ "Mark as a executable directive usable on subscription objects."
66
+ SUBSCRIPTION
67
+
68
+ "Mark as a executable directive usable on field objects."
69
+ FIELD
70
+
71
+ "Mark as a executable directive usable on fragment definition objects."
72
+ FRAGMENT_DEFINITION
73
+
74
+ "Mark as a executable directive usable on fragment spread objects."
75
+ FRAGMENT_SPREAD
76
+
77
+ "Mark as a executable directive usable on inline fragment objects."
78
+ INLINE_FRAGMENT
79
+
80
+ "Mark as a type system directive usable on schema definitions."
81
+ SCHEMA
82
+
83
+ "Mark as a type system directive usable on scalar definitions."
84
+ SCALAR
85
+
86
+ "Mark as a type system directive usable on object definitions."
87
+ OBJECT
88
+
89
+ "Mark as a type system directive usable on field definitions."
90
+ FIELD_DEFINITION
91
+
92
+ "Mark as a type system directive usable on argument definitions."
93
+ ARGUMENT_DEFINITION
94
+
95
+ "Mark as a type system directive usable on interface definitions."
96
+ INTERFACE
97
+
98
+ "Mark as a type system directive usable on union definitions."
99
+ UNION
100
+
101
+ "Mark as a type system directive usable on enum definitions."
102
+ ENUM
103
+
104
+ "Mark as a type system directive usable on enum value definitions."
105
+ ENUM_VALUE
106
+
107
+ "Mark as a type system directive usable on input object definitions."
108
+ INPUT_OBJECT
109
+
110
+ "Mark as a type system directive usable on input field definitions."
111
+ INPUT_FIELD_DEFINITION
112
+ }
113
+
114
+ """
115
+ The fundamental unit of any GraphQL Schema is the type.
116
+ This enum enlist all the valid base types.
117
+ """
118
+ enum __TypeKind {
119
+ "Scalar types represent primitive leaf values in a GraphQL type system.\n"
120
+ SCALAR
121
+
122
+ "Objects represent a list of named fields, each of which yield a value of a\nspecific type.\n"
123
+ OBJECT
124
+
125
+ "Interfaces represent a list of named fields and their types.\n"
126
+ INTERFACE
127
+
128
+ "Unions represent an object that could be one of a list of GraphQL Object types.\n"
129
+ UNION
130
+
131
+ "Enum types, like scalar types, also represent leaf values in a GraphQL\ntype system. However Enum types describe the set of possible values.\n"
132
+ ENUM
133
+
134
+ "Objects represent a list of named fields, each of which yield a value of\na specific type.\n"
135
+ INPUT_OBJECT
136
+
137
+ "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"
138
+ LIST
139
+
140
+ "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"
141
+ NON_NULL
142
+ }
143
+
144
+ # Assigned to LiteBase class
145
+ input LiteBaseInput {
146
+ id: ID
147
+
148
+ factionId: ID
149
+
150
+ name: String
151
+
152
+ planet: String
153
+
154
+ _delete: Boolean = false
155
+ }
156
+
157
+ # Assigned to LiteFaction class
158
+ input LiteFactionInput {
159
+ id: ID
160
+
161
+ name: String
162
+
163
+ _delete: Boolean = false
164
+
165
+ basesAttributes: [LiteBaseInput!]
166
+
167
+ shipsAttributes: [LiteShipInput!]
168
+ }
169
+
170
+ # Assigned to LiteShip class
171
+ input LiteShipInput {
172
+ id: ID
173
+
174
+ factionId: ID
175
+
176
+ name: String
177
+
178
+ _delete: Boolean = false
179
+ }
180
+
181
+ # Assigned to LiteBase class
182
+ type LiteBase {
183
+ id: ID!
184
+
185
+ factionId: ID
186
+
187
+ name: String
188
+
189
+ planet: String
190
+
191
+ faction: LiteFaction
192
+ }
193
+
194
+ # Assigned to LiteFaction class
195
+ type LiteFaction {
196
+ id: ID!
197
+
198
+ name: String
199
+
200
+ bases: [LiteBase!]!
201
+
202
+ ships: [LiteShip!]!
203
+ }
204
+
205
+ # Assigned to LiteShip class
206
+ type LiteShip {
207
+ id: ID!
208
+
209
+ factionId: ID
210
+
211
+ name: String
212
+
213
+ faction: LiteFaction
214
+ }
215
+
216
+ type _Mutation {
217
+ createLiteFaction(liteFaction: LiteFactionInput!): LiteFaction!
218
+
219
+ updateLiteFaction(id: ID!, liteFaction: LiteFactionInput!): LiteFaction!
220
+
221
+ deleteLiteFaction(id: ID!): Boolean!
222
+
223
+ createLiteBase(liteBase: LiteBaseInput!): LiteBase!
224
+
225
+ updateLiteBase(id: ID!, liteBase: LiteBaseInput!): LiteBase!
226
+
227
+ deleteLiteBase(id: ID!): Boolean!
228
+
229
+ createLiteShip(liteShip: LiteShipInput!): LiteShip!
230
+
231
+ updateLiteShip(id: ID!, liteShip: LiteShipInput!): LiteShip!
232
+
233
+ deleteLiteShip(id: ID!): Boolean!
234
+ }
235
+
236
+ type _Query {
237
+ __schema: __Schema!
238
+
239
+ __type(name: String!): __Type
240
+
241
+ liteFactions(order: String): [LiteFaction!]!
242
+
243
+ liteFaction(id: ID!): LiteFaction!
244
+
245
+ liteBases: [LiteBase!]!
246
+
247
+ liteBase(id: ID!): LiteBase!
248
+
249
+ liteShips: [LiteShip!]!
250
+
251
+ liteShip(id: ID!): LiteShip!
252
+ }
253
+
254
+ """
255
+ Directives provide a way to describe alternate runtime execution
256
+ and type validation behavior in a GraphQL document.
257
+
258
+ In some cases, you need to provide options to alter GraphQL’s execution
259
+ behavior in ways field arguments will not suffice, such as conditionally
260
+ including or skipping a field. Directives provide this by describing
261
+ additional information to the executor.
262
+ """
263
+ # Assigned to Rails::GraphQL::Directive class
264
+ type __Directive {
265
+ name: String!
266
+
267
+ description: String
268
+
269
+ locations: [__DirectiveLocation!]!
270
+
271
+ args: [__InputValue!]!
272
+ }
273
+
274
+ """
275
+ One of the values of an Enum object. It is unique within the Enum set
276
+ of values. It's a string representation, not a numeric representation,
277
+ of a value kept as all caps (ie. ONE_VALUE).
278
+ """
279
+ type __EnumValue {
280
+ name: String!
281
+
282
+ description: String
283
+
284
+ isDeprecated: Boolean!
285
+
286
+ deprecationReason: String
287
+ }
288
+
289
+ """
290
+ Fields are the elements that compose both Objects and Interfaces. Each
291
+ field in these other objects may contain arguments and always yields
292
+ a value of a specific type.
293
+ """
294
+ # Assigned to Rails::GraphQL::Field class
295
+ type __Field {
296
+ name: String!
297
+
298
+ description: String
299
+
300
+ args: [__InputValue!]!
301
+
302
+ type: __Type!
303
+
304
+ isDeprecated: Boolean!
305
+
306
+ deprecationReason: String
307
+ }
308
+
309
+ """
310
+ Alongside with scalars and enums, input value objects allow the user
311
+ to provide values to arguments on fields and directives. Different
312
+ from those, input values accepts a list of keyed values, instead of
313
+ a single value.
314
+ """
315
+ # Assigned to Rails::GraphQL::Field::InputField class
316
+ type __InputValue {
317
+ name: String!
318
+
319
+ description: String
320
+
321
+ type: __Type!
322
+
323
+ defaultValue: String
324
+ }
325
+
326
+ """
327
+ A GraphQL service’s collective type system capabilities are referred
328
+ to as that service’s "schema". A schema is defined in terms of the
329
+ types and directives it supports as well as the root operation types
330
+ for each kind of operation: query, mutation, and subscription; this
331
+ determines the place in the type system where those operations begin.
332
+ """
333
+ # Assigned to Rails::GraphQL::Schema class
334
+ type __Schema {
335
+ types: [__Type!]!
336
+
337
+ queryType: __Type!
338
+
339
+ mutationType: __Type
340
+
341
+ subscriptionType: __Type
342
+
343
+ directives: [__Directive!]!
344
+ }
345
+
346
+ """
347
+ The fundamental unit of any GraphQL Schema is the type. There are six
348
+ kinds of named type definitions in GraphQL, and two wrapping types.
349
+
350
+ The most basic type is a +Scalar+. A scalar represents a primitive value,
351
+ like a string or an integer.
352
+
353
+ +Scalars+ and +Enums+ form the leaves in response trees; the intermediate
354
+ levels are +Object+ types, which define a set of fields.
355
+
356
+ An +Interface+ defines a list of fields; +Object+ types that implement
357
+ that interface are guaranteed to implement those fields.
358
+
359
+ A +Union+ defines a list of possible types; similar to interfaces,
360
+ whenever the type system claims a union will be returned, one of the
361
+ possible types will be returned.
362
+
363
+ Finally, oftentimes it is useful to provide complex structs as inputs
364
+ to GraphQL field arguments or variables; the +Input Object+ type allows
365
+ the schema to define exactly what data is expected.
366
+ """
367
+ # Assigned to Rails::GraphQL::Type class
368
+ type __Type {
369
+ kind: __TypeKind!
370
+
371
+ name: String
372
+
373
+ description: String
374
+
375
+ "OBJECT and INTERFACE only"
376
+ fields(includeDeprecated: Boolean = false): [__Field!]
377
+
378
+ "OBJECT only"
379
+ interfaces: [__Type!]
380
+
381
+ "INTERFACE and UNION only"
382
+ possibleTypes: [__Type!]
383
+
384
+ "ENUM only"
385
+ enumValues(includeDeprecated: Boolean = false): [__EnumValue!]
386
+
387
+ "INPUT_OBJECT only"
388
+ inputFields: [__InputValue!]
389
+
390
+ "NON_NULL and LIST only"
391
+ ofType: __Type
392
+ }
393
+
394
+ """
395
+ Indicate deprecated portions of a GraphQL service’s schema, such as deprecated
396
+ fields on a type or deprecated enum values.
397
+ """
398
+ directive @deprecated(
399
+
400
+ """
401
+ Explain why the underlying element was marked as deprecated. If possible,
402
+ indicate what element should be used instead. This description is formatted
403
+ using Markdown syntax (as specified by [CommonMark](http://commonmark.org/)).
404
+ """
405
+ reason: String
406
+
407
+ ) on FIELD_DEFINITION | ENUM_VALUE
408
+
409
+ "Allows for conditional inclusion during execution as described by the if argument."
410
+ directive @include(
411
+
412
+ "When false, the underlying element will be automatically marked as null."
413
+ if: Boolean!
414
+
415
+ ) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
416
+
417
+ "Allows for conditional exclusion during execution as described by the if argument."
418
+ directive @skip(
419
+
420
+ "When true, the underlying element will be automatically marked as null."
421
+ if: Boolean!
422
+
423
+ ) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT