rails-graphql 1.0.0.beta → 1.0.0.rc2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (137) hide show
  1. checksums.yaml +4 -4
  2. data/ext/gql_parser.c +1 -16
  3. data/ext/gql_parser.h +21 -0
  4. data/ext/shared.c +0 -5
  5. data/ext/shared.h +6 -6
  6. data/lib/generators/graphql/channel_generator.rb +27 -0
  7. data/lib/generators/graphql/controller_generator.rb +9 -4
  8. data/lib/generators/graphql/install_generator.rb +49 -0
  9. data/lib/generators/graphql/schema_generator.rb +9 -4
  10. data/lib/generators/graphql/templates/channel.erb +7 -0
  11. data/lib/generators/graphql/templates/config.rb +97 -0
  12. data/lib/generators/graphql/templates/controller.erb +2 -0
  13. data/lib/generators/graphql/templates/schema.erb +5 -3
  14. data/lib/gql_parser.so +0 -0
  15. data/lib/rails/graphql/alternative/field_set.rb +12 -0
  16. data/lib/rails/graphql/alternative/query.rb +13 -8
  17. data/lib/rails/graphql/alternative/subscription.rb +2 -1
  18. data/lib/rails/graphql/alternative.rb +4 -0
  19. data/lib/rails/graphql/argument.rb +5 -3
  20. data/lib/rails/graphql/callback.rb +10 -8
  21. data/lib/rails/graphql/collectors/hash_collector.rb +12 -1
  22. data/lib/rails/graphql/collectors/json_collector.rb +21 -0
  23. data/lib/rails/graphql/config.rb +86 -59
  24. data/lib/rails/graphql/directive/include_directive.rb +0 -1
  25. data/lib/rails/graphql/directive/skip_directive.rb +0 -1
  26. data/lib/rails/graphql/directive/specified_by_directive.rb +24 -0
  27. data/lib/rails/graphql/directive.rb +31 -25
  28. data/lib/rails/graphql/event.rb +7 -6
  29. data/lib/rails/graphql/field/authorized_field.rb +0 -5
  30. data/lib/rails/graphql/field/input_field.rb +0 -5
  31. data/lib/rails/graphql/field/mutation_field.rb +5 -6
  32. data/lib/rails/graphql/field/output_field.rb +13 -2
  33. data/lib/rails/graphql/field/proxied_field.rb +6 -6
  34. data/lib/rails/graphql/field/resolved_field.rb +1 -1
  35. data/lib/rails/graphql/field/subscription_field.rb +35 -52
  36. data/lib/rails/graphql/field/typed_field.rb +26 -2
  37. data/lib/rails/graphql/field.rb +20 -19
  38. data/lib/rails/graphql/global_id.rb +5 -1
  39. data/lib/rails/graphql/helpers/inherited_collection/array.rb +1 -0
  40. data/lib/rails/graphql/helpers/inherited_collection/base.rb +3 -1
  41. data/lib/rails/graphql/helpers/inherited_collection/hash.rb +2 -1
  42. data/lib/rails/graphql/helpers/registerable.rb +1 -1
  43. data/lib/rails/graphql/helpers/with_arguments.rb +3 -2
  44. data/lib/rails/graphql/helpers/with_assignment.rb +5 -5
  45. data/lib/rails/graphql/helpers/with_callbacks.rb +3 -3
  46. data/lib/rails/graphql/helpers/with_description.rb +10 -8
  47. data/lib/rails/graphql/helpers/with_directives.rb +5 -1
  48. data/lib/rails/graphql/helpers/with_events.rb +1 -0
  49. data/lib/rails/graphql/helpers/with_fields.rb +30 -24
  50. data/lib/rails/graphql/helpers/with_name.rb +3 -2
  51. data/lib/rails/graphql/helpers/with_schema_fields.rb +75 -51
  52. data/lib/rails/graphql/introspection.rb +1 -1
  53. data/lib/rails/graphql/railtie.rb +3 -2
  54. data/lib/rails/graphql/railties/app/base_channel.rb +10 -0
  55. data/lib/rails/graphql/railties/app/base_controller.rb +12 -0
  56. data/lib/rails/graphql/railties/app/views/_cable.js.erb +56 -0
  57. data/lib/rails/graphql/railties/app/views/_fetch.js.erb +20 -0
  58. data/lib/rails/graphql/railties/app/views/graphiql.html.erb +101 -0
  59. data/lib/rails/graphql/railties/base_generator.rb +3 -9
  60. data/lib/rails/graphql/railties/channel.rb +8 -8
  61. data/lib/rails/graphql/railties/controller.rb +51 -26
  62. data/lib/rails/graphql/request/arguments.rb +2 -1
  63. data/lib/rails/graphql/request/backtrace.rb +31 -10
  64. data/lib/rails/graphql/request/component/field.rb +15 -8
  65. data/lib/rails/graphql/request/component/fragment.rb +13 -7
  66. data/lib/rails/graphql/request/component/operation/subscription.rb +4 -6
  67. data/lib/rails/graphql/request/component/operation.rb +12 -5
  68. data/lib/rails/graphql/request/component/spread.rb +13 -4
  69. data/lib/rails/graphql/request/component/typename.rb +1 -1
  70. data/lib/rails/graphql/request/component.rb +2 -0
  71. data/lib/rails/graphql/request/context.rb +1 -1
  72. data/lib/rails/graphql/request/event.rb +6 -2
  73. data/lib/rails/graphql/request/helpers/directives.rb +1 -0
  74. data/lib/rails/graphql/request/helpers/selection_set.rb +10 -4
  75. data/lib/rails/graphql/request/helpers/value_writers.rb +8 -5
  76. data/lib/rails/graphql/request/prepared_data.rb +3 -1
  77. data/lib/rails/graphql/request/steps/organizable.rb +1 -1
  78. data/lib/rails/graphql/request/steps/preparable.rb +1 -1
  79. data/lib/rails/graphql/request/steps/resolvable.rb +1 -1
  80. data/lib/rails/graphql/request/strategy/sequenced_strategy.rb +3 -3
  81. data/lib/rails/graphql/request/strategy.rb +18 -4
  82. data/lib/rails/graphql/request/subscription.rb +18 -16
  83. data/lib/rails/graphql/request.rb +71 -41
  84. data/lib/rails/graphql/schema.rb +39 -86
  85. data/lib/rails/graphql/shortcuts.rb +11 -5
  86. data/lib/rails/graphql/source/active_record/builders.rb +22 -24
  87. data/lib/rails/graphql/source/active_record_source.rb +96 -34
  88. data/lib/rails/graphql/source/base.rb +13 -40
  89. data/lib/rails/graphql/source/builder.rb +14 -22
  90. data/lib/rails/graphql/source/scoped_arguments.rb +10 -4
  91. data/lib/rails/graphql/source.rb +31 -38
  92. data/lib/rails/graphql/subscription/provider/action_cable.rb +10 -9
  93. data/lib/rails/graphql/subscription/provider/base.rb +6 -5
  94. data/lib/rails/graphql/subscription/store/base.rb +5 -9
  95. data/lib/rails/graphql/subscription/store/memory.rb +18 -9
  96. data/lib/rails/graphql/type/creator.rb +198 -0
  97. data/lib/rails/graphql/type/enum.rb +17 -9
  98. data/lib/rails/graphql/type/input.rb +30 -7
  99. data/lib/rails/graphql/type/interface.rb +15 -4
  100. data/lib/rails/graphql/type/object/directive_object.rb +6 -5
  101. data/lib/rails/graphql/type/object/input_value_object.rb +3 -4
  102. data/lib/rails/graphql/type/object/type_object.rb +40 -13
  103. data/lib/rails/graphql/type/object.rb +11 -6
  104. data/lib/rails/graphql/type/scalar/binary_scalar.rb +2 -0
  105. data/lib/rails/graphql/type/scalar/date_scalar.rb +2 -0
  106. data/lib/rails/graphql/type/scalar/date_time_scalar.rb +2 -0
  107. data/lib/rails/graphql/type/scalar/decimal_scalar.rb +2 -0
  108. data/lib/rails/graphql/type/scalar/json_scalar.rb +3 -1
  109. data/lib/rails/graphql/type/scalar/time_scalar.rb +3 -1
  110. data/lib/rails/graphql/type/scalar.rb +2 -2
  111. data/lib/rails/graphql/type/union.rb +7 -2
  112. data/lib/rails/graphql/type.rb +10 -2
  113. data/lib/rails/graphql/type_map.rb +20 -7
  114. data/lib/rails/graphql/uri.rb +5 -4
  115. data/lib/rails/graphql/version.rb +6 -2
  116. data/lib/rails/graphql.rb +11 -8
  117. data/test/assets/introspection-mem.txt +1 -1
  118. data/test/assets/introspection.gql +2 -0
  119. data/test/assets/mem.gql +74 -60
  120. data/test/assets/mysql.gql +69 -55
  121. data/test/assets/sqlite.gql +78 -64
  122. data/test/assets/translate.gql +50 -39
  123. data/test/config.rb +2 -1
  124. data/test/graphql/schema_test.rb +2 -31
  125. data/test/graphql/source_test.rb +1 -11
  126. data/test/graphql/type/interface_test.rb +8 -5
  127. data/test/graphql/type/object_test.rb +8 -2
  128. data/test/graphql/type_map_test.rb +13 -16
  129. data/test/integration/global_id_test.rb +4 -4
  130. data/test/integration/memory/star_wars_validation_test.rb +2 -2
  131. data/test/integration/mysql/star_wars_introspection_test.rb +1 -1
  132. data/test/integration/resolver_precedence_test.rb +1 -1
  133. data/test/integration/schemas/memory.rb +3 -4
  134. data/test/integration/sqlite/star_wars_global_id_test.rb +27 -21
  135. data/test/integration/sqlite/star_wars_introspection_test.rb +1 -1
  136. data/test/integration/translate_test.rb +26 -14
  137. metadata +22 -9
@@ -79,21 +79,19 @@ class GraphQL_TypeMapTest < GraphQL::TestCase
79
79
 
80
80
  def test_fetch
81
81
  stub_dig do
82
- assert_registered(9) do
83
- assert_nil(subject.fetch(:number))
84
- assert_nil(subject.fetch(:number, base_class: :Other))
82
+ assert_nil(subject.fetch(:number))
83
+ assert_nil(subject.fetch(:number, base_class: :Other))
85
84
 
86
- assert_equal(1, subject.fetch(:string))
87
- assert_equal(1, subject.fetch(:string, prevent_register: true))
88
- assert_equal(1, subject.fetch(:number, fallback: :string))
85
+ assert_equal(1, subject.fetch(:string))
86
+ assert_equal(1, subject.fetch(:string, prevent_register: true))
87
+ assert_equal(1, subject.fetch(:number, fallback: :string))
89
88
 
90
- assert_equal(2, subject.fetch(:string, namespaces: :other))
91
- assert_equal(3, subject.fetch(:number, namespaces: Set[:other]))
89
+ assert_equal(2, subject.fetch(:string, namespaces: :other))
90
+ assert_equal(3, subject.fetch(:number, namespaces: Set[:other]))
92
91
 
93
- assert_equal(4, subject.fetch(:boolean))
94
- assert_equal(4, subject.fetch(:boolean, namespaces: :other))
95
- assert_nil(subject.fetch(:boolean, namespaces: :other, exclusive: true))
96
- end
92
+ assert_equal(4, subject.fetch(:boolean))
93
+ assert_equal(4, subject.fetch(:boolean, namespaces: :other))
94
+ assert_nil(subject.fetch(:boolean, namespaces: :other, exclusive: true))
97
95
  end
98
96
  end
99
97
 
@@ -145,9 +143,8 @@ class GraphQL_TypeMapTest < GraphQL::TestCase
145
143
  assert_equal([:base, object1, :string], added[0][0..-2])
146
144
  assert_equal([:base, object1, 'string'], added[1][0..-2])
147
145
 
148
- subject.stub(:fetch, passallthrough) do
149
- xargs = { base_class: object1, namespaces: :base, exclusive: true }
150
- assert_equal([:string, xargs], added[1][-1].call)
146
+ subject.stub(:dig, passallthrough) do
147
+ assert_equal([:base, object1, :string], added[1][-1].call)
151
148
  assert_equal(object1, added[0][-1])
152
149
  end
153
150
 
@@ -261,7 +258,7 @@ class GraphQL_TypeMapTest < GraphQL::TestCase
261
258
  @base_classes=3
262
259
  @objects=0
263
260
  @pending=0
264
- @dependencies={base: 14}>
261
+ @dependencies={base: 15}>
265
262
  INFO
266
263
  end
267
264
 
@@ -35,8 +35,8 @@ class Integration_GlobalIDTest < GraphQL::IntegrationTestCase
35
35
  end
36
36
 
37
37
  def test_create_object_field
38
- obj = GraphQL::HumanObject[:name]
39
- assert_gid_value('gql://start-wars-mem/HumanObject/name', obj)
38
+ obj = SCHEMA.const_get(:NestedTypes)::HumanObject[:name]
39
+ assert_gid_value('gql://start-wars-mem/Human/name', obj)
40
40
  end
41
41
 
42
42
  def test_create_scalar_type
@@ -84,8 +84,8 @@ class Integration_GlobalIDTest < GraphQL::IntegrationTestCase
84
84
  end
85
85
 
86
86
  def test_parse_object_field
87
- obj = find_gid('gql://start-wars-mem/HumanObject/name')
88
- assert_equal(GraphQL::HumanObject[:name], obj)
87
+ obj = find_gid('gql://start-wars-mem/Human/name')
88
+ assert_equal(SCHEMA.const_get(:NestedTypes)::HumanObject[:name], obj)
89
89
  end
90
90
 
91
91
  def test_parse_scalar_type
@@ -34,7 +34,7 @@ class Integration_Memory_StarWarsValidationTest < GraphQL::IntegrationTestCase
34
34
 
35
35
  def test_nonexistent_fields
36
36
  errors = [{
37
- message: 'Unable to find a field named "favoriteSpaceship" on GraphQL::CharacterInterface.',
37
+ message: 'Unable to find a field named "favoriteSpaceship" on Character.',
38
38
  locations: [{ line: 1, column: 35 }, { line: 1, column: 52 }],
39
39
  path: %w[HeroSpaceshipQuery hero favoriteSpaceship],
40
40
  extensions: { stage: 'organize', exception: 'Rails::GraphQL::MissingFieldError' },
@@ -73,7 +73,7 @@ class Integration_Memory_StarWarsValidationTest < GraphQL::IntegrationTestCase
73
73
 
74
74
  def test_specific_fields_on_interfaces
75
75
  errors = [{
76
- message: 'Unable to find a field named "primaryFunction" on GraphQL::CharacterInterface.',
76
+ message: 'Unable to find a field named "primaryFunction" on Character.',
77
77
  locations: [{ line: 1, column: 40 }, { line: 1, column: 55 }],
78
78
  path: %w[HeroSpaceshipQuery hero primaryFunction],
79
79
  extensions: { stage: 'organize', exception: 'Rails::GraphQL::MissingFieldError' },
@@ -11,7 +11,7 @@ class Integration_MySQL_StarWarsIntrospectionTest < GraphQL::IntegrationTestCase
11
11
  assert(SCHEMA.has_field?(:query, :__type))
12
12
  end
13
13
 
14
- # Test this spec with all avaliable scalars
14
+ # Test this spec with all available scalars
15
15
  def remove_keys_form_type_map
16
16
  end
17
17
 
@@ -97,7 +97,7 @@ class Integration_ResolverPrecedenceTest < GraphQL::IntegrationTestCase
97
97
  end
98
98
 
99
99
  def test_simple_object
100
- object = GraphQL::Object1Object
100
+ object = SCHEMA.const_get(:NestedTypes)::Object1Object
101
101
  field = object[:field1]
102
102
 
103
103
  # (1) Block has higher precedence than default value
@@ -102,7 +102,6 @@ class StartWarsMemSchema < GraphQL::Schema
102
102
 
103
103
  rescue_from('StandardError') do |exception|
104
104
  raise unless exception.source.is_a?(Rails::GraphQL::Request::Component::Field)
105
- exception.request.exception_to_error(exception, exception.source)
106
105
  end
107
106
 
108
107
  enum 'Episode' do
@@ -116,10 +115,10 @@ class StartWarsMemSchema < GraphQL::Schema
116
115
  interface 'Character' do
117
116
  desc 'A character in the Star Wars Trilogy'
118
117
 
119
- field :id, :id, null: false,
118
+ field :id, null: false,
120
119
  desc: 'The id of the character'
121
120
 
122
- field :name, :string,
121
+ field :name,
123
122
  desc: 'The name of the character'
124
123
 
125
124
  field :friends, 'Character', array: true,
@@ -128,7 +127,7 @@ class StartWarsMemSchema < GraphQL::Schema
128
127
  field :appears_in, 'Episode', array: true,
129
128
  desc: 'Which movies they appear in'
130
129
 
131
- field :secret_backstory, :string,
130
+ field :secret_backstory,
132
131
  desc: 'All secrets about their past'
133
132
  end
134
133
 
@@ -8,34 +8,34 @@ class Integration_SQLite_StarWarsGlobalIDTest < GraphQL::IntegrationTestCase
8
8
  ## CREATE
9
9
 
10
10
  def test_create_query_field
11
- obj = GraphQL::LiteFactionSource[:query][:lite_factions]
12
- assert_gid_value('gql://star-wars-sqlite/LiteFactionSource/query/liteFactions', obj)
11
+ obj = source[:query][:lite_factions]
12
+ assert_gid_value('gql://star-wars-sqlite/Schema/query/liteFactions', obj)
13
13
  end
14
14
 
15
15
  def test_create_object
16
- obj = GraphQL::LiteFactionSource.object
16
+ obj = source.object
17
17
  assert_gid_value('gql://star-wars-sqlite/Type/LiteFaction', obj)
18
18
  end
19
19
 
20
20
  def test_create_input
21
- obj = GraphQL::LiteFactionSource.input
21
+ obj = source.input
22
22
  assert_gid_value('gql://star-wars-sqlite/Type/LiteFactionInput', obj)
23
23
 
24
- obj = GraphQL::LiteFactionSource.input.deserialize(nil)
24
+ obj = source.input.deserialize(nil)
25
25
  assert_gid_value('gql://star-wars-sqlite/Type/LiteFactionInput?', obj)
26
26
 
27
27
  params = { name: 'Sample' }
28
- obj = GraphQL::LiteFactionSource.input.deserialize(params)
28
+ obj = source.input.deserialize(params)
29
29
  assert_gid_value('gql://star-wars-sqlite/Type/LiteFactionInput?name=Sample', obj)
30
30
 
31
31
  params = { name: 'Sample', bases_attributes: [{ name: 'Other' }] }
32
- obj = GraphQL::LiteFactionSource.input.deserialize(params)
32
+ obj = source.input.deserialize(params)
33
33
  assert_gid_value('gql://star-wars-sqlite/Type/LiteFactionInput?basesAttributes[][name]=Other&name=Sample', obj)
34
34
  end
35
35
 
36
36
  def test_create_object_field
37
- obj = GraphQL::LiteFactionSource.object[:name]
38
- assert_gid_value('gql://star-wars-sqlite/LiteFactionObject/name', obj)
37
+ obj = source.object[:name]
38
+ assert_gid_value('gql://star-wars-sqlite/LiteFaction/name', obj)
39
39
  end
40
40
 
41
41
  def assert_gid_value(result, object)
@@ -45,39 +45,45 @@ class Integration_SQLite_StarWarsGlobalIDTest < GraphQL::IntegrationTestCase
45
45
  ## PARSE
46
46
 
47
47
  def test_parse_query_field
48
- obj = find_gid('gql://star-wars-sqlite/LiteFactionSource/query/liteFactions')
49
- assert_equal(GraphQL::LiteFactionSource[:query][:lite_factions], obj)
48
+ obj = find_gid('gql://star-wars-sqlite/Schema/query/liteFactions')
49
+ assert_equal(source[:query][:lite_factions], obj.proxied_field)
50
50
  end
51
51
 
52
52
  def test_parse_object
53
53
  obj = find_gid('gql://star-wars-sqlite/Type/LiteFaction')
54
- assert_equal(GraphQL::LiteFactionSource.object, obj)
54
+ assert_equal(source.object, obj)
55
55
  end
56
56
 
57
57
  def test_parse_input
58
58
  obj = find_gid('gql://star-wars-sqlite/Type/LiteFactionInput')
59
- assert_equal(GraphQL::LiteFactionSource.input, obj)
59
+ assert_equal(source.input, obj)
60
60
 
61
61
  obj = find_gid('gql://star-wars-sqlite/Type/LiteFactionInput?')
62
- assert_instance_of(GraphQL::LiteFactionSource.input, obj)
62
+ assert_instance_of(source.input, obj)
63
63
  assert_empty(obj.params)
64
64
 
65
65
  obj = find_gid('gql://star-wars-sqlite/Type/LiteFactionInput?name=Sample')
66
- assert_instance_of(GraphQL::LiteFactionSource.input, obj)
66
+ assert_instance_of(source.input, obj)
67
67
  assert_equal('Sample', obj.params[:name])
68
68
 
69
69
  obj = find_gid('gql://star-wars-sqlite/Type/LiteFactionInput?bases_attributes[][name]=Other&name=Sample')
70
- assert_instance_of(GraphQL::LiteFactionSource.input, obj)
70
+ assert_instance_of(source.input, obj)
71
71
  assert_equal([{name: 'Other'}], obj.params[:bases_attributes])
72
72
  assert_equal('Sample', obj.params[:name])
73
73
  end
74
74
 
75
75
  def test_parse_object_field
76
- obj = find_gid('gql://star-wars-sqlite/LiteFactionObject/name')
77
- assert_equal(GraphQL::LiteFactionSource.object[:name], obj)
76
+ obj = find_gid('gql://star-wars-sqlite/LiteFaction/name')
77
+ assert_equal(source.object[:name], obj)
78
78
  end
79
79
 
80
- def find_gid(gid)
81
- GraphQL::GlobalID.find(gid)
82
- end
80
+ protected
81
+
82
+ def find_gid(gid)
83
+ GraphQL::GlobalID.find(gid)
84
+ end
85
+
86
+ def source
87
+ StartWarsSqliteSchema.const_get(:NestedTypes)::LiteFactionSource
88
+ end
83
89
  end
@@ -11,7 +11,7 @@ class Integration_SQLite_StarWarsIntrospectionTest < GraphQL::IntegrationTestCas
11
11
  assert(SCHEMA.has_field?(:query, :__type))
12
12
  end
13
13
 
14
- # Test this spec with all avaliable scalars
14
+ # Test this spec with all available scalars
15
15
  def remove_keys_form_type_map
16
16
  end
17
17
 
@@ -27,35 +27,47 @@ class Translate_test < GraphQL::IntegrationTestCase
27
27
  scalar :scalar_desc
28
28
  end
29
29
 
30
+ def setup
31
+ $config.enable_i18n_descriptions = true
32
+ end
33
+
34
+ def teardown
35
+ $config.enable_i18n_descriptions = false
36
+ end
37
+
30
38
  def test_simple_translate
31
- assert_equal('Field', SCHEMA[:query][:sample_field].description )
32
- assert_equal('Enum', GraphQL::EnumDescEnum.description )
33
- assert_equal('Interface', GraphQL::InterfaceDescInterface.description )
34
- assert_equal('Object', GraphQL::ObjectDescObject.description )
35
- assert_equal('Union', GraphQL::UnionDescUnion.description )
36
- assert_equal('Input', GraphQL::InputDescInput.description )
37
- assert_equal('Scalar', GraphQL::ScalarDescScalar.description )
39
+ skip 'Fix for new I18n structure'
40
+ assert_equal('Field', SCHEMA[:query][:sample_field].description)
41
+ assert_equal('Enum', GraphQL::EnumDescEnum.description)
42
+ assert_equal('Interface', GraphQL::InterfaceDescInterface.description)
43
+ assert_equal('Object', GraphQL::ObjectDescObject.description)
44
+ assert_equal('Union', GraphQL::UnionDescUnion.description)
45
+ assert_equal('Input', GraphQL::InputDescInput.description)
46
+ assert_equal('Scalar', GraphQL::ScalarDescScalar.description)
38
47
  end
39
48
 
40
49
  def test_all_levels_translate_fields
41
- assert_equal('A', SCHEMA[:query][:sample_a].description )
42
- assert_equal('B', SCHEMA[:query][:sample_b].description )
43
- assert_equal('C', SCHEMA[:query][:sample_c].description )
44
- assert_equal('D', SCHEMA[:query][:sample_d].description )
45
- assert_equal('E', SCHEMA[:query][:sample_e].description )
46
- assert_equal('F', SCHEMA[:query][:sample_f].description )
50
+ skip 'Fix for new I18n structure'
51
+ assert_equal('A', SCHEMA[:query][:sample_a].description)
52
+ assert_equal('B', SCHEMA[:query][:sample_b].description)
53
+ assert_equal('C', SCHEMA[:query][:sample_c].description)
54
+ assert_equal('D', SCHEMA[:query][:sample_d].description)
55
+ assert_equal('E', SCHEMA[:query][:sample_e].description)
56
+ assert_equal('F', SCHEMA[:query][:sample_f].description)
47
57
  end
48
58
 
49
59
  def test_request_translate
60
+ skip 'Fix for new I18n structure'
50
61
  result = { data: { __type: { name: 'InterfaceDesc', description: 'Interface' } } }
51
62
  assert_result(result, '{ __type(name: "InterfaceDesc") { name description } }')
52
63
  end
53
64
 
54
65
  def test_gql_introspection
66
+ skip 'Fix for new I18n structure'
55
67
  result = SCHEMA.to_gql
56
68
  expected = gql_file('translate').split('').sort.join.squish
57
69
 
58
- File.write('test/assets/translate.gql', result)
70
+ # File.write('test/assets/translate.gql', result)
59
71
  assert_equal(expected, result.split('').sort.join.squish)
60
72
  end
61
73
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-graphql
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta
4
+ version: 1.0.0.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Silva
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-23 00:00:00.000000000 Z
11
+ date: 2023-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '5.0'
19
+ version: '6.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '5.0'
26
+ version: '6.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: benchmark-ips
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -164,8 +164,8 @@ dependencies:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
166
  version: '1.4'
167
- description: A GraphQL server implementation for Rails applications that focus on
168
- performance and simpler integration with Rails DSL
167
+ description: A Fresh new GraphQL server for Rails applications, with a focus on natural
168
+ and Ruby-like DSL
169
169
  email:
170
170
  - me@carlosfsilva.com
171
171
  executables: []
@@ -180,10 +180,15 @@ files:
180
180
  - ext/extconf.h
181
181
  - ext/extconf.rb
182
182
  - ext/gql_parser.c
183
+ - ext/gql_parser.h
183
184
  - ext/shared.c
184
185
  - ext/shared.h
186
+ - lib/generators/graphql/channel_generator.rb
185
187
  - lib/generators/graphql/controller_generator.rb
188
+ - lib/generators/graphql/install_generator.rb
186
189
  - lib/generators/graphql/schema_generator.rb
190
+ - lib/generators/graphql/templates/channel.erb
191
+ - lib/generators/graphql/templates/config.rb
187
192
  - lib/generators/graphql/templates/controller.erb
188
193
  - lib/generators/graphql/templates/schema.erb
189
194
  - lib/gql_parser.so
@@ -210,6 +215,7 @@ files:
210
215
  - lib/rails/graphql/directive/deprecated_directive.rb
211
216
  - lib/rails/graphql/directive/include_directive.rb
212
217
  - lib/rails/graphql/directive/skip_directive.rb
218
+ - lib/rails/graphql/directive/specified_by_directive.rb
213
219
  - lib/rails/graphql/errors.rb
214
220
  - lib/rails/graphql/event.rb
215
221
  - lib/rails/graphql/field.rb
@@ -248,6 +254,11 @@ files:
248
254
  - lib/rails/graphql/helpers/with_validator.rb
249
255
  - lib/rails/graphql/introspection.rb
250
256
  - lib/rails/graphql/railtie.rb
257
+ - lib/rails/graphql/railties/app/base_channel.rb
258
+ - lib/rails/graphql/railties/app/base_controller.rb
259
+ - lib/rails/graphql/railties/app/views/_cable.js.erb
260
+ - lib/rails/graphql/railties/app/views/_fetch.js.erb
261
+ - lib/rails/graphql/railties/app/views/graphiql.html.erb
251
262
  - lib/rails/graphql/railties/base_generator.rb
252
263
  - lib/rails/graphql/railties/channel.rb
253
264
  - lib/rails/graphql/railties/controller.rb
@@ -297,6 +308,7 @@ files:
297
308
  - lib/rails/graphql/subscription/store/memory.rb
298
309
  - lib/rails/graphql/to_gql.rb
299
310
  - lib/rails/graphql/type.rb
311
+ - lib/rails/graphql/type/creator.rb
300
312
  - lib/rails/graphql/type/enum.rb
301
313
  - lib/rails/graphql/type/enum/directive_location_enum.rb
302
314
  - lib/rails/graphql/type/enum/type_kind_enum.rb
@@ -385,9 +397,10 @@ homepage: https://github.com/virtualshield/rails-graphql
385
397
  licenses:
386
398
  - MIT
387
399
  metadata:
388
- homepage_uri: https://www.rails-graphql.dev/
400
+ homepage_uri: https://rails-graphql.dev/
389
401
  source_code_uri: https://github.com/virtualshield/rails-graphql
390
402
  bug_tracker_uri: https://github.com/virtualshield/rails-graphql/issues
403
+ changelog_uri: https://github.com/virtualshield/rails-graphql/blob/master/CHANGELOG.md
391
404
  post_install_message:
392
405
  rdoc_options:
393
406
  - "--title"
@@ -405,10 +418,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
405
418
  - !ruby/object:Gem::Version
406
419
  version: 1.3.1
407
420
  requirements: []
408
- rubygems_version: 3.2.33
421
+ rubygems_version: 3.3.26
409
422
  signing_key:
410
423
  specification_version: 4
411
- summary: A GraphQL server for Rails applications
424
+ summary: GraphQL meets RoR with the most Ruby-like DSL
412
425
  test_files:
413
426
  - test/assets/en.yml
414
427
  - test/assets/introspection-db.json