graphql 1.11.4 → 1.12.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (160) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generators/graphql/install_generator.rb +5 -5
  3. data/lib/generators/graphql/object_generator.rb +2 -0
  4. data/lib/generators/graphql/relay_generator.rb +63 -0
  5. data/lib/generators/graphql/templates/base_connection.erb +8 -0
  6. data/lib/generators/graphql/templates/base_edge.erb +8 -0
  7. data/lib/generators/graphql/templates/node_type.erb +9 -0
  8. data/lib/generators/graphql/templates/object.erb +1 -1
  9. data/lib/generators/graphql/templates/query_type.erb +1 -3
  10. data/lib/generators/graphql/templates/schema.erb +8 -35
  11. data/lib/generators/graphql/templates/union.erb +1 -1
  12. data/lib/graphql.rb +55 -4
  13. data/lib/graphql/analysis/analyze_query.rb +7 -0
  14. data/lib/graphql/analysis/ast.rb +11 -2
  15. data/lib/graphql/analysis/ast/visitor.rb +9 -1
  16. data/lib/graphql/argument.rb +3 -3
  17. data/lib/graphql/backtrace.rb +28 -19
  18. data/lib/graphql/backtrace/legacy_tracer.rb +56 -0
  19. data/lib/graphql/backtrace/table.rb +22 -2
  20. data/lib/graphql/backtrace/tracer.rb +40 -8
  21. data/lib/graphql/backwards_compatibility.rb +1 -0
  22. data/lib/graphql/compatibility/execution_specification.rb +1 -0
  23. data/lib/graphql/compatibility/lazy_execution_specification.rb +2 -0
  24. data/lib/graphql/compatibility/query_parser_specification.rb +2 -0
  25. data/lib/graphql/compatibility/schema_parser_specification.rb +2 -0
  26. data/lib/graphql/dataloader.rb +198 -0
  27. data/lib/graphql/dataloader/null_dataloader.rb +21 -0
  28. data/lib/graphql/dataloader/request.rb +24 -0
  29. data/lib/graphql/dataloader/request_all.rb +22 -0
  30. data/lib/graphql/dataloader/source.rb +93 -0
  31. data/lib/graphql/define/assign_global_id_field.rb +2 -2
  32. data/lib/graphql/define/instance_definable.rb +32 -2
  33. data/lib/graphql/define/type_definer.rb +5 -5
  34. data/lib/graphql/deprecated_dsl.rb +5 -0
  35. data/lib/graphql/enum_type.rb +2 -0
  36. data/lib/graphql/execution/errors.rb +4 -0
  37. data/lib/graphql/execution/execute.rb +7 -0
  38. data/lib/graphql/execution/interpreter.rb +20 -6
  39. data/lib/graphql/execution/interpreter/arguments.rb +57 -5
  40. data/lib/graphql/execution/interpreter/arguments_cache.rb +8 -0
  41. data/lib/graphql/execution/interpreter/handles_raw_value.rb +0 -7
  42. data/lib/graphql/execution/interpreter/runtime.rb +236 -120
  43. data/lib/graphql/execution/multiplex.rb +20 -6
  44. data/lib/graphql/function.rb +4 -0
  45. data/lib/graphql/input_object_type.rb +2 -0
  46. data/lib/graphql/integer_decoding_error.rb +17 -0
  47. data/lib/graphql/interface_type.rb +3 -1
  48. data/lib/graphql/introspection.rb +96 -0
  49. data/lib/graphql/introspection/field_type.rb +7 -3
  50. data/lib/graphql/introspection/input_value_type.rb +6 -0
  51. data/lib/graphql/introspection/introspection_query.rb +6 -92
  52. data/lib/graphql/introspection/type_type.rb +7 -3
  53. data/lib/graphql/invalid_null_error.rb +1 -1
  54. data/lib/graphql/language/block_string.rb +24 -5
  55. data/lib/graphql/language/document_from_schema_definition.rb +50 -23
  56. data/lib/graphql/language/lexer.rb +7 -3
  57. data/lib/graphql/language/lexer.rl +7 -3
  58. data/lib/graphql/language/nodes.rb +1 -1
  59. data/lib/graphql/language/parser.rb +107 -103
  60. data/lib/graphql/language/parser.y +4 -0
  61. data/lib/graphql/language/sanitized_printer.rb +59 -26
  62. data/lib/graphql/name_validator.rb +6 -7
  63. data/lib/graphql/object_type.rb +2 -0
  64. data/lib/graphql/pagination/connection.rb +5 -1
  65. data/lib/graphql/pagination/connections.rb +15 -17
  66. data/lib/graphql/query.rb +8 -3
  67. data/lib/graphql/query/context.rb +18 -3
  68. data/lib/graphql/query/serial_execution.rb +1 -0
  69. data/lib/graphql/query/validation_pipeline.rb +1 -1
  70. data/lib/graphql/relay/array_connection.rb +2 -2
  71. data/lib/graphql/relay/base_connection.rb +7 -0
  72. data/lib/graphql/relay/connection_instrumentation.rb +4 -4
  73. data/lib/graphql/relay/connection_type.rb +1 -1
  74. data/lib/graphql/relay/mutation.rb +1 -0
  75. data/lib/graphql/relay/node.rb +3 -0
  76. data/lib/graphql/relay/range_add.rb +14 -5
  77. data/lib/graphql/relay/type_extensions.rb +2 -0
  78. data/lib/graphql/scalar_type.rb +2 -0
  79. data/lib/graphql/schema.rb +104 -39
  80. data/lib/graphql/schema/argument.rb +74 -5
  81. data/lib/graphql/schema/build_from_definition.rb +203 -86
  82. data/lib/graphql/schema/default_type_error.rb +2 -0
  83. data/lib/graphql/schema/directive.rb +76 -0
  84. data/lib/graphql/schema/directive/deprecated.rb +1 -1
  85. data/lib/graphql/schema/directive/flagged.rb +57 -0
  86. data/lib/graphql/schema/enum.rb +3 -0
  87. data/lib/graphql/schema/enum_value.rb +12 -6
  88. data/lib/graphql/schema/field.rb +59 -24
  89. data/lib/graphql/schema/field/connection_extension.rb +10 -8
  90. data/lib/graphql/schema/field/scope_extension.rb +1 -1
  91. data/lib/graphql/schema/input_object.rb +38 -25
  92. data/lib/graphql/schema/interface.rb +2 -1
  93. data/lib/graphql/schema/late_bound_type.rb +2 -2
  94. data/lib/graphql/schema/loader.rb +1 -0
  95. data/lib/graphql/schema/member.rb +4 -0
  96. data/lib/graphql/schema/member/base_dsl_methods.rb +1 -0
  97. data/lib/graphql/schema/member/build_type.rb +17 -7
  98. data/lib/graphql/schema/member/has_arguments.rb +70 -51
  99. data/lib/graphql/schema/member/has_deprecation_reason.rb +25 -0
  100. data/lib/graphql/schema/member/has_directives.rb +98 -0
  101. data/lib/graphql/schema/member/has_fields.rb +2 -2
  102. data/lib/graphql/schema/member/has_validators.rb +31 -0
  103. data/lib/graphql/schema/member/type_system_helpers.rb +3 -3
  104. data/lib/graphql/schema/object.rb +11 -0
  105. data/lib/graphql/schema/printer.rb +5 -4
  106. data/lib/graphql/schema/relay_classic_mutation.rb +4 -2
  107. data/lib/graphql/schema/resolver.rb +7 -0
  108. data/lib/graphql/schema/resolver/has_payload_type.rb +2 -0
  109. data/lib/graphql/schema/subscription.rb +19 -1
  110. data/lib/graphql/schema/timeout.rb +29 -15
  111. data/lib/graphql/schema/timeout_middleware.rb +2 -0
  112. data/lib/graphql/schema/unique_within_type.rb +1 -2
  113. data/lib/graphql/schema/validation.rb +10 -0
  114. data/lib/graphql/schema/validator.rb +163 -0
  115. data/lib/graphql/schema/validator/exclusion_validator.rb +31 -0
  116. data/lib/graphql/schema/validator/format_validator.rb +49 -0
  117. data/lib/graphql/schema/validator/inclusion_validator.rb +33 -0
  118. data/lib/graphql/schema/validator/length_validator.rb +57 -0
  119. data/lib/graphql/schema/validator/numericality_validator.rb +71 -0
  120. data/lib/graphql/schema/validator/required_validator.rb +68 -0
  121. data/lib/graphql/static_validation.rb +1 -0
  122. data/lib/graphql/static_validation/all_rules.rb +1 -0
  123. data/lib/graphql/static_validation/rules/fields_will_merge.rb +25 -17
  124. data/lib/graphql/static_validation/rules/input_object_names_are_unique.rb +30 -0
  125. data/lib/graphql/static_validation/rules/input_object_names_are_unique_error.rb +30 -0
  126. data/lib/graphql/static_validation/validation_timeout_error.rb +25 -0
  127. data/lib/graphql/static_validation/validator.rb +33 -7
  128. data/lib/graphql/subscriptions.rb +18 -23
  129. data/lib/graphql/subscriptions/action_cable_subscriptions.rb +21 -7
  130. data/lib/graphql/tracing.rb +2 -2
  131. data/lib/graphql/tracing/appoptics_tracing.rb +3 -1
  132. data/lib/graphql/tracing/platform_tracing.rb +4 -2
  133. data/lib/graphql/tracing/prometheus_tracing/graphql_collector.rb +4 -1
  134. data/lib/graphql/tracing/skylight_tracing.rb +1 -1
  135. data/lib/graphql/types/int.rb +9 -2
  136. data/lib/graphql/types/relay.rb +11 -3
  137. data/lib/graphql/types/relay/base_connection.rb +2 -91
  138. data/lib/graphql/types/relay/base_edge.rb +2 -34
  139. data/lib/graphql/types/relay/connection_behaviors.rb +123 -0
  140. data/lib/graphql/types/relay/default_relay.rb +27 -0
  141. data/lib/graphql/types/relay/edge_behaviors.rb +42 -0
  142. data/lib/graphql/types/relay/has_node_field.rb +41 -0
  143. data/lib/graphql/types/relay/has_nodes_field.rb +41 -0
  144. data/lib/graphql/types/relay/node.rb +2 -4
  145. data/lib/graphql/types/relay/node_behaviors.rb +15 -0
  146. data/lib/graphql/types/relay/node_field.rb +1 -19
  147. data/lib/graphql/types/relay/nodes_field.rb +1 -19
  148. data/lib/graphql/types/relay/page_info.rb +2 -14
  149. data/lib/graphql/types/relay/page_info_behaviors.rb +25 -0
  150. data/lib/graphql/types/string.rb +7 -1
  151. data/lib/graphql/unauthorized_error.rb +1 -1
  152. data/lib/graphql/union_type.rb +2 -0
  153. data/lib/graphql/upgrader/member.rb +1 -0
  154. data/lib/graphql/upgrader/schema.rb +1 -0
  155. data/lib/graphql/version.rb +1 -1
  156. data/readme.md +1 -1
  157. metadata +49 -6
  158. data/lib/graphql/types/relay/base_field.rb +0 -22
  159. data/lib/graphql/types/relay/base_interface.rb +0 -29
  160. data/lib/graphql/types/relay/base_object.rb +0 -26
@@ -7,7 +7,13 @@ module GraphQL
7
7
 
8
8
  def self.coerce_result(value, ctx)
9
9
  str = value.to_s
10
- str.encoding == Encoding::UTF_8 ? str : str.encode(Encoding::UTF_8)
10
+ if str.encoding == Encoding::UTF_8
11
+ str
12
+ elsif str.frozen?
13
+ str.encode(Encoding::UTF_8)
14
+ else
15
+ str.encode!(Encoding::UTF_8)
16
+ end
11
17
  rescue EncodingError
12
18
  err = GraphQL::StringEncodingError.new(str)
13
19
  ctx.schema.type_error(err, ctx)
@@ -22,7 +22,7 @@ module GraphQL
22
22
  @object = object
23
23
  @type = type
24
24
  @context = context
25
- message ||= "An instance of #{object.class} failed #{type.name}'s authorization check"
25
+ message ||= "An instance of #{object.class} failed #{type.graphql_name}'s authorization check"
26
26
  super(message)
27
27
  end
28
28
  end
@@ -2,6 +2,8 @@
2
2
  module GraphQL
3
3
  # @api deprecated
4
4
  class UnionType < GraphQL::BaseType
5
+ extend Define::InstanceDefinable::DeprecatedDefine
6
+
5
7
  # Rubocop was unhappy about the syntax when this was a proc literal
6
8
  class AcceptPossibleTypesDefinition
7
9
  def self.call(target, possible_types, options = {})
@@ -771,6 +771,7 @@ module GraphQL
771
771
 
772
772
  class Member
773
773
  def initialize(member, skip: SkipOnNullKeyword, type_transforms: DEFAULT_TYPE_TRANSFORMS, field_transforms: DEFAULT_FIELD_TRANSFORMS, clean_up_transforms: DEFAULT_CLEAN_UP_TRANSFORMS)
774
+ warn "#{self.class} will be removed from GraphQL-Ruby 2.0 (but there's no point in using it after you've transformed your code, anyways)"
774
775
  @member = member
775
776
  @skip = skip
776
777
  @type_transforms = type_transforms
@@ -4,6 +4,7 @@ module GraphQL
4
4
  module Upgrader
5
5
  class Schema
6
6
  def initialize(schema)
7
+ warn "#{self.class} will be removed from GraphQL-Ruby 2.0 (but there's no point in using it after you've transformed your code, anyways)"
7
8
  @schema = schema
8
9
  end
9
10
 
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module GraphQL
3
- VERSION = "1.11.4"
3
+ VERSION = "1.12.1"
4
4
  end
data/readme.md CHANGED
@@ -9,7 +9,7 @@
9
9
  A Ruby implementation of [GraphQL](https://graphql.org/).
10
10
 
11
11
  - [Website](https://graphql-ruby.org/)
12
- - [API Documentation](https://www.rubydoc.info/gems/graphql)
12
+ - [API Documentation](https://www.rubydoc.info/github/rmosolgo/graphql-ruby)
13
13
  - [Newsletter](https://tinyletter.com/graphql-ruby)
14
14
 
15
15
  ## Installation
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.4
4
+ version: 1.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Mosolgo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-25 00:00:00.000000000 Z
11
+ date: 2021-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: benchmark-ips
@@ -318,6 +318,20 @@ dependencies:
318
318
  - - "~>"
319
319
  - !ruby/object:Gem::Version
320
320
  version: 1.5.0
321
+ - !ruby/object:Gem::Dependency
322
+ name: webrick
323
+ requirement: !ruby/object:Gem::Requirement
324
+ requirements:
325
+ - - ">="
326
+ - !ruby/object:Gem::Version
327
+ version: '0'
328
+ type: :development
329
+ prerelease: false
330
+ version_requirements: !ruby/object:Gem::Requirement
331
+ requirements:
332
+ - - ">="
333
+ - !ruby/object:Gem::Version
334
+ version: '0'
321
335
  description: A plain-Ruby implementation of GraphQL.
322
336
  email:
323
337
  - rdmosolgo@gmail.com
@@ -334,8 +348,11 @@ files:
334
348
  - lib/generators/graphql/loader_generator.rb
335
349
  - lib/generators/graphql/mutation_generator.rb
336
350
  - lib/generators/graphql/object_generator.rb
351
+ - lib/generators/graphql/relay_generator.rb
337
352
  - lib/generators/graphql/scalar_generator.rb
338
353
  - lib/generators/graphql/templates/base_argument.erb
354
+ - lib/generators/graphql/templates/base_connection.erb
355
+ - lib/generators/graphql/templates/base_edge.erb
339
356
  - lib/generators/graphql/templates/base_enum.erb
340
357
  - lib/generators/graphql/templates/base_field.erb
341
358
  - lib/generators/graphql/templates/base_input_object.erb
@@ -350,6 +367,7 @@ files:
350
367
  - lib/generators/graphql/templates/loader.erb
351
368
  - lib/generators/graphql/templates/mutation.erb
352
369
  - lib/generators/graphql/templates/mutation_type.erb
370
+ - lib/generators/graphql/templates/node_type.erb
353
371
  - lib/generators/graphql/templates/object.erb
354
372
  - lib/generators/graphql/templates/query_type.erb
355
373
  - lib/generators/graphql/templates/scalar.erb
@@ -379,6 +397,7 @@ files:
379
397
  - lib/graphql/authorization.rb
380
398
  - lib/graphql/backtrace.rb
381
399
  - lib/graphql/backtrace/inspect_result.rb
400
+ - lib/graphql/backtrace/legacy_tracer.rb
382
401
  - lib/graphql/backtrace/table.rb
383
402
  - lib/graphql/backtrace/traced_error.rb
384
403
  - lib/graphql/backtrace/tracer.rb
@@ -396,6 +415,11 @@ files:
396
415
  - lib/graphql/compatibility/query_parser_specification/parse_error_specification.rb
397
416
  - lib/graphql/compatibility/query_parser_specification/query_assertions.rb
398
417
  - lib/graphql/compatibility/schema_parser_specification.rb
418
+ - lib/graphql/dataloader.rb
419
+ - lib/graphql/dataloader/null_dataloader.rb
420
+ - lib/graphql/dataloader/request.rb
421
+ - lib/graphql/dataloader/request_all.rb
422
+ - lib/graphql/dataloader/source.rb
399
423
  - lib/graphql/define.rb
400
424
  - lib/graphql/define/assign_argument.rb
401
425
  - lib/graphql/define/assign_connection.rb
@@ -445,6 +469,7 @@ files:
445
469
  - lib/graphql/id_type.rb
446
470
  - lib/graphql/input_object_type.rb
447
471
  - lib/graphql/int_type.rb
472
+ - lib/graphql/integer_decoding_error.rb
448
473
  - lib/graphql/integer_encoding_error.rb
449
474
  - lib/graphql/interface_type.rb
450
475
  - lib/graphql/internal_representation.rb
@@ -554,6 +579,7 @@ files:
554
579
  - lib/graphql/schema/directive.rb
555
580
  - lib/graphql/schema/directive/deprecated.rb
556
581
  - lib/graphql/schema/directive/feature.rb
582
+ - lib/graphql/schema/directive/flagged.rb
557
583
  - lib/graphql/schema/directive/include.rb
558
584
  - lib/graphql/schema/directive/skip.rb
559
585
  - lib/graphql/schema/directive/transform.rb
@@ -580,9 +606,12 @@ files:
580
606
  - lib/graphql/schema/member/graphql_type_names.rb
581
607
  - lib/graphql/schema/member/has_arguments.rb
582
608
  - lib/graphql/schema/member/has_ast_node.rb
609
+ - lib/graphql/schema/member/has_deprecation_reason.rb
610
+ - lib/graphql/schema/member/has_directives.rb
583
611
  - lib/graphql/schema/member/has_fields.rb
584
612
  - lib/graphql/schema/member/has_path.rb
585
613
  - lib/graphql/schema/member/has_unresolved_type_error.rb
614
+ - lib/graphql/schema/member/has_validators.rb
586
615
  - lib/graphql/schema/member/instrumentation.rb
587
616
  - lib/graphql/schema/member/relay_shortcuts.rb
588
617
  - lib/graphql/schema/member/scoped.rb
@@ -609,6 +638,13 @@ files:
609
638
  - lib/graphql/schema/union.rb
610
639
  - lib/graphql/schema/unique_within_type.rb
611
640
  - lib/graphql/schema/validation.rb
641
+ - lib/graphql/schema/validator.rb
642
+ - lib/graphql/schema/validator/exclusion_validator.rb
643
+ - lib/graphql/schema/validator/format_validator.rb
644
+ - lib/graphql/schema/validator/inclusion_validator.rb
645
+ - lib/graphql/schema/validator/length_validator.rb
646
+ - lib/graphql/schema/validator/numericality_validator.rb
647
+ - lib/graphql/schema/validator/required_validator.rb
612
648
  - lib/graphql/schema/warden.rb
613
649
  - lib/graphql/schema/wrapper.rb
614
650
  - lib/graphql/static_validation.rb
@@ -650,6 +686,8 @@ files:
650
686
  - lib/graphql/static_validation/rules/fragments_are_on_composite_types_error.rb
651
687
  - lib/graphql/static_validation/rules/fragments_are_used.rb
652
688
  - lib/graphql/static_validation/rules/fragments_are_used_error.rb
689
+ - lib/graphql/static_validation/rules/input_object_names_are_unique.rb
690
+ - lib/graphql/static_validation/rules/input_object_names_are_unique_error.rb
653
691
  - lib/graphql/static_validation/rules/mutation_root_exists.rb
654
692
  - lib/graphql/static_validation/rules/mutation_root_exists_error.rb
655
693
  - lib/graphql/static_validation/rules/no_definitions_are_present.rb
@@ -676,6 +714,7 @@ files:
676
714
  - lib/graphql/static_validation/rules/variables_are_used_and_defined_error.rb
677
715
  - lib/graphql/static_validation/type_stack.rb
678
716
  - lib/graphql/static_validation/validation_context.rb
717
+ - lib/graphql/static_validation/validation_timeout_error.rb
679
718
  - lib/graphql/static_validation/validator.rb
680
719
  - lib/graphql/string_encoding_error.rb
681
720
  - lib/graphql/string_type.rb
@@ -712,13 +751,17 @@ files:
712
751
  - lib/graphql/types/relay.rb
713
752
  - lib/graphql/types/relay/base_connection.rb
714
753
  - lib/graphql/types/relay/base_edge.rb
715
- - lib/graphql/types/relay/base_field.rb
716
- - lib/graphql/types/relay/base_interface.rb
717
- - lib/graphql/types/relay/base_object.rb
754
+ - lib/graphql/types/relay/connection_behaviors.rb
755
+ - lib/graphql/types/relay/default_relay.rb
756
+ - lib/graphql/types/relay/edge_behaviors.rb
757
+ - lib/graphql/types/relay/has_node_field.rb
758
+ - lib/graphql/types/relay/has_nodes_field.rb
718
759
  - lib/graphql/types/relay/node.rb
760
+ - lib/graphql/types/relay/node_behaviors.rb
719
761
  - lib/graphql/types/relay/node_field.rb
720
762
  - lib/graphql/types/relay/nodes_field.rb
721
763
  - lib/graphql/types/relay/page_info.rb
764
+ - lib/graphql/types/relay/page_info_behaviors.rb
722
765
  - lib/graphql/types/string.rb
723
766
  - lib/graphql/unauthorized_error.rb
724
767
  - lib/graphql/unauthorized_field_error.rb
@@ -752,7 +795,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
752
795
  - !ruby/object:Gem::Version
753
796
  version: '0'
754
797
  requirements: []
755
- rubygems_version: 3.1.2
798
+ rubygems_version: 3.0.3
756
799
  signing_key:
757
800
  specification_version: 4
758
801
  summary: A GraphQL language and runtime for Ruby
@@ -1,22 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module GraphQL
4
- module Types
5
- module Relay
6
- class BaseField < GraphQL::Schema::Field
7
- def initialize(edge_class: nil, **rest, &block)
8
- @edge_class = edge_class
9
- super(**rest, &block)
10
- end
11
-
12
- def to_graphql
13
- field = super
14
- if @edge_class
15
- field.edge_class = @edge_class
16
- end
17
- field
18
- end
19
- end
20
- end
21
- end
22
- end
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module GraphQL
4
- module Types
5
- module Relay
6
- module BaseInterface
7
- include GraphQL::Schema::Interface
8
-
9
- field_class(Types::Relay::BaseField)
10
-
11
- definition_methods do
12
- def default_relay(new_value)
13
- @default_relay = new_value
14
- end
15
-
16
- def default_relay?
17
- !!@default_relay
18
- end
19
-
20
- def to_graphql
21
- type_defn = super
22
- type_defn.default_relay = default_relay?
23
- type_defn
24
- end
25
- end
26
- end
27
- end
28
- end
29
- end
@@ -1,26 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module GraphQL
4
- module Types
5
- module Relay
6
- class BaseObject < GraphQL::Schema::Object
7
- field_class(Types::Relay::BaseField)
8
- class << self
9
- def default_relay(new_value)
10
- @default_relay = new_value
11
- end
12
-
13
- def default_relay?
14
- !!@default_relay
15
- end
16
-
17
- def to_graphql
18
- type_defn = super
19
- type_defn.default_relay = default_relay?
20
- type_defn
21
- end
22
- end
23
- end
24
- end
25
- end
26
- end