graphql 2.4.6 → 2.4.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5cd45aa292bddd6fff0d06c9b040cf2f87cf81926a4f8c2e53febf3f434b6dac
4
- data.tar.gz: 0c736a7432142b948c893a2db5049d97a54660e102ea75c27bd3058680e764f0
3
+ metadata.gz: 69f8b4084adf0530a973073bcacf76e536975b385e4927525504b648762e496e
4
+ data.tar.gz: ef8e532575d445e0e96c1e5cccb2f6518d4a8759127ba8f27fd4d2aca4ef877a
5
5
  SHA512:
6
- metadata.gz: '07404039c9ca7c2c78867bba53fd3ed60d89ac48564e909e964bb7e7298e86e2406ccd70113a49b26dc6cfd1f48580e141d1bdc015eb2289718c973c2cc6db6c'
7
- data.tar.gz: 1826580e9cafcac3dbe46ddf6aeb3451847f390143a68e799633727fa05ad8b4e400b058279887b0ca62fb5b4bc7a4af66ce991a8377f2b3a4ffdda34edbfea6
6
+ metadata.gz: c9522e680f06a1810e019c64656fba5dd7d7d95e098f136e2f656837c928829eab7a1be5656c7c4c9fd68bf8f262ca9b7ed415d87c12997dc613c9f600e8994b
7
+ data.tar.gz: 99a5a17272d80d555c98f8f091799e5b84656bfd42310e79d64b65140c7b2786e9f23f4759dfefb5b09c8ffc913349bfd0db3bcff5f6475087b350122aadd066
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GraphQL
4
+ # @see GraphQL::Railtie for automatic Rails integration
4
5
  module Autoload
5
6
  # Register a constant named `const_name` to be loaded from `path`.
6
7
  # This is like `Kernel#autoload` but it tracks the constants so they can be eager-loaded with {#eager_load!}
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GraphQL
4
- # Support {GraphQL::Parser::Cache}
4
+ # Support {GraphQL::Parser::Cache} and {GraphQL.eager_load!}
5
5
  #
6
6
  # @example Enable the parser cache with default directory
7
7
  #
@@ -10,9 +10,7 @@ module GraphQL
10
10
  class Railtie < Rails::Railtie
11
11
  config.graphql = ActiveSupport::OrderedOptions.new
12
12
  config.graphql.parser_cache = false
13
- config.before_eager_load do
14
- GraphQL.eager_load!
15
- end
13
+ config.eager_load_namespaces << GraphQL
16
14
 
17
15
  initializer("graphql.cache") do |app|
18
16
  if config.graphql.parser_cache
@@ -47,8 +47,6 @@ require "graphql/schema/relay_classic_mutation"
47
47
  require "graphql/schema/subscription"
48
48
  require "graphql/schema/visibility"
49
49
 
50
- GraphQL.ensure_eager_load!
51
-
52
50
  module GraphQL
53
51
  # A GraphQL schema which may be queried with {GraphQL::Query}.
54
52
  #
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
  require "set"
3
+ require "ostruct"
4
+
3
5
  module GraphQL
4
6
  class Subscriptions
5
7
  # Serialization helpers for passing subscription data around.
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module GraphQL
3
- VERSION = "2.4.6"
3
+ VERSION = "2.4.7"
4
4
  end
data/lib/graphql.rb CHANGED
@@ -82,35 +82,6 @@ This is probably a bug in GraphQL-Ruby, please report this error on GitHub: http
82
82
  class << self
83
83
  # If true, the parser should raise when an integer or float is followed immediately by an identifier (instead of a space or punctuation)
84
84
  attr_accessor :reject_numbers_followed_by_names
85
-
86
- # If `production?` is detected but `eager_load!` wasn't called, emit a warning.
87
- # @return [void]
88
- def ensure_eager_load!
89
- if production? && !eager_loading?
90
- warn <<~WARNING
91
- GraphQL-Ruby thinks this is a production deployment but didn't eager-load its constants. Address this by:
92
-
93
- - Calling `GraphQL.eager_load!` in a production-only initializer or setup hook
94
- - Assign `GraphQL.env = "..."` to something _other_ than `"production"` (for example, `GraphQL.env = "development"`)
95
-
96
- More details: https://graphql-ruby.org/schema/definition#production-considerations
97
- WARNING
98
- end
99
- end
100
-
101
- attr_accessor :env
102
-
103
- private
104
-
105
- # Detect whether this is a production deployment or not
106
- def production?
107
- if env
108
- # Manually assigned to production?
109
- env == "production"
110
- else
111
- (detected_env = ENV["RACK_ENV"] || ENV["RAILS_ENV"] || ENV["HANAMI_ENV"] || ENV["APP_ENV"]) && detected_env.to_s.downcase == "production"
112
- end
113
- end
114
85
  end
115
86
 
116
87
  self.reject_numbers_followed_by_names = false
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: 2.4.6
4
+ version: 2.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Mosolgo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-05 00:00:00.000000000 Z
11
+ date: 2024-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64