@@ -63,10 +63,6 @@ module GraphQL
63
63
# Schemas can restrict large incoming queries with `max_depth` and `max_complexity` configurations.
64
64
# (These configurations can be overridden by specific calls to {Schema#execute})
65
65
#
66
- # Schemas can specify how queries should be executed against them.
67
- # `query_execution_strategy`, `mutation_execution_strategy` and `subscription_execution_strategy`
68
- # each apply to corresponding root types.
69
- #
70
66
# @example defining a schema
71
67
# class MySchema < GraphQL::Schema
72
68
# query QueryType
@@ -651,27 +647,39 @@ def default_page_size(new_default_page_size = nil)
651
647
end
652
648
end
653
649
654
- def query_execution_strategy ( new_query_execution_strategy = nil )
650
+ def query_execution_strategy ( new_query_execution_strategy = nil , deprecation_warning : true )
651
+ if deprecation_warning
652
+ warn "GraphQL::Schema.query_execution_strategy is deprecated without replacement. Use `GraphQL::Query.new` directly to create and execute a custom query instead."
653
+ warn " #{ caller ( 1 , 1 ) . first } "
654
+ end
655
655
if new_query_execution_strategy
656
656
@query_execution_strategy = new_query_execution_strategy
657
657
else
658
- @query_execution_strategy || find_inherited_value ( :query_execution_strategy , self . default_execution_strategy )
658
+ @query_execution_strategy || ( superclass . respond_to? ( :query_execution_strategy ) ? superclass . query_execution_strategy ( deprecation_warning : false ) : self . default_execution_strategy )
659
659
end
660
660
end
661
661
662
- def mutation_execution_strategy ( new_mutation_execution_strategy = nil )
662
+ def mutation_execution_strategy ( new_mutation_execution_strategy = nil , deprecation_warning : true )
663
+ if deprecation_warning
664
+ warn "GraphQL::Schema.mutation_execution_strategy is deprecated without replacement. Use `GraphQL::Query.new` directly to create and execute a custom query instead."
665
+ warn " #{ caller ( 1 , 1 ) . first } "
666
+ end
663
667
if new_mutation_execution_strategy
664
668
@mutation_execution_strategy = new_mutation_execution_strategy
665
669
else
666
- @mutation_execution_strategy || find_inherited_value ( :mutation_execution_strategy , self . default_execution_strategy )
670
+ @mutation_execution_strategy || ( superclass . respond_to? ( :mutation_execution_strategy ) ? superclass . mutation_execution_strategy ( deprecation_warning : false ) : self . default_execution_strategy )
667
671
end
668
672
end
669
673
670
- def subscription_execution_strategy ( new_subscription_execution_strategy = nil )
674
+ def subscription_execution_strategy ( new_subscription_execution_strategy = nil , deprecation_warning : true )
675
+ if deprecation_warning
676
+ warn "GraphQL::Schema.subscription_execution_strategy is deprecated without replacement. Use `GraphQL::Query.new` directly to create and execute a custom query instead."
677
+ warn " #{ caller ( 1 , 1 ) . first } "
678
+ end
671
679
if new_subscription_execution_strategy
672
680
@subscription_execution_strategy = new_subscription_execution_strategy
673
681
else
674
- @subscription_execution_strategy || find_inherited_value ( :subscription_execution_strategy , self . default_execution_strategy )
682
+ @subscription_execution_strategy || ( superclass . respond_to? ( :subscription_execution_strategy ) ? superclass . subscription_execution_strategy ( deprecation_warning : false ) : self . default_execution_strategy )
675
683
end
676
684
end
677
685
0 commit comments