diff --git a/config/application.rb b/config/application.rb index 614e1d8..d78546a 100644 --- a/config/application.rb +++ b/config/application.rb @@ -24,7 +24,12 @@ class Application < Rails::Application config.load_defaults 7.0 # Configuration for the application, engines, and railties goes here. - # + config.active_job.queue_adapter = :sidekiq + config.active_job.queue_name_prefix = Rails.env + config.active_job.queue_name_delimiter = '_' + + config.assets.enabled = true + # These settings can be overridden in specific environments using the files # in config/environments, which are processed later. # diff --git a/config/environments/production.rb b/config/environments/production.rb index 6d5e7e2..f447455 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -28,8 +28,8 @@ # config.assets.css_compressor = :sass # Do not fallback to assets pipeline if a precompiled asset is missed. - config.assets.compile = false - + config.assets.compile = true + config.assets.compress = false # Enable serving of images, stylesheets, and JavaScripts from an asset server. # config.asset_host = "http://assets.example.com" diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb index 001e439..5386d78 100644 --- a/config/initializers/sidekiq.rb +++ b/config/initializers/sidekiq.rb @@ -1,7 +1,14 @@ +# Sidekiq.configure_server do |config| +# config.redis = { url: 'redis://localhost:6379/0' } +# end + +# Sidekiq.configure_client do |config| +# config.redis = { url: 'redis://localhost:6379/0' } +# end Sidekiq.configure_server do |config| - config.redis = { url: 'redis://localhost:6379/0' } + config.redis = { url: ENV['REDIS_URL'], network_timeout: 5 } end Sidekiq.configure_client do |config| - config.redis = { url: 'redis://localhost:6379/0' } + config.redis = { url: ENV['REDIS_URL'], network_timeout: 5 } end diff --git a/coverage/.last_run.json b/coverage/.last_run.json index 1c770db..da6c091 100644 --- a/coverage/.last_run.json +++ b/coverage/.last_run.json @@ -1,5 +1,5 @@ { "result": { - "line": 96.0 + "line": 96.14 } } diff --git a/coverage/.resultset.json b/coverage/.resultset.json index b4b1a7a..a251fb4 100644 --- a/coverage/.resultset.json +++ b/coverage/.resultset.json @@ -1,7 +1,7 @@ { "RSpec": { "coverage": { - "/Users/matt/4turing/projects/gearUp-BE/config/environment.rb": { + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/config/environment.rb": { "lines": [ null, 1, @@ -10,7 +10,7 @@ 1 ] }, - "/Users/matt/4turing/projects/gearUp-BE/config/application.rb": { + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/config/application.rb": { "lines": [ 1, null, @@ -51,7 +51,7 @@ null ] }, - "/Users/matt/4turing/projects/gearUp-BE/config/boot.rb": { + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/config/boot.rb": { "lines": [ 1, null, @@ -59,7 +59,7 @@ 1 ] }, - "/Users/matt/4turing/projects/gearUp-BE/config/environments/test.rb": { + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/config/environments/test.rb": { "lines": [ 1, null, @@ -123,7 +123,7 @@ null ] }, - "/Users/matt/4turing/projects/gearUp-BE/config/initializers/assets.rb": { + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/config/initializers/assets.rb": { "lines": [ null, null, @@ -139,7 +139,7 @@ null ] }, - "/Users/matt/4turing/projects/gearUp-BE/config/initializers/content_security_policy.rb": { + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/config/initializers/content_security_policy.rb": { "lines": [ null, null, @@ -168,7 +168,7 @@ null ] }, - "/Users/matt/4turing/projects/gearUp-BE/config/initializers/cors.rb": { + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/config/initializers/cors.rb": { "lines": [ 1, 1, @@ -181,7 +181,7 @@ null ] }, - "/Users/matt/4turing/projects/gearUp-BE/config/initializers/filter_parameter_logging.rb": { + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/config/initializers/filter_parameter_logging.rb": { "lines": [ null, null, @@ -193,7 +193,7 @@ null ] }, - "/Users/matt/4turing/projects/gearUp-BE/config/initializers/inflections.rb": { + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/config/initializers/inflections.rb": { "lines": [ null, null, @@ -213,7 +213,7 @@ null ] }, - "/Users/matt/4turing/projects/gearUp-BE/config/initializers/permissions_policy.rb": { + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/config/initializers/permissions_policy.rb": { "lines": [ null, null, @@ -228,7 +228,7 @@ null ] }, - "/Users/matt/4turing/projects/gearUp-BE/config/initializers/sidekiq.rb": { + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/config/initializers/sidekiq.rb": { "lines": [ 1, 0, @@ -239,7 +239,7 @@ null ] }, - "/Users/matt/4turing/projects/gearUp-BE/config/routes.rb": { + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/config/routes.rb": { "lines": [ 1, null, @@ -254,114 +254,161 @@ null ] }, - "/Users/matt/4turing/projects/gearUp-BE/app/helpers/application_helper.rb": { + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/app/helpers/application_helper.rb": { "lines": [ 1, null ] }, - "/Users/matt/4turing/projects/gearUp-BE/app/mailers/welcome_mailer.rb": { + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/app/graphql/gear_up_be_schema.rb": { "lines": [ + null, + null, + 1, + 1, 1, null, + null, 1, - 6, - 6, null, - 6, + null, + 1, + null, + null, + null, + null, + 0, + null, + null, + null, + 1, + null, + null, + 0, + null, + null, + null, + 1, + null, + null, + null, + null, + 1, + null, + 0, + null, + null, + null, + 1, + null, + 0, null, null ] }, - "/Users/matt/4turing/projects/gearUp-BE/app/mailers/application_mailer.rb": { + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/app/graphql/types/mutation_type.rb": { "lines": [ + null, + null, + 1, + 1, 1, 1, 1, + 1, + null, null ] }, - "/Users/matt/4turing/projects/gearUp-BE/spec/models/artist_spec.rb": { + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/app/graphql/types/base_object.rb": { "lines": [ - 1, + null, null, 1, 1, - 2, - null, - null, 1, - 2, - 2, - 2, - 2, - 2, - 2, + 1, + 1, null, null ] }, - "/Users/matt/4turing/projects/gearUp-BE/app/models/artist.rb": { + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/app/graphql/types/base_edge.rb": { "lines": [ + null, + null, 1, 1, null, 1, null, - 1, null ] }, - "/Users/matt/4turing/projects/gearUp-BE/app/models/application_record.rb": { + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/app/graphql/types/base_connection.rb": { "lines": [ + null, + null, + 1, 1, + null, 1, + null, null ] }, - "/Users/matt/4turing/projects/gearUp-BE/spec/models/donation_spec.rb": { + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/app/graphql/types/base_field.rb": { "lines": [ - 1, + null, null, 1, 1, - 2, - null, - null, 1, - 2, - 2, - 2, null, null ] }, - "/Users/matt/4turing/projects/gearUp-BE/app/models/donation.rb": { + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/app/graphql/types/base_argument.rb": { "lines": [ + null, + null, 1, 1, - 1, + null, null ] }, - "/Users/matt/4turing/projects/gearUp-BE/spec/models/post_spec.rb": { + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/app/graphql/mutations/create_post.rb": { "lines": [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, 1, null, 1, 1, - 9, null, + 1, + 1, + 1, + null, + 1, + null, + 1, null, null, null, null, + 0, null, null, null, null, null, - 9, null, null, null, @@ -371,59 +418,139 @@ null, null, null, - 1, - 2, - 2, null, null, - 1, - 2, - 2, - 2, - 2, - 2, null, null, + null + ] + }, + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/app/graphql/mutations/base_mutation.rb": { + "lines": [ + null, + null, + 1, 1, 1, 1, 1, + 1, + null, + null + ] + }, + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/app/graphql/types/base_input_object.rb": { + "lines": [ null, + null, + 1, + 1, 1, null, + null + ] + }, + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/app/graphql/types/post_type.rb": { + "lines": [ null, null, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, null, + 1, + 1, null, 1, + 25, + null, + null, 1, + 25, + null, null, + null + ] + }, + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/app/graphql/types/donation_type.rb": { + "lines": [ null, null, 1, 1, 1, + 1, + 1, + 1, + 1, + 1, + 1, null, + null + ] + }, + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/app/graphql/mutations/create_donation.rb": { + "lines": [ + 1, + 1, + 1, + 1, + 1, 1, null, + 1, + 1, null, + 1, + null, + 1, + 1, null, + 1, null, + 1, null, 1, + null, 1, null, null, null, + null, + 0, + null, + null, + null, + null, + null, null ] }, - "/Users/matt/4turing/projects/gearUp-BE/app/models/post.rb": { + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/app/graphql/mutations/update_post.rb": { "lines": [ + 1, + 1, + 1, + 1, + 1, + 1, 1, 1, 1, null, + 1, + 1, + null, + 1, + 1, null, 1, null, @@ -432,76 +559,146 @@ null, null, null, - 1, - 3, - 3, null, null, 1, - 27, + null, + null, + null, + null, + 0, + null, + null, + null, + null, null, null ] }, - "/Users/matt/4turing/projects/gearUp-BE/spec/requests/artists/all_artists_spec.rb": { + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/app/graphql/mutations/update_donation.rb": { "lines": [ + 1, + 1, + 1, + 1, + 1, + 1, 1, null, 1, 1, - 3, - 15, null, + 1, + 1, null, + 1, null, null, null, null, null, null, + 1, null, null, - 15, - 75, + null, + null, + 0, + null, null, null, null, null, + null + ] + }, + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/app/graphql/types/query_type.rb": { + "lines": [ null, null, + 1, + 1, + 1, + 1, null, null, + 1, + 0, null, null, 1, 1, + null, + null, 1, + 0, + null, null, + 1, null, + 1, + 6, null, null, + 1, + 1, null, null, + 1, + 4, null, null, + 1, + 1, + 1, null, null, + 1, + 0, null, + 0, + 0, + 0, + 0, null, null, + 0, null, null, + null + ] + }, + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/app/graphql/types/node_type.rb": { + "lines": [ null, null, 1, + 1, + 1, null, 1, null, + null + ] + }, + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/app/graphql/types/base_interface.rb": { + "lines": [ + null, + null, 1, 1, - null, 1, 1, + 1, + null, + 1, + null, + null + ] + }, + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/app/graphql/types/artist_type.rb": { + "lines": [ + null, null, 1, 1, @@ -514,10 +711,50 @@ 1, 1, 1, + 1, + 1, + null, + 1, + 1, null, null, 1, + 22, + null, + 22, + 0, + 22, + 5, + null, + null, + 22, + null, + null, + null + ] + }, + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/app/graphql/types/post_order_enum.rb": { + "lines": [ 1, + 1, + 1, + 1, + null, + null + ] + }, + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/spec/mailers/welcome_mailer_spec.rb": { + "lines": [ + null, + null, + 1, + null, + 1, + 1, + 1, + 1, + null, + null, null, null, null, @@ -526,27 +763,87 @@ null, null, null, + 1, + null, + null, + null, + null, + null, null, 1, null, 1, null, + null, 1, 1, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, 1, + null, + null, + null, + null, + null, + null, 1, + null, 1, + null, + null, 1, 1, null, null, + null, + null, + null, + null, + null, + null, + null, + null, 1, + null, + null, + null, + null, + null, + null, 1, + null, 1, + null, + null, 1, 1, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, 1, + null, + null, + null, + null, + null, + null, 1, + null, 1, null, null, @@ -564,35 +861,111 @@ null, 1, null, + null, + null, + null, + null, + null, + 1, + null, + 1, + 1, + null, + null, + null + ] + }, + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/app/mailers/welcome_mailer.rb": { + "lines": [ + 1, + null, + 1, + 6, + 6, + null, + 6, + null, + null + ] + }, + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/app/mailers/application_mailer.rb": { + "lines": [ + 1, + 1, + 1, + null + ] + }, + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/spec/models/artist_spec.rb": { + "lines": [ + 1, + null, + 1, + 1, + 2, + null, + null, + 1, + 2, + 2, + 2, + 2, + 2, + 2, + null, + null + ] + }, + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/app/models/artist.rb": { + "lines": [ + 1, + 1, + null, 1, null, 1, + null + ] + }, + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/app/models/application_record.rb": { + "lines": [ 1, - null, 1, + null + ] + }, + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/spec/models/donation_spec.rb": { + "lines": [ 1, null, 1, 1, - 1, + 2, + null, null, 1, + 2, + 2, + 2, + null, + null + ] + }, + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/app/models/donation.rb": { + "lines": [ 1, 1, - null, 1, - null, - null, null ] }, - "/Users/matt/4turing/projects/gearUp-BE/spec/requests/artists/one_artist_spec.rb": { + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/spec/models/post_spec.rb": { "lines": [ 1, null, 1, 1, - 2, + 9, null, null, null, @@ -603,11 +976,9 @@ null, null, null, + 9, null, null, - 1, - 1, - 1, null, null, null, @@ -615,37 +986,43 @@ null, null, null, + 1, + 2, + 2, null, null, + 1, + 2, + 2, + 2, + 2, + 2, null, null, + 1, + 1, + 1, + 1, null, + 1, null, null, null, null, null, 1, - null, 1, null, - 1, - 1, null, - 1, - 1, null, 1, 1, 1, + null, 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, + null, + null, + null, null, null, 1, @@ -653,39 +1030,35 @@ null, null, null, + null + ] + }, + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/app/models/post.rb": { + "lines": [ + 1, + 1, + 1, null, null, + 1, null, null, null, null, - 1, null, - 1, null, 1, - 1, - 1, - 1, - 1, - 1, - 1, + 3, + 3, null, null, 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - null, + 27, null, null ] }, - "/Users/matt/4turing/projects/gearUp-BE/spec/requests/artists_posts/all_artists_with_posts_spec.rb": { + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/spec/requests/artists/all_artists_spec.rb": { "lines": [ 1, null, @@ -735,15 +1108,6 @@ null, null, null, - null, - null, - null, - null, - null, - null, - null, - null, - null, 1, null, 1, @@ -753,7 +1117,6 @@ null, 1, 1, - 1, null, 1, 1, @@ -767,17 +1130,6 @@ 1, 1, null, - 1, - 1, - null, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - null, null, 1, 1, @@ -790,7 +1142,6 @@ null, null, null, - null, 1, null, 1, @@ -802,8 +1153,6 @@ 1, 1, 1, - 1, - 1, null, null, 1, @@ -814,15 +1163,6 @@ 1, 1, 1, - 1, - 1, - null, - 1, - 1, - 1, - 1, - 1, - 1, null, null, 1, @@ -837,9 +1177,6 @@ null, null, null, - null, - null, - null, 1, null, 1, @@ -856,21 +1193,21 @@ null, 1, 1, - null, 1, + null, 1, null, null, null ] }, - "/Users/matt/4turing/projects/gearUp-BE/spec/requests/artists_posts/mutation_create_posts_spec.rb": { + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/spec/requests/artists/one_artist_spec.rb": { "lines": [ 1, null, 1, 1, - 1, + 2, null, null, null, @@ -903,11 +1240,6 @@ null, null, null, - null, - null, - null, - null, - null, 1, null, 1, @@ -920,52 +1252,17 @@ null, 1, 1, - null, - 1, 1, - null, 1, 1, - null, 1, 1, - null, 1, - null, - null, - null - ] - }, - "/Users/matt/4turing/projects/gearUp-BE/spec/requests/artists_posts/one_artist_with_posts_spec.rb": { - "lines": [ 1, - null, 1, 1, - 2, - null, - null, - null, null, null, - null, - null, - null, - null, - null, - null, - 2, - 10, - null, - null, - null, - null, - null, - null, - null, - null, - null, - 1, 1, 1, null, @@ -977,66 +1274,41 @@ null, null, null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, 1, null, 1, null, 1, 1, - null, - 1, 1, - null, 1, 1, - null, 1, 1, null, - 1, - 1, null, 1, 1, - null, 1, 1, 1, - null, 1, 1, 1, null, - 1, - 1, null, - 1, + null + ] + }, + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/spec/requests/artists_posts/all_artists_with_posts_spec.rb": { + "lines": [ 1, null, 1, 1, - 1, - null, + 3, + 15, null, - 1, - 1, null, null, null, @@ -1046,61 +1318,29 @@ null, null, null, + 15, + 75, null, null, - 1, null, - 1, null, - 1, - 1, null, - 1, - 1, null, - 1, - 1, null, - 1, - 1, - 1, null, - 1, null, null, 1, 1, - null, - 1, 1, null, - 1, - 1, null, - 1, - 1, - 1, null, - 1, - 1, null, - 1, - 1, null, - 1, - 1, null, null, - null - ] - }, - "/Users/matt/4turing/projects/gearUp-BE/spec/requests/artists_posts/update_post_spec.rb": { - "lines": [ - 1, null, - 1, - 1, - 2, null, null, null, @@ -1112,7 +1352,6 @@ null, null, null, - 2, null, null, null, @@ -1120,7 +1359,16 @@ null, null, null, + 1, + null, + 1, + null, + 1, + 1, null, + 1, + 1, + 1, null, 1, 1, @@ -1129,12 +1377,25 @@ 1, 1, 1, - null, + 1, + 1, + 1, 1, null, + 1, + 1, null, + 1, + 1, + 1, + 1, + 1, + 1, + 1, null, null, + 1, + 1, null, null, null, @@ -1145,48 +1406,42 @@ null, null, null, + 1, null, - null, - null, - null, - null, - null, - null, - null, + 1, null, 1, 1, - null, 1, 1, 1, - null, 1, 1, - null, 1, 1, null, + null, 1, 1, - null, 1, 1, - null, 1, 1, - null, 1, 1, - null, 1, 1, null, - null, + 1, + 1, + 1, + 1, 1, 1, null, null, + 1, + 1, null, null, null, @@ -1200,14 +1455,19 @@ null, null, null, + 1, null, + 1, null, + 1, + 1, null, 1, 1, null, 1, 1, + 1, null, 1, 1, @@ -1219,29 +1479,16 @@ null ] }, - "/Users/matt/4turing/projects/gearUp-BE/spec/requests/donations/create_donation_spec.rb": { - "lines": [ - - ] - }, - "/Users/matt/4turing/projects/gearUp-BE/spec/requests/donations/mutation_create_donation_spec.rb": { + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/spec/requests/artists_posts/mutation_create_posts_spec.rb": { "lines": [ 1, null, 1, 1, - 2, - null, - null, - null, - null, - null, - null, - null, + 1, null, null, null, - 2, null, null, null, @@ -1270,20 +1517,14 @@ null, null, null, - 1, null, - 1, null, - 1, - 1, null, - 1, - 1, null, - 1, - 1, + null, null, 1, + null, 1, null, 1, @@ -1298,32 +1539,19 @@ 1, 1, null, - null, 1, 1, null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, 1, 1, + null, 1, null, null, null ] }, - "/Users/matt/4turing/projects/gearUp-BE/spec/requests/donations/update_donation_spec.rb": { + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/spec/requests/artists_posts/one_artist_with_posts_spec.rb": { "lines": [ 1, null, @@ -1342,6 +1570,7 @@ null, null, 2, + 10, null, null, null, @@ -1350,7 +1579,10 @@ null, null, null, - 2, + null, + 1, + 1, + 1, null, null, null, @@ -1359,11 +1591,7 @@ null, null, null, - 1, - 1, - 1, null, - 1, null, null, null, @@ -1381,7 +1609,9 @@ null, null, null, + 1, null, + 1, null, 1, 1, @@ -1407,16 +1637,21 @@ null, 1, 1, - null, 1, null, - null, 1, 1, null, + 1, + 1, null, + 1, + 1, + 1, null, null, + 1, + 1, null, null, null, @@ -1429,6 +1664,7 @@ null, null, 1, + null, 1, null, 1, @@ -1437,12 +1673,6 @@ 1, 1, null, - null, - null - ] - }, - "/Users/matt/4turing/projects/gearUp-BE/spec/workers/welcome_email_worker_spec.rb": { - "lines": [ 1, 1, null, @@ -1450,271 +1680,183 @@ 1, 1, null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - 1, - null, - null, - null, - null, - null, - null, - null, - null, - null, 1, null, null, - null, - null, - null, - null, - null, 1, - null, 1, null, 1, - null, 1, null, 1, 1, + null, 1, 1, 1, null, - null - ] - }, - "/Users/matt/4turing/projects/gearUp-BE/app/workers/welcome_email_worker.rb": { - "lines": [ 1, 1, null, 1, 1, + null, 1, 1, null, + null, null ] }, - "/Users/matt/4turing/projects/gearUp-BE/app/controllers/graphql_controller.rb": { + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/spec/requests/artists_posts/update_post_spec.rb": { "lines": [ - null, - null, 1, null, - null, - null, - null, - null, 1, - null, 1, - 17, - 17, - 17, - 17, + 2, null, null, null, - 17, - 17, null, - 0, - 0, null, null, - 1, null, null, - 1, - 17, null, - 0, - 0, null, - 0, null, + 2, null, - 0, null, - 0, null, - 17, null, - 0, null, null, null, - 1, - 0, - 0, null, - 0, null, - null - ] - }, - "/Users/matt/4turing/projects/gearUp-BE/app/controllers/application_controller.rb": { - "lines": [ 1, - null - ] - }, - "/Users/matt/4turing/projects/gearUp-BE/app/graphql/gear_up_be_schema.rb": { - "lines": [ - null, - null, 1, 1, 1, - null, - null, 1, - null, - null, + 1, 1, null, + 1, null, null, null, - 0, null, null, null, - 1, null, null, - 0, null, null, null, - 1, null, null, null, null, - 1, null, - 0, null, null, null, - 1, null, - 0, null, - null - ] - }, - "/Users/matt/4turing/projects/gearUp-BE/app/graphql/types/mutation_type.rb": { - "lines": [ null, null, 1, 1, + null, + 1, 1, 1, + null, 1, 1, null, - null - ] - }, - "/Users/matt/4turing/projects/gearUp-BE/app/graphql/types/base_object.rb": { - "lines": [ + 1, + 1, null, + 1, + 1, null, 1, 1, + null, + 1, 1, + null, 1, 1, null, - null - ] - }, - "/Users/matt/4turing/projects/gearUp-BE/app/graphql/types/base_edge.rb": { - "lines": [ + 1, + 1, null, null, 1, 1, null, - 1, null, - null - ] - }, - "/Users/matt/4turing/projects/gearUp-BE/app/graphql/types/base_connection.rb": { - "lines": [ null, null, - 1, - 1, null, - 1, null, - null - ] - }, - "/Users/matt/4turing/projects/gearUp-BE/app/graphql/types/base_field.rb": { - "lines": [ null, null, - 1, + null, + null, + null, + null, + null, + null, + null, + null, + null, + null, 1, 1, null, - null - ] - }, - "/Users/matt/4turing/projects/gearUp-BE/app/graphql/types/base_argument.rb": { - "lines": [ + 1, + 1, null, + 1, + 1, null, 1, 1, null, + null, null ] }, - "/Users/matt/4turing/projects/gearUp-BE/app/graphql/mutations/create_post.rb": { + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/spec/requests/donations/create_donation_spec.rb": { + "lines": [ + + ] + }, + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/spec/requests/donations/mutation_create_donation_spec.rb": { "lines": [ - 1, - 1, - 1, - 1, - 1, - 1, - 1, 1, null, 1, 1, + 2, null, - 1, - 1, - 1, null, - 1, null, - 1, null, null, null, null, - 0, + null, + null, + null, + 2, null, null, null, @@ -1724,6 +1866,14 @@ null, null, null, + 1, + 1, + 1, + null, + null, + null, + null, + null, null, null, null, @@ -1733,137 +1883,104 @@ null, null, null, - null - ] - }, - "/Users/matt/4turing/projects/gearUp-BE/app/graphql/mutations/base_mutation.rb": { - "lines": [ null, null, 1, + null, 1, + null, 1, 1, + null, 1, 1, null, - null - ] - }, - "/Users/matt/4turing/projects/gearUp-BE/app/graphql/types/base_input_object.rb": { - "lines": [ - null, - null, 1, 1, - 1, - null, - null - ] - }, - "/Users/matt/4turing/projects/gearUp-BE/app/graphql/types/post_type.rb": { - "lines": [ null, - null, - 1, 1, 1, + null, 1, 1, + null, 1, 1, + null, 1, 1, + null, 1, 1, null, + null, 1, 1, null, - 1, - 25, null, null, - 1, - 25, null, null, - null - ] - }, - "/Users/matt/4turing/projects/gearUp-BE/app/graphql/types/donation_type.rb": { - "lines": [ null, null, - 1, - 1, - 1, - 1, - 1, - 1, + null, + null, + null, + null, + null, + null, + null, 1, 1, 1, null, + null, null ] }, - "/Users/matt/4turing/projects/gearUp-BE/app/graphql/mutations/create_donation.rb": { + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/spec/requests/donations/update_donation_spec.rb": { "lines": [ - 1, - 1, - 1, - 1, - 1, 1, null, 1, 1, + 2, null, - 1, null, - 1, - 1, null, - 1, null, - 1, null, - 1, null, - 1, null, null, null, null, - 0, + null, + 2, + null, + null, + null, + null, + null, + null, + null, + null, + 2, + null, + null, + null, null, null, null, null, null, - null - ] - }, - "/Users/matt/4turing/projects/gearUp-BE/app/graphql/mutations/update_post.rb": { - "lines": [ - 1, - 1, - 1, - 1, - 1, - 1, 1, 1, 1, null, 1, - 1, null, - 1, - 1, null, - 1, null, null, null, @@ -1872,27 +1989,24 @@ null, null, null, - 1, null, null, null, null, - 0, null, null, null, null, null, - null - ] - }, - "/Users/matt/4turing/projects/gearUp-BE/app/graphql/mutations/update_donation.rb": { - "lines": [ 1, 1, + null, + 1, 1, + null, 1, 1, + null, 1, 1, null, @@ -1903,158 +2017,176 @@ 1, null, 1, + 1, + 1, null, + 1, + 1, null, + 1, + null, + null, + 1, + 1, null, null, null, null, - 1, null, null, null, null, - 0, null, null, null, null, null, - null - ] - }, - "/Users/matt/4turing/projects/gearUp-BE/app/graphql/types/query_type.rb": { - "lines": [ null, null, 1, 1, + null, 1, 1, null, - null, 1, - 0, + 1, null, null, + null + ] + }, + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/spec/workers/welcome_email_worker_spec.rb": { + "lines": [ 1, 1, null, - null, 1, - 0, + 1, + 1, + null, null, null, - 1, null, - 1, - 6, null, null, - 1, - 1, null, null, - 1, - 4, null, null, 1, - 1, - 1, + null, + null, + null, + null, + null, + null, + null, null, null, 1, - 0, null, - 0, - 0, - 0, - 0, null, null, - 0, null, null, - null - ] - }, - "/Users/matt/4turing/projects/gearUp-BE/app/graphql/types/node_type.rb": { - "lines": [ null, null, 1, + null, + 1, + null, 1, + null, 1, null, 1, + 1, + 1, + 1, + 1, null, null ] }, - "/Users/matt/4turing/projects/gearUp-BE/app/graphql/types/base_interface.rb": { + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/app/workers/welcome_email_worker.rb": { "lines": [ - null, - null, 1, 1, + null, 1, 1, 1, - null, 1, null, null ] }, - "/Users/matt/4turing/projects/gearUp-BE/app/graphql/types/artist_type.rb": { + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/app/controllers/graphql_controller.rb": { "lines": [ null, null, 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, - 1, + null, + null, + null, + null, + null, 1, null, 1, + 17, + 17, + 17, + 17, + null, + null, + null, + 17, + 17, + null, + 0, + 0, + null, + null, 1, null, null, 1, - 22, + 17, + null, + 0, + 0, null, - 22, 0, - 22, - 5, null, null, - 22, + 0, + null, + 0, + null, + 17, + null, + 0, + null, + null, + null, + 1, + 0, + 0, null, + 0, null, null ] }, - "/Users/matt/4turing/projects/gearUp-BE/app/graphql/types/post_order_enum.rb": { + "/Users/allenrussell/turing_work/mod4/projects/gearUp_be/app/controllers/application_controller.rb": { "lines": [ 1, - 1, - 1, - 1, - null, null ] } }, - "timestamp": 1697958931 + "timestamp": 1698011812 } } diff --git a/coverage/index.html b/coverage/index.html index 58e0841..0d8578a 100644 --- a/coverage/index.html +++ b/coverage/index.html @@ -1,7 +1,7 @@ - Code coverage for Gearup-be + Code coverage for Gearup be @@ -14,7 +14,7 @@ loading
-
Generated 2023-10-22T00:15:31-07:00
+
Generated 2023-10-22T15:56:52-06:00
@@ -23,14 +23,14 @@

All Files ( - 96.0% + 96.15% covered at - 1.73 + 1.7 hits/line ) @@ -39,15 +39,15 @@

- 55 files in total. + 56 files in total.
- 750 relevant lines, - 720 lines covered and + 779 relevant lines, + 749 lines covered and 30 lines missed. ( - 96.0% + 96.15% )
@@ -71,7 +71,7 @@

- app/controllers/application_controller.rb + app/controllers/application_controller.rb 100.00 % 2 1 @@ -82,7 +82,7 @@

- app/controllers/graphql_controller.rb + app/controllers/graphql_controller.rb 56.00 % 54 25 @@ -93,7 +93,7 @@

- app/graphql/gear_up_be_schema.rb + app/graphql/gear_up_be_schema.rb 69.23 % 42 13 @@ -104,7 +104,7 @@

- app/graphql/mutations/base_mutation.rb + app/graphql/mutations/base_mutation.rb 100.00 % 10 6 @@ -115,7 +115,7 @@

- app/graphql/mutations/create_donation.rb + app/graphql/mutations/create_donation.rb 93.75 % 33 16 @@ -126,7 +126,7 @@

- app/graphql/mutations/create_post.rb + app/graphql/mutations/create_post.rb 93.75 % 43 16 @@ -137,7 +137,7 @@

- app/graphql/mutations/update_donation.rb + app/graphql/mutations/update_donation.rb 92.86 % 33 14 @@ -148,7 +148,7 @@

- app/graphql/mutations/update_post.rb + app/graphql/mutations/update_post.rb 93.75 % 37 16 @@ -159,7 +159,7 @@

- app/graphql/types/artist_type.rb + app/graphql/types/artist_type.rb 95.45 % 33 22 @@ -170,7 +170,7 @@

- app/graphql/types/base_argument.rb + app/graphql/types/base_argument.rb 100.00 % 6 2 @@ -181,7 +181,7 @@

- app/graphql/types/base_connection.rb + app/graphql/types/base_connection.rb 100.00 % 8 3 @@ -192,7 +192,7 @@

- app/graphql/types/base_edge.rb + app/graphql/types/base_edge.rb 100.00 % 8 3 @@ -203,7 +203,7 @@

- app/graphql/types/base_field.rb + app/graphql/types/base_field.rb 100.00 % 7 3 @@ -214,7 +214,7 @@

- app/graphql/types/base_input_object.rb + app/graphql/types/base_input_object.rb 100.00 % 7 3 @@ -225,7 +225,7 @@

- app/graphql/types/base_interface.rb + app/graphql/types/base_interface.rb 100.00 % 11 6 @@ -236,7 +236,7 @@

- app/graphql/types/base_object.rb + app/graphql/types/base_object.rb 100.00 % 9 5 @@ -247,7 +247,7 @@

- app/graphql/types/donation_type.rb + app/graphql/types/donation_type.rb 100.00 % 13 9 @@ -258,7 +258,7 @@

- app/graphql/types/mutation_type.rb + app/graphql/types/mutation_type.rb 100.00 % 10 6 @@ -269,7 +269,7 @@

- app/graphql/types/node_type.rb + app/graphql/types/node_type.rb 100.00 % 9 4 @@ -280,7 +280,7 @@

- app/graphql/types/post_order_enum.rb + app/graphql/types/post_order_enum.rb 100.00 % 6 4 @@ -291,7 +291,7 @@

- app/graphql/types/post_type.rb + app/graphql/types/post_type.rb 100.00 % 26 17 @@ -302,7 +302,7 @@

- app/graphql/types/query_type.rb + app/graphql/types/query_type.rb 70.37 % 52 27 @@ -313,7 +313,7 @@

- app/helpers/application_helper.rb + app/helpers/application_helper.rb 100.00 % 2 1 @@ -324,7 +324,7 @@

- app/mailers/application_mailer.rb + app/mailers/application_mailer.rb 100.00 % 4 3 @@ -335,7 +335,7 @@

- app/mailers/welcome_mailer.rb + app/mailers/welcome_mailer.rb 100.00 % 9 5 @@ -346,7 +346,7 @@

- app/models/application_record.rb + app/models/application_record.rb 100.00 % 3 2 @@ -357,7 +357,7 @@

- app/models/artist.rb + app/models/artist.rb 100.00 % 7 4 @@ -368,7 +368,7 @@

- app/models/donation.rb + app/models/donation.rb 100.00 % 4 3 @@ -379,7 +379,7 @@

- app/models/post.rb + app/models/post.rb 100.00 % 21 9 @@ -390,7 +390,7 @@

- app/workers/welcome_email_worker.rb + app/workers/welcome_email_worker.rb 100.00 % 9 6 @@ -401,7 +401,7 @@

- config/application.rb + config/application.rb 100.00 % 37 15 @@ -412,7 +412,7 @@

- config/boot.rb + config/boot.rb 100.00 % 4 3 @@ -423,7 +423,7 @@

- config/environment.rb + config/environment.rb 100.00 % 5 2 @@ -434,7 +434,7 @@

- config/environments/test.rb + config/environments/test.rb 100.00 % 60 17 @@ -445,7 +445,7 @@

- config/initializers/assets.rb + config/initializers/assets.rb 100.00 % 12 1 @@ -456,7 +456,7 @@

- config/initializers/content_security_policy.rb + config/initializers/content_security_policy.rb 100.00 % 25 0 @@ -467,7 +467,7 @@

- config/initializers/cors.rb + config/initializers/cors.rb 100.00 % 9 4 @@ -478,7 +478,7 @@

- config/initializers/filter_parameter_logging.rb + config/initializers/filter_parameter_logging.rb 100.00 % 8 1 @@ -489,7 +489,7 @@

- config/initializers/inflections.rb + config/initializers/inflections.rb 100.00 % 16 0 @@ -500,7 +500,7 @@

- config/initializers/permissions_policy.rb + config/initializers/permissions_policy.rb 100.00 % 11 0 @@ -511,7 +511,7 @@

- config/initializers/sidekiq.rb + config/initializers/sidekiq.rb 75.00 % 7 4 @@ -522,7 +522,7 @@

- config/routes.rb + config/routes.rb 83.33 % 11 6 @@ -533,7 +533,18 @@

- spec/models/artist_spec.rb + spec/mailers/welcome_mailer_spec.rb + 100.00 % + 128 + 29 + 29 + 0 + 1.00 + + + + + spec/models/artist_spec.rb 100.00 % 16 11 @@ -544,7 +555,7 @@

- spec/models/donation_spec.rb + spec/models/donation_spec.rb 100.00 % 13 8 @@ -555,7 +566,7 @@

- spec/models/post_spec.rb + spec/models/post_spec.rb 100.00 % 70 27 @@ -566,7 +577,7 @@

- spec/requests/artists/all_artists_spec.rb + spec/requests/artists/all_artists_spec.rb 100.00 % 139 61 @@ -577,7 +588,7 @@

- spec/requests/artists/one_artist_spec.rb + spec/requests/artists/one_artist_spec.rb 100.00 % 95 43 @@ -588,7 +599,7 @@

- spec/requests/artists_posts/all_artists_with_posts_spec.rb + spec/requests/artists_posts/all_artists_with_posts_spec.rb 100.00 % 175 81 @@ -599,7 +610,7 @@

- spec/requests/artists_posts/mutation_create_posts_spec.rb + spec/requests/artists_posts/mutation_create_posts_spec.rb 100.00 % 68 22 @@ -610,7 +621,7 @@

- spec/requests/artists_posts/one_artist_with_posts_spec.rb + spec/requests/artists_posts/one_artist_with_posts_spec.rb 100.00 % 154 65 @@ -621,7 +632,7 @@

- spec/requests/artists_posts/update_post_spec.rb + spec/requests/artists_posts/update_post_spec.rb 100.00 % 121 42 @@ -632,7 +643,7 @@

- spec/requests/donations/create_donation_spec.rb + spec/requests/donations/create_donation_spec.rb 100.00 % 0 0 @@ -643,7 +654,7 @@

- spec/requests/donations/mutation_create_donation_spec.rb + spec/requests/donations/mutation_create_donation_spec.rb 100.00 % 95 31 @@ -654,7 +665,7 @@

- spec/requests/donations/update_donation_spec.rb + spec/requests/donations/update_donation_spec.rb 100.00 % 114 36 @@ -665,7 +676,7 @@

- spec/workers/welcome_email_worker_spec.rb + spec/workers/welcome_email_worker_spec.rb 100.00 % 49 16 @@ -692,7 +703,7 @@

-
+

app/controllers/application_controller.rb

@@ -745,7 +756,7 @@

-
+

app/controllers/graphql_controller.rb

@@ -1370,7 +1381,7 @@

-
+

app/graphql/gear_up_be_schema.rb

@@ -1863,7 +1874,7 @@

-
+

app/graphql/mutations/base_mutation.rb

@@ -2004,7 +2015,7 @@

-
+

app/graphql/mutations/create_donation.rb

@@ -2398,7 +2409,7 @@

-
+

app/graphql/mutations/create_post.rb

@@ -2902,7 +2913,7 @@

-
+

app/graphql/mutations/update_donation.rb

@@ -3296,7 +3307,7 @@

-
+

app/graphql/mutations/update_post.rb

@@ -3734,7 +3745,7 @@

-
+

app/graphql/types/artist_type.rb

@@ -4128,7 +4139,7 @@

-
+

app/graphql/types/base_argument.rb

@@ -4225,7 +4236,7 @@

-
+

app/graphql/types/base_connection.rb

@@ -4344,7 +4355,7 @@

-
+

app/graphql/types/base_edge.rb

@@ -4463,7 +4474,7 @@

-
+

app/graphql/types/base_field.rb

@@ -4571,7 +4582,7 @@

-
+

app/graphql/types/base_input_object.rb

@@ -4679,7 +4690,7 @@

-
+

app/graphql/types/base_interface.rb

@@ -4831,7 +4842,7 @@

-
+

app/graphql/types/base_object.rb

@@ -4961,7 +4972,7 @@

-
+

app/graphql/types/donation_type.rb

@@ -5135,7 +5146,7 @@

-
+

app/graphql/types/mutation_type.rb

@@ -5276,7 +5287,7 @@

-
+

app/graphql/types/node_type.rb

@@ -5406,7 +5417,7 @@

-
+

app/graphql/types/post_order_enum.rb

@@ -5503,7 +5514,7 @@

-
+

app/graphql/types/post_type.rb

@@ -5820,7 +5831,7 @@

-
+

app/graphql/types/query_type.rb

@@ -6423,7 +6434,7 @@

-
+

app/helpers/application_helper.rb

@@ -6476,7 +6487,7 @@

-
+

app/mailers/application_mailer.rb

@@ -6551,7 +6562,7 @@

-
+

app/mailers/welcome_mailer.rb

@@ -6681,7 +6692,7 @@

-
+

app/models/application_record.rb

@@ -6745,7 +6756,7 @@

-
+

app/models/artist.rb

@@ -6853,7 +6864,7 @@

-
+

app/models/donation.rb

@@ -6928,7 +6939,7 @@

-
+

app/models/post.rb

@@ -7190,7 +7201,7 @@

-
+

app/workers/welcome_email_worker.rb

@@ -7320,7 +7331,7 @@

-
+

config/application.rb

@@ -7758,7 +7769,7 @@

-
+

config/boot.rb

@@ -7833,7 +7844,7 @@

-
+

config/environment.rb

@@ -7919,7 +7930,7 @@

-
+

config/environments/test.rb

@@ -8610,7 +8621,7 @@

-
+

config/initializers/assets.rb

@@ -8773,7 +8784,7 @@

-
+

config/initializers/content_security_policy.rb

@@ -9079,7 +9090,7 @@

-
+

config/initializers/cors.rb

@@ -9209,7 +9220,7 @@

-
+

config/initializers/filter_parameter_logging.rb

@@ -9328,7 +9339,7 @@

-
+

config/initializers/inflections.rb

@@ -9535,7 +9546,7 @@

-
+

config/initializers/permissions_policy.rb

@@ -9687,7 +9698,7 @@

-
+

config/initializers/sidekiq.rb

@@ -9795,7 +9806,7 @@

-
+

config/routes.rb

@@ -9947,7 +9958,1446 @@

-
+
+
+

spec/mailers/welcome_mailer_spec.rb

+

+ + 100.0% + + + lines covered +

+ + + +
+ 29 relevant lines. + 29 lines covered and + 0 lines missed. +
+ + + +
+ +
+    
    + +
    +
  1. + + + + + + # spec/mailers/welcome_mailer_spec.rb +
  2. +
    + +
    +
  3. + + + + + + +
  4. +
    + +
    +
  5. + 1 + + + + + require 'rails_helper' +
  6. +
    + +
    +
  7. + + + + + + +
  8. +
    + +
    +
  9. + 1 + + + + + RSpec.describe WelcomeMailer, type: :mailer do +
  10. +
    + +
    +
  11. + 1 + + + + + describe 'donation_confirmation_email' do +
  12. +
    + +
    +
  13. + 1 + + + + + it 'renders the subject' do +
  14. +
    + +
    +
  15. + 1 + + + + + artist = Artist.create( +
  16. +
    + +
    +
  17. + + + + + + name: 'John Doe', +
  18. +
    + +
    +
  19. + + + + + + email: 'john@example.com', +
  20. +
    + +
    +
  21. + + + + + + city: 'Sample City', +
  22. +
    + +
    +
  23. + + + + + + state: 'Sample State', +
  24. +
    + +
    +
  25. + + + + + + zipcode: '12345', +
  26. +
    + +
    +
  27. + + + + + + password_digest: 'sample_password_digest', +
  28. +
    + +
    +
  29. + + + + + + medium: 'Sample Medium', +
  30. +
    + +
    +
  31. + + + + + + profile_image: 'sample_profile_image.jpg' +
  32. +
    + +
    +
  33. + + + + + + ) +
  34. +
    + +
    +
  35. + + + + + + +
  36. +
    + +
    +
  37. + 1 + + + + + donation = Donation.create( +
  38. +
    + +
    +
  39. + + + + + + name: 'Sample Name', +
  40. +
    + +
    +
  41. + + + + + + email: 'donor@example.com', +
  42. +
    + +
    +
  43. + + + + + + amount: 100.0, +
  44. +
    + +
    +
  45. + + + + + + post_id: 1 +
  46. +
    + +
    +
  47. + + + + + + ) +
  48. +
    + +
    +
  49. + + + + + + +
  50. +
    + +
    +
  51. + 1 + + + + + mail = WelcomeMailer.donation_confirmation_email(artist, donation) +
  52. +
    + +
    +
  53. + + + + + + +
  54. +
    + +
    +
  55. + 1 + + + + + expect(mail.subject).to eq('Donation Confirmation') +
  56. +
    + +
    +
  57. + + + + + + end +
  58. +
    + +
    +
  59. + + + + + + +
  60. +
    + +
    +
  61. + 1 + + + + + it 'renders the receiver email' do +
  62. +
    + +
    +
  63. + 1 + + + + + artist = Artist.create( +
  64. +
    + +
    +
  65. + + + + + + name: 'Jane Smith', +
  66. +
    + +
    +
  67. + + + + + + email: 'jane@example.com', +
  68. +
    + +
    +
  69. + + + + + + city: 'Sample City', +
  70. +
    + +
    +
  71. + + + + + + state: 'Sample State', +
  72. +
    + +
    +
  73. + + + + + + zipcode: '12345', +
  74. +
    + +
    +
  75. + + + + + + password_digest: 'sample_password_digest', +
  76. +
    + +
    +
  77. + + + + + + medium: 'Sample Medium', +
  78. +
    + +
    +
  79. + + + + + + profile_image: 'sample_profile_image.jpg' +
  80. +
    + +
    +
  81. + + + + + + ) +
  82. +
    + +
    +
  83. + + + + + + +
  84. +
    + +
    +
  85. + 1 + + + + + donation = Donation.create( +
  86. +
    + +
    +
  87. + + + + + + name: 'Sample Name', +
  88. +
    + +
    +
  89. + + + + + + email: 'donor@example.com', +
  90. +
    + +
    +
  91. + + + + + + amount: 200.0, +
  92. +
    + +
    +
  93. + + + + + + post_id: 2 +
  94. +
    + +
    +
  95. + + + + + + ) +
  96. +
    + +
    +
  97. + + + + + + +
  98. +
    + +
    +
  99. + 1 + + + + + mail = WelcomeMailer.donation_confirmation_email(artist, donation) +
  100. +
    + +
    +
  101. + + + + + + +
  102. +
    + +
    +
  103. + 1 + + + + + expect(mail.to).to eq([artist.email]) +
  104. +
    + +
    +
  105. + + + + + + end +
  106. +
    + +
    +
  107. + + + + + + +
  108. +
    + +
    +
  109. + 1 + + + + + it 'renders the sender email' do +
  110. +
    + +
    +
  111. + 1 + + + + + artist = Artist.create( +
  112. +
    + +
    +
  113. + + + + + + name: 'Alice Johnson', +
  114. +
    + +
    +
  115. + + + + + + email: 'alice@example.com', +
  116. +
    + +
    +
  117. + + + + + + city: 'Sample City', +
  118. +
    + +
    +
  119. + + + + + + state: 'Sample State', +
  120. +
    + +
    +
  121. + + + + + + zipcode: '12345', +
  122. +
    + +
    +
  123. + + + + + + password_digest: 'sample_password_digest', +
  124. +
    + +
    +
  125. + + + + + + medium: 'Sample Medium', +
  126. +
    + +
    +
  127. + + + + + + profile_image: 'sample_profile_image.jpg' +
  128. +
    + +
    +
  129. + + + + + + ) +
  130. +
    + +
    +
  131. + + + + + + +
  132. +
    + +
    +
  133. + 1 + + + + + donation = Donation.create( +
  134. +
    + +
    +
  135. + + + + + + name: 'Sample Name', +
  136. +
    + +
    +
  137. + + + + + + email: 'donor@example.com', +
  138. +
    + +
    +
  139. + + + + + + amount: 300.0, +
  140. +
    + +
    +
  141. + + + + + + post_id: 3 +
  142. +
    + +
    +
  143. + + + + + + ) +
  144. +
    + +
    +
  145. + + + + + + +
  146. +
    + +
    +
  147. + 1 + + + + + mail = WelcomeMailer.donation_confirmation_email(artist, donation) +
  148. +
    + +
    +
  149. + + + + + + +
  150. +
    + +
    +
  151. + 1 + + + + + expect(mail.from).to eq(["from@example.com"]) # Make an email for our app and add it here +
  152. +
    + +
    +
  153. + + + + + + end +
  154. +
    + +
    +
  155. + + + + + + +
  156. +
    + +
    +
  157. + 1 + + + + + it 'assigns artist' do +
  158. +
    + +
    +
  159. + 1 + + + + + artist = Artist.create( +
  160. +
    + +
    +
  161. + + + + + + name: 'Bob Brown', +
  162. +
    + +
    +
  163. + + + + + + email: 'bob@example.com', +
  164. +
    + +
    +
  165. + + + + + + city: 'Sample City', +
  166. +
    + +
    +
  167. + + + + + + state: 'Sample State', +
  168. +
    + +
    +
  169. + + + + + + zipcode: '12345', +
  170. +
    + +
    +
  171. + + + + + + password_digest: 'sample_password_digest', +
  172. +
    + +
    +
  173. + + + + + + medium: 'Sample Medium', +
  174. +
    + +
    +
  175. + + + + + + profile_image: 'sample_profile_image.jpg' +
  176. +
    + +
    +
  177. + + + + + + ) +
  178. +
    + +
    +
  179. + + + + + + +
  180. +
    + +
    +
  181. + 1 + + + + + donation = Donation.create( +
  182. +
    + +
    +
  183. + + + + + + name: 'Sample Name', +
  184. +
    + +
    +
  185. + + + + + + email: 'donor@example.com', +
  186. +
    + +
    +
  187. + + + + + + amount: 400.0, +
  188. +
    + +
    +
  189. + + + + + + post_id: 4 +
  190. +
    + +
    +
  191. + + + + + + ) +
  192. +
    + +
    +
  193. + + + + + + +
  194. +
    + +
    +
  195. + 1 + + + + + mail = WelcomeMailer.donation_confirmation_email(artist, donation) +
  196. +
    + +
    +
  197. + + + + + + +
  198. +
    + +
    +
  199. + 1 + + + + + expect(mail.body.encoded).to match(artist.name) +
  200. +
    + +
    +
  201. + + + + + + end +
  202. +
    + +
    +
  203. + + + + + + +
  204. +
    + +
    +
  205. + 1 + + + + + it 'assigns donation' do +
  206. +
    + +
    +
  207. + 1 + + + + + artist = Artist.create( +
  208. +
    + +
    +
  209. + + + + + + name: 'Charlie Davis', +
  210. +
    + +
    +
  211. + + + + + + email: 'charlie@example.com', +
  212. +
    + +
    +
  213. + + + + + + city: 'Sample City', +
  214. +
    + +
    +
  215. + + + + + + state: 'Sample State', +
  216. +
    + +
    +
  217. + + + + + + zipcode: '12345', +
  218. +
    + +
    +
  219. + + + + + + password_digest: 'sample_password_digest', +
  220. +
    + +
    +
  221. + + + + + + medium: 'Sample Medium', +
  222. +
    + +
    +
  223. + + + + + + profile_image: 'sample_profile_image.jpg' +
  224. +
    + +
    +
  225. + + + + + + ) +
  226. +
    + +
    +
  227. + + + + + + +
  228. +
    + +
    +
  229. + 1 + + + + + donation = Donation.create( +
  230. +
    + +
    +
  231. + + + + + + name: 'Sample Name', +
  232. +
    + +
    +
  233. + + + + + + email: 'donor@example.com', +
  234. +
    + +
    +
  235. + + + + + + amount: 500.0, +
  236. +
    + +
    +
  237. + + + + + + post_id: 5 +
  238. +
    + +
    +
  239. + + + + + + ) +
  240. +
    + +
    +
  241. + + + + + + +
  242. +
    + +
    +
  243. + 1 + + + + + mail = WelcomeMailer.donation_confirmation_email(artist, donation) +
  244. +
    + +
    +
  245. + + + + + + +
  246. +
    + +
    +
  247. + 1 + + + + + expect(mail.body.encoded).to match(donation.amount.to_s) +
  248. +
    + +
    +
  249. + 1 + + + + + expect(mail.body.encoded).to match(donation.post_id.to_s) +
  250. +
    + +
    +
  251. + + + + + + end +
  252. +
    + +
    +
  253. + + + + + + end +
  254. +
    + +
    +
  255. + + + + + + end +
  256. +
    + +
+
+
+ + +

spec/models/artist_spec.rb

@@ -10154,7 +11604,7 @@

-
+

spec/models/donation_spec.rb

@@ -10328,7 +11778,7 @@

-
+

spec/models/post_spec.rb

@@ -11129,7 +12579,7 @@

-
+

spec/requests/artists/all_artists_spec.rb

@@ -12689,7 +14139,7 @@

-
+

spec/requests/artists/one_artist_spec.rb

@@ -13765,7 +15215,7 @@

-
+

spec/requests/artists_posts/all_artists_with_posts_spec.rb

@@ -15721,7 +17171,7 @@

-
+

spec/requests/artists_posts/mutation_create_posts_spec.rb

@@ -16500,7 +17950,7 @@

-
+

spec/requests/artists_posts/one_artist_with_posts_spec.rb

@@ -18225,7 +19675,7 @@

-
+

spec/requests/artists_posts/update_post_spec.rb

@@ -19587,7 +21037,7 @@

-
+

spec/requests/donations/create_donation_spec.rb

@@ -19618,7 +21068,7 @@

-
+

spec/requests/donations/mutation_create_donation_spec.rb

@@ -20694,7 +22144,7 @@

-
+

spec/requests/donations/update_donation_spec.rb

@@ -21979,7 +23429,7 @@

-
+

spec/workers/welcome_email_worker_spec.rb

diff --git a/schema.graphql b/schema.graphql new file mode 100644 index 0000000..c4b1d0e --- /dev/null +++ b/schema.graphql @@ -0,0 +1,206 @@ +type Artist { + city: String + createdAt: ISO8601DateTime! + email: String + id: ID! + medium: String + name: String + passwordDigest: String + posts(orderBy: PostOrderEnum): [Post!]! + profileImage: String + state: String + updatedAt: ISO8601DateTime! + zipcode: String +} + +""" +Autogenerated input type of CreateDonation +""" +input CreateDonationInput { + amount: Float! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + email: String! + name: String! + postId: Int! +} + +""" +Autogenerated return type of CreateDonation. +""" +type CreateDonationPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + donation: Donation! + errors: [String!]! +} + +""" +Autogenerated input type of CreatePost +""" +input CreatePostInput { + artistId: Int! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + currentAmount: Float! + details: String! + imageUrl: String! + requestedAmount: Float! + title: String! +} + +""" +Autogenerated return type of CreatePost. +""" +type CreatePostPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + errors: [String!]! + post: Post! +} + +type Donation { + amount: Float + createdAt: ISO8601DateTime! + email: String + id: ID! + name: String + postId: Int! + updatedAt: ISO8601DateTime! +} + +""" +An ISO 8601-encoded datetime +""" +scalar ISO8601DateTime @specifiedBy(url: "https://tools.ietf.org/html/rfc3339") + +type Mutation { + createDonation( + """ + Parameters for CreateDonation + """ + input: CreateDonationInput! + ): CreateDonationPayload + createPost( + """ + Parameters for CreatePost + """ + input: CreatePostInput! + ): CreatePostPayload + updateDonation( + """ + Parameters for UpdateDonation + """ + input: UpdateDonationInput! + ): UpdateDonationPayload + updatePost( + """ + Parameters for UpdatePost + """ + input: UpdatePostInput! + ): UpdatePostPayload +} + +type Post { + artistId: Int! + createdAt: ISO8601DateTime! + currentAmount: Float + details: String + donationPercentage: Float! + donations: [Donation!]! + id: ID! + imageUrl: String + requestedAmount: Float + title: String + updatedAt: ISO8601DateTime! +} + +enum PostOrderEnum { + """ + Sort by ascending order + """ + ASC + + """ + Sort by descending order + """ + DESC +} + +type Query { + artist(id: ID!): Artist! + artists: [Artist!]! + + """ + Get a list of posts with optional sorting + """ + posts(orderBy: PostOrderEnum): [Post!]! +} + +""" +Autogenerated input type of UpdateDonation +""" +input UpdateDonationInput { + amount: Float! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + email: String! + id: ID! + name: String! + postId: Int! +} + +""" +Autogenerated return type of UpdateDonation. +""" +type UpdateDonationPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + donation: Donation + errors: [String!]! +} + +""" +Autogenerated input type of UpdatePost +""" +input UpdatePostInput { + artistId: Int! + + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + currentAmount: Float! + details: String! + id: ID! + imageUrl: String! + requestedAmount: Float! + title: String! +} + +""" +Autogenerated return type of UpdatePost. +""" +type UpdatePostPayload { + """ + A unique identifier for the client performing the mutation. + """ + clientMutationId: String + errors: [String!]! + post: Post +} diff --git a/schema.json b/schema.json new file mode 100644 index 0000000..7cd7447 --- /dev/null +++ b/schema.json @@ -0,0 +1,2764 @@ +{ + "data": { + "__schema": { + "queryType": { + "name": "Query" + }, + "mutationType": { + "name": "Mutation" + }, + "subscriptionType": null, + "types": [ + { + "kind": "OBJECT", + "name": "Artist", + "description": null, + "interfaces": [ + + ], + "possibleTypes": null, + "fields": [ + { + "name": "city", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "createdAt", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ISO8601DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "email", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "id", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "medium", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "name", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "passwordDigest", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "posts", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Post", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + { + "name": "orderBy", + "description": null, + "type": { + "kind": "ENUM", + "name": "PostOrderEnum", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ] + }, + { + "name": "profileImage", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "state", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "updatedAt", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ISO8601DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "zipcode", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + } + ], + "inputFields": null, + "enumValues": null + }, + { + "kind": "SCALAR", + "name": "Boolean", + "description": "Represents `true` or `false` values.", + "interfaces": null, + "possibleTypes": null, + "fields": null, + "inputFields": null, + "enumValues": null + }, + { + "kind": "INPUT_OBJECT", + "name": "CreateDonationInput", + "description": "Autogenerated input type of CreateDonation", + "interfaces": null, + "possibleTypes": null, + "fields": null, + "inputFields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "amount", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "postId", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "email", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "enumValues": null + }, + { + "kind": "OBJECT", + "name": "CreateDonationPayload", + "description": "Autogenerated return type of CreateDonation.", + "interfaces": [ + + ], + "possibleTypes": null, + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "donation", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Donation", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "errors", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + } + ], + "inputFields": null, + "enumValues": null + }, + { + "kind": "INPUT_OBJECT", + "name": "CreatePostInput", + "description": "Autogenerated input type of CreatePost", + "interfaces": null, + "possibleTypes": null, + "fields": null, + "inputFields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "title", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "details", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "imageUrl", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "requestedAmount", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "currentAmount", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "artistId", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "enumValues": null + }, + { + "kind": "OBJECT", + "name": "CreatePostPayload", + "description": "Autogenerated return type of CreatePost.", + "interfaces": [ + + ], + "possibleTypes": null, + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "errors", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "post", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Post", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + } + ], + "inputFields": null, + "enumValues": null + }, + { + "kind": "OBJECT", + "name": "Donation", + "description": null, + "interfaces": [ + + ], + "possibleTypes": null, + "fields": [ + { + "name": "amount", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "createdAt", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ISO8601DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "email", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "id", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "name", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "postId", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "updatedAt", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ISO8601DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + } + ], + "inputFields": null, + "enumValues": null + }, + { + "kind": "SCALAR", + "name": "Float", + "description": "Represents signed double-precision fractional values as specified by [IEEE 754](https://en.wikipedia.org/wiki/IEEE_floating_point).", + "interfaces": null, + "possibleTypes": null, + "fields": null, + "inputFields": null, + "enumValues": null + }, + { + "kind": "SCALAR", + "name": "ID", + "description": "Represents a unique identifier that is Base64 obfuscated. It is often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `\"VXNlci0xMA==\"`) or integer (such as `4`) input value will be accepted as an ID.", + "interfaces": null, + "possibleTypes": null, + "fields": null, + "inputFields": null, + "enumValues": null + }, + { + "kind": "SCALAR", + "name": "ISO8601DateTime", + "description": "An ISO 8601-encoded datetime", + "interfaces": null, + "possibleTypes": null, + "fields": null, + "inputFields": null, + "enumValues": null + }, + { + "kind": "SCALAR", + "name": "Int", + "description": "Represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.", + "interfaces": null, + "possibleTypes": null, + "fields": null, + "inputFields": null, + "enumValues": null + }, + { + "kind": "OBJECT", + "name": "Mutation", + "description": null, + "interfaces": [ + + ], + "possibleTypes": null, + "fields": [ + { + "name": "createDonation", + "description": null, + "type": { + "kind": "OBJECT", + "name": "CreateDonationPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + { + "name": "input", + "description": "Parameters for CreateDonation", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "CreateDonationInput", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ] + }, + { + "name": "createPost", + "description": null, + "type": { + "kind": "OBJECT", + "name": "CreatePostPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + { + "name": "input", + "description": "Parameters for CreatePost", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "CreatePostInput", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ] + }, + { + "name": "updateDonation", + "description": null, + "type": { + "kind": "OBJECT", + "name": "UpdateDonationPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + { + "name": "input", + "description": "Parameters for UpdateDonation", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "UpdateDonationInput", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ] + }, + { + "name": "updatePost", + "description": null, + "type": { + "kind": "OBJECT", + "name": "UpdatePostPayload", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + { + "name": "input", + "description": "Parameters for UpdatePost", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "UpdatePostInput", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ] + } + ], + "inputFields": null, + "enumValues": null + }, + { + "kind": "OBJECT", + "name": "Post", + "description": null, + "interfaces": [ + + ], + "possibleTypes": null, + "fields": [ + { + "name": "artistId", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "createdAt", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ISO8601DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "currentAmount", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "details", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "donationPercentage", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "donations", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Donation", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "id", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "imageUrl", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "requestedAmount", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "title", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "updatedAt", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ISO8601DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + } + ], + "inputFields": null, + "enumValues": null + }, + { + "kind": "ENUM", + "name": "PostOrderEnum", + "description": null, + "interfaces": null, + "possibleTypes": null, + "fields": null, + "inputFields": null, + "enumValues": [ + { + "name": "ASC", + "description": "Sort by ascending order", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "DESC", + "description": "Sort by descending order", + "isDeprecated": false, + "deprecationReason": null + } + ] + }, + { + "kind": "OBJECT", + "name": "Query", + "description": null, + "interfaces": [ + + ], + "possibleTypes": null, + "fields": [ + { + "name": "artist", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Artist", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + { + "name": "id", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ] + }, + { + "name": "artists", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Artist", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "posts", + "description": "Get a list of posts with optional sorting", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Post", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + { + "name": "orderBy", + "description": null, + "type": { + "kind": "ENUM", + "name": "PostOrderEnum", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ] + } + ], + "inputFields": null, + "enumValues": null + }, + { + "kind": "SCALAR", + "name": "String", + "description": "Represents textual data as UTF-8 character sequences. This type is most often used by GraphQL to represent free-form human-readable text.", + "interfaces": null, + "possibleTypes": null, + "fields": null, + "inputFields": null, + "enumValues": null + }, + { + "kind": "INPUT_OBJECT", + "name": "UpdateDonationInput", + "description": "Autogenerated input type of UpdateDonation", + "interfaces": null, + "possibleTypes": null, + "fields": null, + "inputFields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "email", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "amount", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "postId", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "enumValues": null + }, + { + "kind": "OBJECT", + "name": "UpdateDonationPayload", + "description": "Autogenerated return type of UpdateDonation.", + "interfaces": [ + + ], + "possibleTypes": null, + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "donation", + "description": null, + "type": { + "kind": "OBJECT", + "name": "Donation", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "errors", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + } + ], + "inputFields": null, + "enumValues": null + }, + { + "kind": "INPUT_OBJECT", + "name": "UpdatePostInput", + "description": "Autogenerated input type of UpdatePost", + "interfaces": null, + "possibleTypes": null, + "fields": null, + "inputFields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "title", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "details", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "imageUrl", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "requestedAmount", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "currentAmount", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "artistId", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "enumValues": null + }, + { + "kind": "OBJECT", + "name": "UpdatePostPayload", + "description": "Autogenerated return type of UpdatePost.", + "interfaces": [ + + ], + "possibleTypes": null, + "fields": [ + { + "name": "clientMutationId", + "description": "A unique identifier for the client performing the mutation.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "errors", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "post", + "description": null, + "type": { + "kind": "OBJECT", + "name": "Post", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + } + ], + "inputFields": null, + "enumValues": null + }, + { + "kind": "OBJECT", + "name": "__Directive", + "description": "A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.", + "interfaces": [ + + ], + "possibleTypes": null, + "fields": [ + { + "name": "args", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__InputValue", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + { + "name": "includeDeprecated", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false", + "isDeprecated": false, + "deprecationReason": null + } + ] + }, + { + "name": "description", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "isRepeatable", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "locations", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "__DirectiveLocation", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "name", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "onField", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": true, + "deprecationReason": "Use `locations`.", + "args": [ + + ] + }, + { + "name": "onFragment", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": true, + "deprecationReason": "Use `locations`.", + "args": [ + + ] + }, + { + "name": "onOperation", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": true, + "deprecationReason": "Use `locations`.", + "args": [ + + ] + } + ], + "inputFields": null, + "enumValues": null + }, + { + "kind": "ENUM", + "name": "__DirectiveLocation", + "description": "A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.", + "interfaces": null, + "possibleTypes": null, + "fields": null, + "inputFields": null, + "enumValues": [ + { + "name": "QUERY", + "description": "Location adjacent to a query operation.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "MUTATION", + "description": "Location adjacent to a mutation operation.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "SUBSCRIPTION", + "description": "Location adjacent to a subscription operation.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "FIELD", + "description": "Location adjacent to a field.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "FRAGMENT_DEFINITION", + "description": "Location adjacent to a fragment definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "FRAGMENT_SPREAD", + "description": "Location adjacent to a fragment spread.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INLINE_FRAGMENT", + "description": "Location adjacent to an inline fragment.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "SCHEMA", + "description": "Location adjacent to a schema definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "SCALAR", + "description": "Location adjacent to a scalar definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "OBJECT", + "description": "Location adjacent to an object type definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "FIELD_DEFINITION", + "description": "Location adjacent to a field definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ARGUMENT_DEFINITION", + "description": "Location adjacent to an argument definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INTERFACE", + "description": "Location adjacent to an interface definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "UNION", + "description": "Location adjacent to a union definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ENUM", + "description": "Location adjacent to an enum definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ENUM_VALUE", + "description": "Location adjacent to an enum value definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INPUT_OBJECT", + "description": "Location adjacent to an input object type definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INPUT_FIELD_DEFINITION", + "description": "Location adjacent to an input object field definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "VARIABLE_DEFINITION", + "description": "Location adjacent to a variable definition.", + "isDeprecated": false, + "deprecationReason": null + } + ] + }, + { + "kind": "OBJECT", + "name": "__EnumValue", + "description": "One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.", + "interfaces": [ + + ], + "possibleTypes": null, + "fields": [ + { + "name": "deprecationReason", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "description", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "isDeprecated", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "name", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + } + ], + "inputFields": null, + "enumValues": null + }, + { + "kind": "OBJECT", + "name": "__Field", + "description": "Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.", + "interfaces": [ + + ], + "possibleTypes": null, + "fields": [ + { + "name": "args", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__InputValue", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + { + "name": "includeDeprecated", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false", + "isDeprecated": false, + "deprecationReason": null + } + ] + }, + { + "name": "deprecationReason", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "description", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "isDeprecated", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "name", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "type", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + } + ], + "inputFields": null, + "enumValues": null + }, + { + "kind": "OBJECT", + "name": "__InputValue", + "description": "Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.", + "interfaces": [ + + ], + "possibleTypes": null, + "fields": [ + { + "name": "defaultValue", + "description": "A GraphQL-formatted string representing the default value for this input value.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "deprecationReason", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "description", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "isDeprecated", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "name", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "type", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + } + ], + "inputFields": null, + "enumValues": null + }, + { + "kind": "OBJECT", + "name": "__Schema", + "description": "A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.", + "interfaces": [ + + ], + "possibleTypes": null, + "fields": [ + { + "name": "description", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "directives", + "description": "A list of all directives supported by this server.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__Directive", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "mutationType", + "description": "If this server supports mutation, the type that mutation operations will be rooted at.", + "type": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "queryType", + "description": "The type that query operations will be rooted at.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "subscriptionType", + "description": "If this server support subscription, the type that subscription operations will be rooted at.", + "type": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "types", + "description": "A list of all types supported by this server.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + } + ], + "inputFields": null, + "enumValues": null + }, + { + "kind": "OBJECT", + "name": "__Type", + "description": "The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name and description, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.", + "interfaces": [ + + ], + "possibleTypes": null, + "fields": [ + { + "name": "description", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "enumValues", + "description": null, + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__EnumValue", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + { + "name": "includeDeprecated", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false", + "isDeprecated": false, + "deprecationReason": null + } + ] + }, + { + "name": "fields", + "description": null, + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__Field", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + { + "name": "includeDeprecated", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false", + "isDeprecated": false, + "deprecationReason": null + } + ] + }, + { + "name": "inputFields", + "description": null, + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__InputValue", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + { + "name": "includeDeprecated", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false", + "isDeprecated": false, + "deprecationReason": null + } + ] + }, + { + "name": "interfaces", + "description": null, + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "isOneOf", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "kind", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "__TypeKind", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "name", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "ofType", + "description": null, + "type": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "possibleTypes", + "description": null, + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + }, + { + "name": "specifiedByURL", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null, + "args": [ + + ] + } + ], + "inputFields": null, + "enumValues": null + }, + { + "kind": "ENUM", + "name": "__TypeKind", + "description": "An enum describing what kind of type a given `__Type` is.", + "interfaces": null, + "possibleTypes": null, + "fields": null, + "inputFields": null, + "enumValues": [ + { + "name": "SCALAR", + "description": "Indicates this type is a scalar.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "OBJECT", + "description": "Indicates this type is an object. `fields` and `interfaces` are valid fields.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INTERFACE", + "description": "Indicates this type is an interface. `fields` and `possibleTypes` are valid fields.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "UNION", + "description": "Indicates this type is a union. `possibleTypes` is a valid field.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ENUM", + "description": "Indicates this type is an enum. `enumValues` is a valid field.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INPUT_OBJECT", + "description": "Indicates this type is an input object. `inputFields` is a valid field.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "LIST", + "description": "Indicates this type is a list. `ofType` is a valid field.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "NON_NULL", + "description": "Indicates this type is a non-null. `ofType` is a valid field.", + "isDeprecated": false, + "deprecationReason": null + } + ] + } + ], + "directives": [ + { + "name": "include", + "description": "Directs the executor to include this field or fragment only when the `if` argument is true.", + "locations": [ + "FIELD", + "FRAGMENT_SPREAD", + "INLINE_FRAGMENT" + ], + "args": [ + { + "name": "if", + "description": "Included when true.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ] + }, + { + "name": "skip", + "description": "Directs the executor to skip this field or fragment when the `if` argument is true.", + "locations": [ + "FIELD", + "FRAGMENT_SPREAD", + "INLINE_FRAGMENT" + ], + "args": [ + { + "name": "if", + "description": "Skipped when true.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ] + }, + { + "name": "deprecated", + "description": "Marks an element of a GraphQL schema as no longer supported.", + "locations": [ + "FIELD_DEFINITION", + "ENUM_VALUE", + "ARGUMENT_DEFINITION", + "INPUT_FIELD_DEFINITION" + ], + "args": [ + { + "name": "reason", + "description": "Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted in [Markdown](https://daringfireball.net/projects/markdown/).", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": "\"No longer supported\"", + "isDeprecated": false, + "deprecationReason": null + } + ] + }, + { + "name": "oneOf", + "description": "Requires that exactly one field must be supplied and that field must not be `null`.", + "locations": [ + "INPUT_OBJECT" + ], + "args": [ + + ] + }, + { + "name": "specifiedBy", + "description": "Exposes a URL that specifies the behavior of this scalar.", + "locations": [ + "SCALAR" + ], + "args": [ + { + "name": "url", + "description": "The URL that specifies the behavior of this scalar.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null, + "isDeprecated": false, + "deprecationReason": null + } + ] + } + ] + } + } +} diff --git a/spec/graphql/app_schema_spec.rb b/spec/graphql/app_schema_spec.rb new file mode 100644 index 0000000..6210d63 --- /dev/null +++ b/spec/graphql/app_schema_spec.rb @@ -0,0 +1,12 @@ +require 'rails_helper' + +RSpec.describe GearUpBeSchema, type: :graphql do + it 'matches the dumped schema (rails graphql:schema:dump)' do + aggregate_failures do + expected = described_class.to_definition.gsub(/\s+/, ' ') + actual = File.read(Rails.root.join('schema.graphql')).gsub(/\s+/, ' ') + + expect(expected).to eq(actual) + end + end +end diff --git a/spec/support/graphql_helpers.rb b/spec/support/graphql_helpers.rb new file mode 100644 index 0000000..41b0a24 --- /dev/null +++ b/spec/support/graphql_helpers.rb @@ -0,0 +1,14 @@ +module GraphQLHelpers + def controller + @controller ||= GraphqlController.new.tap do |obj| + obj.set_request! ActionDispatch::Request.new({}) + end + end + + def execute_graphql(query, **kwargs) + GearUpBeSchema.execute( + query, + { context: { controller: controller } }.merge(kwargs), + ) + end +end