graphql 1.9.7 → 1.9.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generators/graphql/install_generator.rb +2 -1
- data/lib/generators/graphql/templates/base_argument.erb +4 -0
- data/lib/generators/graphql/templates/base_field.erb +2 -0
- data/lib/generators/graphql/templates/base_input_object.erb +1 -0
- data/lib/graphql/analysis/ast/query_complexity.rb +34 -18
- data/lib/graphql/argument.rb +8 -2
- data/lib/graphql/compatibility/lazy_execution_specification/lazy_schema.rb +1 -1
- data/lib/graphql/language/lexer.rb +24 -13
- data/lib/graphql/language/lexer.rl +23 -13
- data/lib/graphql/query/arguments.rb +16 -15
- data/lib/graphql/schema.rb +105 -48
- data/lib/graphql/schema/argument.rb +12 -1
- data/lib/graphql/schema/build_from_definition.rb +3 -0
- data/lib/graphql/schema/field.rb +3 -8
- data/lib/graphql/schema/find_inherited_value.rb +20 -0
- data/lib/graphql/schema/input_object.rb +1 -3
- data/lib/graphql/schema/loader.rb +1 -0
- data/lib/graphql/schema/member/base_dsl_methods.rb +7 -18
- data/lib/graphql/schema/member/has_arguments.rb +4 -9
- data/lib/graphql/schema/member/has_fields.rb +14 -0
- data/lib/graphql/schema/member/relay_shortcuts.rb +2 -2
- data/lib/graphql/schema/resolver.rb +31 -8
- data/lib/graphql/schema/resolver/has_payload_type.rb +3 -2
- data/lib/graphql/schema/subscription.rb +1 -1
- data/lib/graphql/static_validation/rules/required_arguments_are_present.rb +1 -1
- data/lib/graphql/version.rb +1 -1
- data/spec/graphql/analysis/analyze_query_spec.rb +14 -25
- data/spec/graphql/analysis/ast/max_query_complexity_spec.rb +7 -19
- data/spec/graphql/analysis/ast/max_query_depth_spec.rb +5 -12
- data/spec/graphql/analysis/max_query_complexity_spec.rb +12 -20
- data/spec/graphql/analysis/max_query_depth_spec.rb +6 -13
- data/spec/graphql/language/lexer_spec.rb +19 -1
- data/spec/graphql/schema/argument_spec.rb +1 -1
- data/spec/graphql/schema/build_from_definition_spec.rb +10 -0
- data/spec/graphql/schema/catchall_middleware_spec.rb +6 -9
- data/spec/graphql/schema/input_object_spec.rb +25 -0
- data/spec/graphql/schema/loader_spec.rb +65 -1
- data/spec/graphql/schema/object_spec.rb +21 -0
- data/spec/graphql/schema/resolver_spec.rb +30 -1
- data/spec/graphql/schema_spec.rb +135 -0
- data/spec/graphql/static_validation/rules/required_arguments_are_present_spec.rb +25 -0
- data/spec/integration/rails/generators/graphql/install_generator_spec.rb +20 -0
- data/spec/integration/tmp/app/graphql/types/page_type.rb +5 -0
- data/spec/support/dummy/schema.rb +1 -1
- data/spec/support/lazy_helpers.rb +1 -1
- data/spec/support/parser/filename_example_invalid_utf8.graphql +1 -0
- metadata +10 -132
- data/spec/integration/tmp/app/graphql/types/date_type.rb +0 -14
- data/spec/integration/tmp/dummy/Gemfile +0 -50
- data/spec/integration/tmp/dummy/README.md +0 -24
- data/spec/integration/tmp/dummy/Rakefile +0 -6
- data/spec/integration/tmp/dummy/app/assets/config/manifest.js +0 -3
- data/spec/integration/tmp/dummy/app/assets/javascripts/application.js +0 -16
- data/spec/integration/tmp/dummy/app/assets/javascripts/cable.js +0 -13
- data/spec/integration/tmp/dummy/app/assets/stylesheets/application.css +0 -15
- data/spec/integration/tmp/dummy/app/channels/application_cable/channel.rb +0 -5
- data/spec/integration/tmp/dummy/app/channels/application_cable/connection.rb +0 -5
- data/spec/integration/tmp/dummy/app/controllers/application_controller.rb +0 -4
- data/spec/integration/tmp/dummy/app/controllers/graphql_controller.rb +0 -44
- data/spec/integration/tmp/dummy/app/helpers/application_helper.rb +0 -3
- data/spec/integration/tmp/dummy/app/jobs/application_job.rb +0 -3
- data/spec/integration/tmp/dummy/app/mailers/application_mailer.rb +0 -5
- data/spec/integration/tmp/dummy/app/mydirectory/dummy_schema.rb +0 -5
- data/spec/integration/tmp/dummy/app/mydirectory/mutations/update_name.rb +0 -15
- data/spec/integration/tmp/dummy/app/mydirectory/types/base_enum.rb +0 -5
- data/spec/integration/tmp/dummy/app/mydirectory/types/base_input_object.rb +0 -5
- data/spec/integration/tmp/dummy/app/mydirectory/types/base_interface.rb +0 -6
- data/spec/integration/tmp/dummy/app/mydirectory/types/base_object.rb +0 -5
- data/spec/integration/tmp/dummy/app/mydirectory/types/base_scalar.rb +0 -5
- data/spec/integration/tmp/dummy/app/mydirectory/types/base_union.rb +0 -5
- data/spec/integration/tmp/dummy/app/mydirectory/types/mutation_type.rb +0 -12
- data/spec/integration/tmp/dummy/app/mydirectory/types/query_type.rb +0 -14
- data/spec/integration/tmp/dummy/app/views/layouts/application.html.erb +0 -14
- data/spec/integration/tmp/dummy/app/views/layouts/mailer.html.erb +0 -13
- data/spec/integration/tmp/dummy/app/views/layouts/mailer.text.erb +0 -1
- data/spec/integration/tmp/dummy/bin/bundle +0 -3
- data/spec/integration/tmp/dummy/bin/rails +0 -4
- data/spec/integration/tmp/dummy/bin/rake +0 -4
- data/spec/integration/tmp/dummy/bin/setup +0 -34
- data/spec/integration/tmp/dummy/bin/update +0 -29
- data/spec/integration/tmp/dummy/config.ru +0 -5
- data/spec/integration/tmp/dummy/config/application.rb +0 -26
- data/spec/integration/tmp/dummy/config/boot.rb +0 -4
- data/spec/integration/tmp/dummy/config/cable.yml +0 -9
- data/spec/integration/tmp/dummy/config/environment.rb +0 -6
- data/spec/integration/tmp/dummy/config/environments/development.rb +0 -52
- data/spec/integration/tmp/dummy/config/environments/production.rb +0 -84
- data/spec/integration/tmp/dummy/config/environments/test.rb +0 -43
- data/spec/integration/tmp/dummy/config/initializers/application_controller_renderer.rb +0 -9
- data/spec/integration/tmp/dummy/config/initializers/assets.rb +0 -12
- data/spec/integration/tmp/dummy/config/initializers/backtrace_silencers.rb +0 -8
- data/spec/integration/tmp/dummy/config/initializers/cookies_serializer.rb +0 -6
- data/spec/integration/tmp/dummy/config/initializers/filter_parameter_logging.rb +0 -5
- data/spec/integration/tmp/dummy/config/initializers/inflections.rb +0 -17
- data/spec/integration/tmp/dummy/config/initializers/mime_types.rb +0 -5
- data/spec/integration/tmp/dummy/config/initializers/new_framework_defaults.rb +0 -24
- data/spec/integration/tmp/dummy/config/initializers/session_store.rb +0 -4
- data/spec/integration/tmp/dummy/config/initializers/wrap_parameters.rb +0 -10
- data/spec/integration/tmp/dummy/config/locales/en.yml +0 -23
- data/spec/integration/tmp/dummy/config/puma.rb +0 -48
- data/spec/integration/tmp/dummy/config/routes.rb +0 -9
- data/spec/integration/tmp/dummy/config/secrets.yml +0 -22
- data/spec/integration/tmp/dummy/db/seeds.rb +0 -8
- data/spec/integration/tmp/dummy/log/test.log +0 -0
- data/spec/integration/tmp/dummy/public/404.html +0 -67
- data/spec/integration/tmp/dummy/public/422.html +0 -67
- data/spec/integration/tmp/dummy/public/500.html +0 -66
- data/spec/integration/tmp/dummy/public/apple-touch-icon-precomposed.png +0 -0
- data/spec/integration/tmp/dummy/public/apple-touch-icon.png +0 -0
- data/spec/integration/tmp/dummy/public/favicon.ico +0 -0
- data/spec/integration/tmp/dummy/public/robots.txt +0 -5
- data/spec/integration/tmp/dummy/test/test_helper.rb +0 -8
@@ -1,26 +0,0 @@
|
|
1
|
-
# typed: false
|
2
|
-
require_relative 'boot'
|
3
|
-
|
4
|
-
require "rails"
|
5
|
-
# Pick the frameworks you want:
|
6
|
-
require "active_model/railtie"
|
7
|
-
require "active_job/railtie"
|
8
|
-
# require "active_record/railtie"
|
9
|
-
require "action_controller/railtie"
|
10
|
-
require "action_mailer/railtie"
|
11
|
-
require "action_view/railtie"
|
12
|
-
require "action_cable/engine"
|
13
|
-
require "sprockets/railtie"
|
14
|
-
require "rails/test_unit/railtie"
|
15
|
-
|
16
|
-
# Require the gems listed in Gemfile, including any gems
|
17
|
-
# you've limited to :test, :development, or :production.
|
18
|
-
Bundler.require(*Rails.groups)
|
19
|
-
|
20
|
-
module Dummy
|
21
|
-
class Application < Rails::Application
|
22
|
-
# Settings in config/environments/* take precedence over those specified here.
|
23
|
-
# Application configuration should go into files in config/initializers
|
24
|
-
# -- all .rb files in that directory are automatically loaded.
|
25
|
-
end
|
26
|
-
end
|
@@ -1,52 +0,0 @@
|
|
1
|
-
# typed: false
|
2
|
-
Rails.application.configure do
|
3
|
-
# Settings specified here will take precedence over those in config/application.rb.
|
4
|
-
|
5
|
-
# In the development environment your application's code is reloaded on
|
6
|
-
# every request. This slows down response time but is perfect for development
|
7
|
-
# since you don't have to restart the web server when you make code changes.
|
8
|
-
config.cache_classes = false
|
9
|
-
|
10
|
-
# Do not eager load code on boot.
|
11
|
-
config.eager_load = false
|
12
|
-
|
13
|
-
# Show full error reports.
|
14
|
-
config.consider_all_requests_local = true
|
15
|
-
|
16
|
-
# Enable/disable caching. By default caching is disabled.
|
17
|
-
if Rails.root.join('tmp/caching-dev.txt').exist?
|
18
|
-
config.action_controller.perform_caching = true
|
19
|
-
|
20
|
-
config.cache_store = :memory_store
|
21
|
-
config.public_file_server.headers = {
|
22
|
-
'Cache-Control' => 'public, max-age=172800'
|
23
|
-
}
|
24
|
-
else
|
25
|
-
config.action_controller.perform_caching = false
|
26
|
-
|
27
|
-
config.cache_store = :null_store
|
28
|
-
end
|
29
|
-
|
30
|
-
# Don't care if the mailer can't send.
|
31
|
-
config.action_mailer.raise_delivery_errors = false
|
32
|
-
|
33
|
-
config.action_mailer.perform_caching = false
|
34
|
-
|
35
|
-
# Print deprecation notices to the Rails logger.
|
36
|
-
config.active_support.deprecation = :log
|
37
|
-
|
38
|
-
# Debug mode disables concatenation and preprocessing of assets.
|
39
|
-
# This option may cause significant delays in view rendering with a large
|
40
|
-
# number of complex assets.
|
41
|
-
config.assets.debug = true
|
42
|
-
|
43
|
-
# Suppress logger output for asset requests.
|
44
|
-
config.assets.quiet = true
|
45
|
-
|
46
|
-
# Raises error for missing translations
|
47
|
-
# config.action_view.raise_on_missing_translations = true
|
48
|
-
|
49
|
-
# Use an evented file watcher to asynchronously detect changes in source code,
|
50
|
-
# routes, locales, etc. This feature depends on the listen gem.
|
51
|
-
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
|
52
|
-
end
|
@@ -1,84 +0,0 @@
|
|
1
|
-
# typed: false
|
2
|
-
Rails.application.configure do
|
3
|
-
# Settings specified here will take precedence over those in config/application.rb.
|
4
|
-
|
5
|
-
# Code is not reloaded between requests.
|
6
|
-
config.cache_classes = true
|
7
|
-
|
8
|
-
# Eager load code on boot. This eager loads most of Rails and
|
9
|
-
# your application in memory, allowing both threaded web servers
|
10
|
-
# and those relying on copy on write to perform better.
|
11
|
-
# Rake tasks automatically ignore this option for performance.
|
12
|
-
config.eager_load = true
|
13
|
-
|
14
|
-
# Full error reports are disabled and caching is turned on.
|
15
|
-
config.consider_all_requests_local = false
|
16
|
-
config.action_controller.perform_caching = true
|
17
|
-
|
18
|
-
# Disable serving static files from the `/public` folder by default since
|
19
|
-
# Apache or NGINX already handles this.
|
20
|
-
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
|
21
|
-
|
22
|
-
# Compress JavaScripts and CSS.
|
23
|
-
config.assets.js_compressor = :uglifier
|
24
|
-
# config.assets.css_compressor = :sass
|
25
|
-
|
26
|
-
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
27
|
-
config.assets.compile = false
|
28
|
-
|
29
|
-
# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
|
30
|
-
|
31
|
-
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
32
|
-
# config.action_controller.asset_host = 'http://assets.example.com'
|
33
|
-
|
34
|
-
# Specifies the header that your server uses for sending files.
|
35
|
-
# config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
|
36
|
-
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
|
37
|
-
|
38
|
-
# Mount Action Cable outside main process or domain
|
39
|
-
# config.action_cable.mount_path = nil
|
40
|
-
# config.action_cable.url = 'wss://example.com/cable'
|
41
|
-
# config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ]
|
42
|
-
|
43
|
-
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
44
|
-
# config.force_ssl = true
|
45
|
-
|
46
|
-
# Use the lowest log level to ensure availability of diagnostic information
|
47
|
-
# when problems arise.
|
48
|
-
config.log_level = :debug
|
49
|
-
|
50
|
-
# Prepend all log lines with the following tags.
|
51
|
-
config.log_tags = [ :request_id ]
|
52
|
-
|
53
|
-
# Use a different cache store in production.
|
54
|
-
# config.cache_store = :mem_cache_store
|
55
|
-
|
56
|
-
# Use a real queuing backend for Active Job (and separate queues per environment)
|
57
|
-
# config.active_job.queue_adapter = :resque
|
58
|
-
# config.active_job.queue_name_prefix = "dummy_#{Rails.env}"
|
59
|
-
config.action_mailer.perform_caching = false
|
60
|
-
|
61
|
-
# Ignore bad email addresses and do not raise email delivery errors.
|
62
|
-
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
63
|
-
# config.action_mailer.raise_delivery_errors = false
|
64
|
-
|
65
|
-
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
66
|
-
# the I18n.default_locale when a translation cannot be found).
|
67
|
-
config.i18n.fallbacks = true
|
68
|
-
|
69
|
-
# Send deprecation notices to registered listeners.
|
70
|
-
config.active_support.deprecation = :notify
|
71
|
-
|
72
|
-
# Use default logging formatter so that PID and timestamp are not suppressed.
|
73
|
-
config.log_formatter = ::Logger::Formatter.new
|
74
|
-
|
75
|
-
# Use a different logger for distributed setups.
|
76
|
-
# require 'syslog/logger'
|
77
|
-
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
|
78
|
-
|
79
|
-
if ENV["RAILS_LOG_TO_STDOUT"].present?
|
80
|
-
logger = ActiveSupport::Logger.new(STDOUT)
|
81
|
-
logger.formatter = config.log_formatter
|
82
|
-
config.logger = ActiveSupport::TaggedLogging.new(logger)
|
83
|
-
end
|
84
|
-
end
|
@@ -1,43 +0,0 @@
|
|
1
|
-
# typed: false
|
2
|
-
Rails.application.configure do
|
3
|
-
# Settings specified here will take precedence over those in config/application.rb.
|
4
|
-
|
5
|
-
# The test environment is used exclusively to run your application's
|
6
|
-
# test suite. You never need to work with it otherwise. Remember that
|
7
|
-
# your test database is "scratch space" for the test suite and is wiped
|
8
|
-
# and recreated between test runs. Don't rely on the data there!
|
9
|
-
config.cache_classes = true
|
10
|
-
|
11
|
-
# Do not eager load code on boot. This avoids loading your whole application
|
12
|
-
# just for the purpose of running a single test. If you are using a tool that
|
13
|
-
# preloads Rails for running tests, you may have to set it to true.
|
14
|
-
config.eager_load = false
|
15
|
-
|
16
|
-
# Configure public file server for tests with Cache-Control for performance.
|
17
|
-
config.public_file_server.enabled = true
|
18
|
-
config.public_file_server.headers = {
|
19
|
-
'Cache-Control' => 'public, max-age=3600'
|
20
|
-
}
|
21
|
-
|
22
|
-
# Show full error reports and disable caching.
|
23
|
-
config.consider_all_requests_local = true
|
24
|
-
config.action_controller.perform_caching = false
|
25
|
-
|
26
|
-
# Raise exceptions instead of rendering exception templates.
|
27
|
-
config.action_dispatch.show_exceptions = false
|
28
|
-
|
29
|
-
# Disable request forgery protection in test environment.
|
30
|
-
config.action_controller.allow_forgery_protection = false
|
31
|
-
config.action_mailer.perform_caching = false
|
32
|
-
|
33
|
-
# Tell Action Mailer not to deliver emails to the real world.
|
34
|
-
# The :test delivery method accumulates sent emails in the
|
35
|
-
# ActionMailer::Base.deliveries array.
|
36
|
-
config.action_mailer.delivery_method = :test
|
37
|
-
|
38
|
-
# Print deprecation notices to the stderr.
|
39
|
-
config.active_support.deprecation = :stderr
|
40
|
-
|
41
|
-
# Raises error for missing translations
|
42
|
-
# config.action_view.raise_on_missing_translations = true
|
43
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
# typed: false
|
2
|
-
# Be sure to restart your server when you modify this file.
|
3
|
-
|
4
|
-
# Version of your assets, change this if you want to expire all your assets.
|
5
|
-
Rails.application.config.assets.version = '1.0'
|
6
|
-
|
7
|
-
# Add additional assets to the asset load path
|
8
|
-
# Rails.application.config.assets.paths << Emoji.images_path
|
9
|
-
|
10
|
-
# Precompile additional assets.
|
11
|
-
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
|
12
|
-
# Rails.application.config.assets.precompile += %w( search.js )
|
@@ -1,8 +0,0 @@
|
|
1
|
-
# typed: strong
|
2
|
-
# Be sure to restart your server when you modify this file.
|
3
|
-
|
4
|
-
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
|
5
|
-
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
|
6
|
-
|
7
|
-
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
|
8
|
-
# Rails.backtrace_cleaner.remove_silencers!
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# typed: strong
|
2
|
-
# Be sure to restart your server when you modify this file.
|
3
|
-
|
4
|
-
# Add new inflection rules using the following format. Inflections
|
5
|
-
# are locale specific, and you may define rules for as many different
|
6
|
-
# locales as you wish. All of these examples are active by default:
|
7
|
-
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
8
|
-
# inflect.plural /^(ox)$/i, '\1en'
|
9
|
-
# inflect.singular /^(ox)en/i, '\1'
|
10
|
-
# inflect.irregular 'person', 'people'
|
11
|
-
# inflect.uncountable %w( fish sheep )
|
12
|
-
# end
|
13
|
-
|
14
|
-
# These inflection rules are supported but not enabled by default:
|
15
|
-
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
16
|
-
# inflect.acronym 'RESTful'
|
17
|
-
# end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
# typed: false
|
2
|
-
# Be sure to restart your server when you modify this file.
|
3
|
-
#
|
4
|
-
# This file contains migration options to ease your Rails 5.0 upgrade.
|
5
|
-
#
|
6
|
-
# Read the Guide for Upgrading Ruby on Rails for more info on each option.
|
7
|
-
|
8
|
-
Rails.application.config.action_controller.raise_on_unfiltered_parameters = true
|
9
|
-
|
10
|
-
# Enable per-form CSRF tokens. Previous versions had false.
|
11
|
-
Rails.application.config.action_controller.per_form_csrf_tokens = true
|
12
|
-
|
13
|
-
# Enable origin-checking CSRF mitigation. Previous versions had false.
|
14
|
-
Rails.application.config.action_controller.forgery_protection_origin_check = true
|
15
|
-
|
16
|
-
# Make Ruby 2.4 preserve the timezone of the receiver when calling `to_time`.
|
17
|
-
# Previous versions had false.
|
18
|
-
ActiveSupport.to_time_preserves_timezone = true
|
19
|
-
|
20
|
-
# Do not halt callback chains when a callback returns false. Previous versions had true.
|
21
|
-
ActiveSupport.halt_callback_chains_on_return_false = false
|
22
|
-
|
23
|
-
# Configure SSL options to enable HSTS with subdomains. Previous versions had false.
|
24
|
-
Rails.application.config.ssl_options = { hsts: { subdomains: true } }
|
@@ -1,10 +0,0 @@
|
|
1
|
-
# typed: false
|
2
|
-
# Be sure to restart your server when you modify this file.
|
3
|
-
|
4
|
-
# This file contains settings for ActionController::ParamsWrapper which
|
5
|
-
# is enabled by default.
|
6
|
-
|
7
|
-
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
8
|
-
ActiveSupport.on_load(:action_controller) do
|
9
|
-
wrap_parameters format: [:json]
|
10
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
# Files in the config/locales directory are used for internationalization
|
2
|
-
# and are automatically loaded by Rails. If you want to use locales other
|
3
|
-
# than English, add the necessary files in this directory.
|
4
|
-
#
|
5
|
-
# To use the locales, use `I18n.t`:
|
6
|
-
#
|
7
|
-
# I18n.t 'hello'
|
8
|
-
#
|
9
|
-
# In views, this is aliased to just `t`:
|
10
|
-
#
|
11
|
-
# <%= t('hello') %>
|
12
|
-
#
|
13
|
-
# To use a different locale, set it with `I18n.locale`:
|
14
|
-
#
|
15
|
-
# I18n.locale = :es
|
16
|
-
#
|
17
|
-
# This would use the information in config/locales/es.yml.
|
18
|
-
#
|
19
|
-
# To learn more, please read the Rails Internationalization guide
|
20
|
-
# available at http://guides.rubyonrails.org/i18n.html.
|
21
|
-
|
22
|
-
en:
|
23
|
-
hello: "Hello world"
|
@@ -1,48 +0,0 @@
|
|
1
|
-
# typed: false
|
2
|
-
# Puma can serve each request in a thread from an internal thread pool.
|
3
|
-
# The `threads` method setting takes two numbers a minimum and maximum.
|
4
|
-
# Any libraries that use thread pools should be configured to match
|
5
|
-
# the maximum value specified for Puma. Default is set to 5 threads for minimum
|
6
|
-
# and maximum, this matches the default thread size of Active Record.
|
7
|
-
#
|
8
|
-
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }.to_i
|
9
|
-
threads threads_count, threads_count
|
10
|
-
|
11
|
-
# Specifies the `port` that Puma will listen on to receive requests, default is 3000.
|
12
|
-
#
|
13
|
-
port ENV.fetch("PORT") { 3000 }
|
14
|
-
|
15
|
-
# Specifies the `environment` that Puma will run in.
|
16
|
-
#
|
17
|
-
environment ENV.fetch("RAILS_ENV") { "development" }
|
18
|
-
|
19
|
-
# Specifies the number of `workers` to boot in clustered mode.
|
20
|
-
# Workers are forked webserver processes. If using threads and workers together
|
21
|
-
# the concurrency of the application would be max `threads` * `workers`.
|
22
|
-
# Workers do not work on JRuby or Windows (both of which do not support
|
23
|
-
# processes).
|
24
|
-
#
|
25
|
-
# workers ENV.fetch("WEB_CONCURRENCY") { 2 }
|
26
|
-
|
27
|
-
# Use the `preload_app!` method when specifying a `workers` number.
|
28
|
-
# This directive tells Puma to first boot the application and load code
|
29
|
-
# before forking the application. This takes advantage of Copy On Write
|
30
|
-
# process behavior so workers use less memory. If you use this option
|
31
|
-
# you need to make sure to reconnect any threads in the `on_worker_boot`
|
32
|
-
# block.
|
33
|
-
#
|
34
|
-
# preload_app!
|
35
|
-
|
36
|
-
# The code in the `on_worker_boot` will be called if you are using
|
37
|
-
# clustered mode by specifying a number of `workers`. After each worker
|
38
|
-
# process is booted this block will be run, if you are using `preload_app!`
|
39
|
-
# option you will want to use this block to reconnect to any threads
|
40
|
-
# or connections that may have been created at application boot, Ruby
|
41
|
-
# cannot share connections between processes.
|
42
|
-
#
|
43
|
-
# on_worker_boot do
|
44
|
-
# ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
|
45
|
-
# end
|
46
|
-
|
47
|
-
# Allow puma to be restarted by `rails restart` command.
|
48
|
-
plugin :tmp_restart
|
@@ -1,9 +0,0 @@
|
|
1
|
-
# typed: false
|
2
|
-
Rails.application.routes.draw do
|
3
|
-
if Rails.env.development?
|
4
|
-
mount GraphiQL::Rails::Engine, at: "/graphiql", graphql_path: "/graphql"
|
5
|
-
end
|
6
|
-
|
7
|
-
post "/graphql", to: "graphql#execute"
|
8
|
-
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
|
9
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
# Be sure to restart your server when you modify this file.
|
2
|
-
|
3
|
-
# Your secret key is used for verifying the integrity of signed cookies.
|
4
|
-
# If you change this key, all old signed cookies will become invalid!
|
5
|
-
|
6
|
-
# Make sure the secret is at least 30 characters and all random,
|
7
|
-
# no regular words or you'll be exposed to dictionary attacks.
|
8
|
-
# You can use `rails secret` to generate a secure secret key.
|
9
|
-
|
10
|
-
# Make sure the secrets in this file are kept private
|
11
|
-
# if you're sharing your code publicly.
|
12
|
-
|
13
|
-
development:
|
14
|
-
secret_key_base: d410cfbc9a6ef5a395051b8dcbf0360c8e2dc985df35c110009327d7fbdbad091b324d1157fd658d5a9a13f0b9198675e331ec2b67f329c76fe659fee75fac04
|
15
|
-
|
16
|
-
test:
|
17
|
-
secret_key_base: b9882a29988da3a71cfd446ce79cd306b660c7bc1ad1a2324de43fc15a434a4e466ff9409f87523dfeaf33445859682e3f3a142a12424ad452fb7dbbe6f158de
|
18
|
-
|
19
|
-
# Do not keep production secrets in the repository,
|
20
|
-
# instead read values from the environment.
|
21
|
-
production:
|
22
|
-
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
|