diff --git a/lib/graphql-anycable.rb b/lib/graphql-anycable.rb index 9cd8b8c..c3896c5 100644 --- a/lib/graphql-anycable.rb +++ b/lib/graphql-anycable.rb @@ -11,6 +11,12 @@ module GraphQL module AnyCable def self.use(schema, **options) + if config.use_client_provided_uniq_id? + warn "[Deprecated] Using client provided channel uniq IDs could lead to unexpected behaviour, " \ + "please, set GraphQL::AnyCable.config.use_client_provided_uniq_id = false or GRAPHQL_ANYCABLE_USE_CLIENT_PROVIDED_UNIQ_ID=false, " \ + "and update the `#unsubscribed` callback code according to the latest docs." + end + schema.use GraphQL::Subscriptions::AnyCableSubscriptions, **options end diff --git a/lib/graphql/anycable/railtie.rb b/lib/graphql/anycable/railtie.rb index f454172..2b27333 100644 --- a/lib/graphql/anycable/railtie.rb +++ b/lib/graphql/anycable/railtie.rb @@ -9,14 +9,6 @@ class Railtie < ::Rails::Railtie path = File.expand_path(__dir__) Dir.glob("#{path}/tasks/**/*.rake").each { |f| load f } end - - config.after_initialize do - if GraphQL::AnyCable.config.use_client_provided_uniq_id? - warn "[Deprecated] Using client provided channel uniq IDs could lead to unexpected behaviour, " \ - "please, set GraphQL::AnyCable.config.use_client_provided_uniq_id = false or GRAPHQL_ANYCABLE_USE_CLIENT_PROVIDED_UNIQ_ID=false, " \ - "and update the `#unsubscribed` callback code according to the latest docs." - end - end end end end