solidus_graphql_api 0.1.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.circleci/config.yml +43 -67
- data/.github/dependabot.yml +23 -0
- data/.github/stale.yml +3 -3
- data/.github_changelog_generator +2 -0
- data/.rubocop.yml +10 -4
- data/CHANGELOG.md +4 -0
- data/CONTRIBUTING.md +5 -5
- data/Gemfile +1 -1
- data/Gemfile-local +1 -0
- data/LICENSE +1 -1
- data/OLD_CHANGELOG.md +170 -0
- data/README.md +26 -10
- data/Rakefile +22 -7
- data/app/assets/javascripts/spree/backend/solidus_graphql_api.js +2 -0
- data/app/assets/javascripts/spree/frontend/solidus_graphql_api.js +2 -0
- data/app/assets/stylesheets/spree/backend/solidus_graphql_api.css +4 -0
- data/app/assets/stylesheets/spree/frontend/solidus_graphql_api.css +4 -0
- data/app/controllers/spree/graphql_controller.rb +2 -0
- data/bin/console +2 -2
- data/bin/rails +0 -2
- data/bin/rails-engine +0 -3
- data/bin/rails-sandbox +1 -3
- data/bin/rake +0 -1
- data/bin/sandbox +5 -7
- data/docs/assets/images/graphiql-headers.png +0 -0
- data/docs/assets/images/graphiql-variables.png +0 -0
- data/docs/assets/images/graphiql.png +0 -0
- data/docs/assets/images/menu.png +0 -0
- data/docs/assets/images/navbar.png +0 -0
- data/docs/assets/style.css +1115 -0
- data/docs/assets/webfonts/2C4B9D_B_0.eot +0 -0
- data/docs/assets/webfonts/2C4B9D_B_0.ttf +0 -0
- data/docs/assets/webfonts/2C4B9D_B_0.woff +0 -0
- data/docs/assets/webfonts/2C4B9D_B_0.woff2 +0 -0
- data/docs/assets/webfonts/2C4B9D_C_0.eot +0 -0
- data/docs/assets/webfonts/2C4B9D_C_0.ttf +0 -0
- data/docs/assets/webfonts/2C4B9D_C_0.woff +0 -0
- data/docs/assets/webfonts/2C4B9D_C_0.woff2 +0 -0
- data/docs/assets/webfonts/2C4B9D_D_0.eot +0 -0
- data/docs/assets/webfonts/2C4B9D_D_0.ttf +0 -0
- data/docs/assets/webfonts/2C4B9D_D_0.woff +0 -0
- data/docs/assets/webfonts/2C4B9D_D_0.woff2 +0 -0
- data/docs/assets/webfonts/2C4B9D_E_0.eot +0 -0
- data/docs/assets/webfonts/2C4B9D_E_0.ttf +0 -0
- data/docs/assets/webfonts/2C4B9D_E_0.woff +0 -0
- data/docs/assets/webfonts/2C4B9D_E_0.woff2 +0 -0
- data/docs/directive/deprecated/index.html +1142 -0
- data/docs/directive/include/index.html +1141 -0
- data/docs/directive/index.html +1113 -0
- data/docs/directive/skip/index.html +1141 -0
- data/docs/enum/__directivelocation/index.html +1204 -0
- data/docs/enum/__typekind/index.html +1154 -0
- data/docs/enum/addresstypeinput/index.html +1121 -0
- data/docs/enum/index.html +1113 -0
- data/docs/index.html +1122 -0
- data/docs/input_object/addaddressestocheckoutinput/index.html +1135 -0
- data/docs/input_object/addpaymenttocheckoutinput/index.html +1135 -0
- data/docs/input_object/addressinput/index.html +1169 -0
- data/docs/input_object/addtocartinput/index.html +1130 -0
- data/docs/input_object/advancecheckoutinput/index.html +1120 -0
- data/docs/input_object/applycouponcodeinput/index.html +1125 -0
- data/docs/input_object/completecheckoutinput/index.html +1120 -0
- data/docs/input_object/createorderinput/index.html +1120 -0
- data/docs/input_object/emptycartinput/index.html +1120 -0
- data/docs/input_object/index.html +1113 -0
- data/docs/input_object/markdefaultshipaddressinput/index.html +1125 -0
- data/docs/input_object/nextcheckoutstateinput/index.html +1120 -0
- data/docs/input_object/productsqueryinput/index.html +1132 -0
- data/docs/input_object/removefromaddressbookinput/index.html +1125 -0
- data/docs/input_object/removefromcartinput/index.html +1125 -0
- data/docs/input_object/saveinaddressbookinput/index.html +1135 -0
- data/docs/input_object/selectshippingrateinput/index.html +1125 -0
- data/docs/input_object/setorderemailinput/index.html +1125 -0
- data/docs/input_object/updatecartquantityinput/index.html +1130 -0
- data/docs/interface/adjustment/index.html +1145 -0
- data/docs/interface/index.html +1113 -0
- data/docs/interface/node/index.html +1151 -0
- data/docs/interface/paymentsource/index.html +1134 -0
- data/docs/mutation/addaddressestocheckout/index.html +1137 -0
- data/docs/mutation/addpaymenttocheckout/index.html +1137 -0
- data/docs/mutation/addtocart/index.html +1137 -0
- data/docs/mutation/advancecheckout/index.html +1137 -0
- data/docs/mutation/applycouponcode/index.html +1137 -0
- data/docs/mutation/completecheckout/index.html +1137 -0
- data/docs/mutation/createorder/index.html +1137 -0
- data/docs/mutation/emptycart/index.html +1137 -0
- data/docs/mutation/markdefaultshipaddress/index.html +1132 -0
- data/docs/mutation/nextcheckoutstate/index.html +1137 -0
- data/docs/mutation/removefromaddressbook/index.html +1132 -0
- data/docs/mutation/removefromcart/index.html +1137 -0
- data/docs/mutation/saveinaddressbook/index.html +1137 -0
- data/docs/mutation/selectshippingrate/index.html +1137 -0
- data/docs/mutation/setorderemail/index.html +1137 -0
- data/docs/mutation/updatecartquantity/index.html +1137 -0
- data/docs/object/__directive/index.html +1182 -0
- data/docs/object/__enumvalue/index.html +1134 -0
- data/docs/object/__field/index.html +1164 -0
- data/docs/object/__inputvalue/index.html +1145 -0
- data/docs/object/__schema/index.html +1144 -0
- data/docs/object/__type/index.html +1220 -0
- data/docs/object/addaddressestocheckoutpayload/index.html +1130 -0
- data/docs/object/addpaymenttocheckoutpayload/index.html +1130 -0
- data/docs/object/address/index.html +1189 -0
- data/docs/object/addressconnection/index.html +1132 -0
- data/docs/object/addressedge/index.html +1126 -0
- data/docs/object/addtocartpayload/index.html +1130 -0
- data/docs/object/adjustmentconnection/index.html +1132 -0
- data/docs/object/adjustmentedge/index.html +1126 -0
- data/docs/object/advancecheckoutpayload/index.html +1130 -0
- data/docs/object/applycouponcodepayload/index.html +1130 -0
- data/docs/object/completecheckoutpayload/index.html +1130 -0
- data/docs/object/country/index.html +1218 -0
- data/docs/object/countryconnection/index.html +1132 -0
- data/docs/object/countryedge/index.html +1126 -0
- data/docs/object/createorderpayload/index.html +1130 -0
- data/docs/object/creditcard/index.html +1170 -0
- data/docs/object/currency/index.html +1144 -0
- data/docs/object/currencyconnection/index.html +1132 -0
- data/docs/object/currencyedge/index.html +1126 -0
- data/docs/object/emptycartpayload/index.html +1130 -0
- data/docs/object/image/index.html +1169 -0
- data/docs/object/imageconnection/index.html +1132 -0
- data/docs/object/imageedge/index.html +1126 -0
- data/docs/object/index.html +1113 -0
- data/docs/object/lineitem/index.html +1184 -0
- data/docs/object/lineitemconnection/index.html +1132 -0
- data/docs/object/lineitemedge/index.html +1126 -0
- data/docs/object/manifestitem/index.html +1124 -0
- data/docs/object/markdefaultshipaddresspayload/index.html +1125 -0
- data/docs/object/nextcheckoutstatepayload/index.html +1130 -0
- data/docs/object/optiontype/index.html +1203 -0
- data/docs/object/optiontypeconnection/index.html +1132 -0
- data/docs/object/optiontypeedge/index.html +1126 -0
- data/docs/object/optionvalue/index.html +1154 -0
- data/docs/object/optionvalueconnection/index.html +1132 -0
- data/docs/object/optionvalueedge/index.html +1126 -0
- data/docs/object/order/index.html +1412 -0
- data/docs/object/orderconnection/index.html +1132 -0
- data/docs/object/orderedge/index.html +1126 -0
- data/docs/object/pageinfo/index.html +1138 -0
- data/docs/object/payment/index.html +1149 -0
- data/docs/object/paymentmethod/index.html +1149 -0
- data/docs/object/price/index.html +1159 -0
- data/docs/object/priceconnection/index.html +1132 -0
- data/docs/object/priceedge/index.html +1126 -0
- data/docs/object/product/index.html +1327 -0
- data/docs/object/productconnection/index.html +1132 -0
- data/docs/object/productedge/index.html +1126 -0
- data/docs/object/productproperty/index.html +1149 -0
- data/docs/object/productpropertyconnection/index.html +1132 -0
- data/docs/object/productpropertyedge/index.html +1126 -0
- data/docs/object/promotionadjustment/index.html +1155 -0
- data/docs/object/property/index.html +1144 -0
- data/docs/object/removefromaddressbookpayload/index.html +1125 -0
- data/docs/object/removefromcartpayload/index.html +1130 -0
- data/docs/object/saveinaddressbookpayload/index.html +1130 -0
- data/docs/object/selectshippingratepayload/index.html +1130 -0
- data/docs/object/setorderemailpayload/index.html +1130 -0
- data/docs/object/shipment/index.html +1218 -0
- data/docs/object/shipmentconnection/index.html +1132 -0
- data/docs/object/shipmentedge/index.html +1126 -0
- data/docs/object/shippingmethod/index.html +1174 -0
- data/docs/object/shippingrate/index.html +1154 -0
- data/docs/object/shippingrateconnection/index.html +1132 -0
- data/docs/object/shippingrateedge/index.html +1126 -0
- data/docs/object/state/index.html +1144 -0
- data/docs/object/stateconnection/index.html +1132 -0
- data/docs/object/stateedge/index.html +1126 -0
- data/docs/object/store/index.html +1238 -0
- data/docs/object/taxadjustment/index.html +1150 -0
- data/docs/object/taxon/index.html +1228 -0
- data/docs/object/taxonconnection/index.html +1132 -0
- data/docs/object/taxonedge/index.html +1126 -0
- data/docs/object/taxonomy/index.html +1198 -0
- data/docs/object/taxonomyconnection/index.html +1132 -0
- data/docs/object/taxonomyedge/index.html +1126 -0
- data/docs/object/updatecartquantitypayload/index.html +1130 -0
- data/docs/object/user/index.html +1280 -0
- data/docs/object/usererror/index.html +1126 -0
- data/docs/object/variant/index.html +1332 -0
- data/docs/object/variantconnection/index.html +1132 -0
- data/docs/object/variantedge/index.html +1126 -0
- data/docs/object/walletpaymentsource/index.html +1144 -0
- data/docs/object/walletpaymentsourceconnection/index.html +1132 -0
- data/docs/object/walletpaymentsourceedge/index.html +1126 -0
- data/docs/operation/mutation/index.html +1114 -0
- data/docs/operation/query/index.html +1431 -0
- data/docs/scalar/boolean/index.html +1112 -0
- data/docs/scalar/float/index.html +1112 -0
- data/docs/scalar/id/index.html +1112 -0
- data/docs/scalar/index.html +1113 -0
- data/docs/scalar/int/index.html +1112 -0
- data/docs/scalar/iso8601datetime/index.html +1112 -0
- data/docs/scalar/json/index.html +1112 -0
- data/docs/scalar/string/index.html +1112 -0
- data/docs/union/index.html +1113 -0
- data/lib/generators/solidus_graphql_api/install/install_generator.rb +19 -0
- data/lib/generators/solidus_graphql_api/install/templates/initializer.rb +6 -0
- data/lib/graphql_docs/landing_pages/index.md +16 -0
- data/lib/solidus_graphql_api/batch_loader/has_many_through.rb +1 -0
- data/lib/solidus_graphql_api/batch_loader.rb +1 -1
- data/lib/solidus_graphql_api/configuration.rb +12 -8
- data/lib/solidus_graphql_api/context.rb +8 -2
- data/lib/solidus_graphql_api/engine.rb +2 -2
- data/lib/solidus_graphql_api/mutations/base_mutation.rb +3 -3
- data/lib/solidus_graphql_api/mutations/checkout/add_payment_to_checkout.rb +1 -1
- data/lib/solidus_graphql_api/mutations/user/{mark_default_address.rb → mark_default_ship_address.rb} +2 -2
- data/lib/solidus_graphql_api/mutations/user/save_in_address_book.rb +8 -2
- data/lib/solidus_graphql_api/queries/option_value/option_type_query.rb +19 -0
- data/lib/solidus_graphql_api/queries/shipping_rate/shipping_method_query.rb +19 -0
- data/lib/solidus_graphql_api/queries/taxon/children_query.rb +1 -1
- data/lib/solidus_graphql_api/queries/taxonomy/taxons_query.rb +1 -1
- data/lib/solidus_graphql_api/queries/variant/default_price_query.rb +1 -1
- data/lib/solidus_graphql_api/{factories → testing_support/factories}/address_factory.rb +1 -2
- data/lib/solidus_graphql_api/{factories → testing_support/factories}/taxonomy_factory.rb +10 -0
- data/lib/solidus_graphql_api/testing_support/factories.rb +9 -0
- data/lib/solidus_graphql_api/types/address.rb +1 -2
- data/lib/solidus_graphql_api/types/base/relay_node.rb +1 -1
- data/lib/solidus_graphql_api/types/input_objects/address_input.rb +1 -2
- data/lib/solidus_graphql_api/types/json.rb +6 -3
- data/lib/solidus_graphql_api/types/mutation.rb +1 -1
- data/lib/solidus_graphql_api/types/option_value.rb +5 -0
- data/lib/solidus_graphql_api/types/query.rb +2 -2
- data/lib/solidus_graphql_api/types/shipping_method.rb +20 -0
- data/lib/solidus_graphql_api/types/shipping_rate.rb +5 -0
- data/lib/solidus_graphql_api/types/user.rb +1 -1
- data/lib/solidus_graphql_api/version.rb +1 -1
- data/lib/solidus_graphql_api.rb +0 -3
- data/schema.graphql +128 -26
- data/solidus_graphql_api.gemspec +12 -12
- data/spec/integration/mutations/checkout/add_addresses_to_checkout_spec.rb +13 -19
- data/spec/integration/mutations/checkout/apply_coupon_code_spec.rb +3 -1
- data/spec/integration/mutations/{mark_default_address_spec.rb → mark_default_ship_address_spec.rb} +5 -5
- data/spec/integration/mutations/remove_from_address_book_spec.rb +4 -4
- data/spec/integration/mutations/save_in_address_book_spec.rb +25 -12
- data/spec/integration/queries/completed_orders_spec.rb +19 -15
- data/spec/integration/queries/countries_spec.rb +2 -2
- data/spec/integration/queries/current_order_spec.rb +4 -1
- data/spec/integration/queries/current_store_spec.rb +1 -1
- data/spec/integration/queries/current_user_spec.rb +7 -2
- data/spec/integration/queries/products_spec.rb +4 -1
- data/spec/integration/queries/taxonomies_spec.rb +12 -4
- data/spec/integration/types/json_spec.rb +17 -0
- data/spec/lib/solidus_graphql_api/batch_loader/belongs_to_spec.rb +24 -25
- data/spec/lib/solidus_graphql_api/batch_loader/has_many_spec.rb +17 -15
- data/spec/lib/solidus_graphql_api/batch_loader/has_many_through_spec.rb +42 -25
- data/spec/lib/solidus_graphql_api/batch_loader/has_one_spec.rb +17 -15
- data/spec/lib/solidus_graphql_api/context_spec.rb +119 -6
- data/spec/lib/solidus_graphql_api/queries/option_value/option_type_query_spec.rb +10 -0
- data/spec/lib/solidus_graphql_api/queries/shipping_rate/shipping_method_query_spec.rb +11 -0
- data/spec/lib/solidus_graphql_api/queries/taxon/children_query_spec.rb +9 -5
- data/spec/lib/solidus_graphql_api/queries/taxonomy/taxons_query_spec.rb +8 -5
- data/spec/lib/solidus_graphql_api/queries/variant/default_price_query_spec.rb +1 -1
- data/spec/lib/solidus_graphql_api/types/base/object_spec.rb +5 -1
- data/spec/lib/solidus_graphql_api/types/json_spec.rb +2 -1
- data/spec/lib/solidus_graphql_api/types/option_value_spec.rb +22 -0
- data/spec/lib/solidus_graphql_api/types/product_spec.rb +3 -1
- data/spec/lib/solidus_graphql_api/types/query_spec.rb +3 -1
- data/spec/lib/solidus_graphql_api/types/shipping_rate_spec.rb +22 -0
- data/spec/requests/spree/graphql_controller_spec.rb +15 -2
- data/spec/spec_helper.rb +20 -12
- data/spec/support/expected_schema.graphql +128 -26
- data/spec/support/graphql/mutations/add_addresses_to_checkout.gql +2 -2
- data/spec/support/graphql/mutations/mark_default_ship_address.gql +9 -0
- data/spec/support/graphql/mutations/remove_from_address_book.gql +1 -1
- data/spec/support/graphql/mutations/save_in_address_book.gql +6 -5
- data/spec/support/graphql/queries/completed_orders/billing_address.gql +1 -2
- data/spec/support/graphql/queries/completed_orders/shipping_address.gql +1 -2
- data/spec/support/graphql/queries/current_user.gql +6 -11
- data/spec/support/graphql/responses/completed_orders/billing_address.json.erb +2 -4
- data/spec/support/graphql/responses/completed_orders/shipping_address.json.erb +2 -4
- data/spec/support/graphql/responses/current_store.json.erb +1 -1
- data/spec/support/graphql/responses/current_user.json.erb +7 -13
- data/spec/support/graphql/responses/taxonomies.json.erb +7 -7
- data/spec/support/helpers/active_record.rb +18 -0
- data/spec/support/helpers/graphql.rb +4 -4
- metadata +245 -54
- data/lib/solidus_graphql_api/factories.rb +0 -11
- data/spec/support/graphql/mutations/mark_default_address.gql +0 -9
- /data/lib/solidus_graphql_api/{factories → testing_support/factories}/country_factory.rb +0 -0
- /data/lib/solidus_graphql_api/{factories → testing_support/factories}/store_factory.rb +0 -0
|
@@ -7,11 +7,24 @@ RSpec.describe Spree::GraphqlController do
|
|
|
7
7
|
|
|
8
8
|
before { allow_any_instance_of(SolidusGraphqlApi::Context).to receive(:to_h).and_return(context) }
|
|
9
9
|
|
|
10
|
-
after { post '/graphql', headers: headers }
|
|
11
|
-
|
|
12
10
|
it 'passes the right context to the schema' do
|
|
13
11
|
expect(SolidusGraphqlApi::Schema).to receive(:execute).with(
|
|
14
12
|
nil, hash_including(context: context)
|
|
15
13
|
)
|
|
14
|
+
|
|
15
|
+
post '/graphql', headers: headers
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
it 'can return blob URLs on disk storage' do
|
|
19
|
+
product = create(:product)
|
|
20
|
+
product.images.create(attributes_for(:image))
|
|
21
|
+
|
|
22
|
+
post '/graphql',
|
|
23
|
+
params: {
|
|
24
|
+
query: "{ productBySlug(slug: \"#{product.slug}\") { masterVariant { images { nodes { smallUrl } } } } }"
|
|
25
|
+
},
|
|
26
|
+
headers: headers
|
|
27
|
+
|
|
28
|
+
expect(JSON.parse(response.body).dig(*%w[data productBySlug masterVariant images nodes])[0]['smallUrl']).to match('http://')
|
|
16
29
|
end
|
|
17
30
|
end
|
data/spec/spec_helper.rb
CHANGED
|
@@ -6,24 +6,22 @@ ENV['RAILS_ENV'] = 'test'
|
|
|
6
6
|
# Run Coverage report
|
|
7
7
|
require 'solidus_dev_support/rspec/coverage'
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
# Create the dummy app if it's still missing.
|
|
10
|
+
dummy_env = "#{__dir__}/dummy/config/environment.rb"
|
|
11
|
+
system 'bin/rake extension:test_app' unless File.exist? dummy_env
|
|
12
|
+
require dummy_env
|
|
13
13
|
|
|
14
14
|
# Requires factories and other useful helpers defined in spree_core.
|
|
15
|
-
require 'solidus_dev_support/rspec/
|
|
16
|
-
require 'pry'
|
|
15
|
+
require 'solidus_dev_support/rspec/feature_helper'
|
|
17
16
|
require "graphql/schema_comparator"
|
|
18
|
-
require 'with_model'
|
|
19
17
|
require 'timecop'
|
|
20
18
|
|
|
21
19
|
# Requires supporting ruby files with custom matchers and macros, etc,
|
|
22
20
|
# in spec/support/ and its subdirectories.
|
|
23
|
-
Dir[
|
|
21
|
+
Dir["#{__dir__}/support/**/*.rb"].sort.each { |f| require f }
|
|
24
22
|
|
|
25
|
-
# Requires factories defined in lib/solidus_graphql_api/factories.rb
|
|
26
|
-
|
|
23
|
+
# Requires factories defined in lib/solidus_graphql_api/testing_support/factories.rb
|
|
24
|
+
SolidusDevSupport::TestingSupport::Factories.load_for(SolidusGraphqlApi::Engine)
|
|
27
25
|
|
|
28
26
|
RSpec.configure do |config|
|
|
29
27
|
config.add_setting :default_freeze_date, default: "21/12/2012 12:00:00"
|
|
@@ -33,6 +31,18 @@ RSpec.configure do |config|
|
|
|
33
31
|
|
|
34
32
|
config.infer_spec_type_from_file_location!
|
|
35
33
|
config.use_transactional_fixtures = false
|
|
34
|
+
|
|
35
|
+
if defined?(ActiveStorage::Current)
|
|
36
|
+
config.before(:all) do
|
|
37
|
+
test_host = 'https://www.example.com'
|
|
38
|
+
if Rails.gem_version >= Gem::Version.new(7)
|
|
39
|
+
ActiveStorage::Current.url_options = { host: test_host }
|
|
40
|
+
else
|
|
41
|
+
ActiveStorage::Current.host = test_host
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
36
46
|
config.include Helpers::Graphql
|
|
37
47
|
config.include Matchers::Graphql
|
|
38
48
|
|
|
@@ -57,6 +67,4 @@ RSpec.configure do |config|
|
|
|
57
67
|
example.run
|
|
58
68
|
end
|
|
59
69
|
end
|
|
60
|
-
|
|
61
|
-
config.extend WithModel
|
|
62
70
|
end
|
|
@@ -85,9 +85,8 @@ type Address implements Node {
|
|
|
85
85
|
company: String
|
|
86
86
|
country: Country!
|
|
87
87
|
createdAt: ISO8601DateTime
|
|
88
|
-
firstname: String!
|
|
89
88
|
id: ID!
|
|
90
|
-
|
|
89
|
+
name: String!
|
|
91
90
|
phone: String!
|
|
92
91
|
state: State
|
|
93
92
|
stateName: String
|
|
@@ -140,14 +139,18 @@ input AddressInput {
|
|
|
140
139
|
city: String!
|
|
141
140
|
company: String
|
|
142
141
|
countryId: ID!
|
|
143
|
-
|
|
144
|
-
lastname: String
|
|
142
|
+
name: String!
|
|
145
143
|
phone: String!
|
|
146
144
|
stateId: ID
|
|
147
145
|
stateName: String
|
|
148
146
|
zipcode: String!
|
|
149
147
|
}
|
|
150
148
|
|
|
149
|
+
enum AddressTypeInput {
|
|
150
|
+
billing
|
|
151
|
+
shipping
|
|
152
|
+
}
|
|
153
|
+
|
|
151
154
|
"""
|
|
152
155
|
Adjustment.
|
|
153
156
|
"""
|
|
@@ -562,9 +565,9 @@ type ManifestItem {
|
|
|
562
565
|
}
|
|
563
566
|
|
|
564
567
|
"""
|
|
565
|
-
Autogenerated input type of
|
|
568
|
+
Autogenerated input type of MarkDefaultShipAddress
|
|
566
569
|
"""
|
|
567
|
-
input
|
|
570
|
+
input MarkDefaultShipAddressInput {
|
|
568
571
|
addressId: ID!
|
|
569
572
|
|
|
570
573
|
"""
|
|
@@ -574,9 +577,9 @@ input MarkDefaultAddressInput {
|
|
|
574
577
|
}
|
|
575
578
|
|
|
576
579
|
"""
|
|
577
|
-
Autogenerated return type of
|
|
580
|
+
Autogenerated return type of MarkDefaultShipAddress
|
|
578
581
|
"""
|
|
579
|
-
type
|
|
582
|
+
type MarkDefaultShipAddressPayload {
|
|
580
583
|
"""
|
|
581
584
|
A unique identifier for the client performing the mutation.
|
|
582
585
|
"""
|
|
@@ -585,22 +588,102 @@ type MarkDefaultAddressPayload {
|
|
|
585
588
|
}
|
|
586
589
|
|
|
587
590
|
type Mutation {
|
|
588
|
-
addAddressesToCheckout(
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
591
|
+
addAddressesToCheckout(
|
|
592
|
+
"""
|
|
593
|
+
Parameters for AddAddressesToCheckout
|
|
594
|
+
"""
|
|
595
|
+
input: AddAddressesToCheckoutInput!
|
|
596
|
+
): AddAddressesToCheckoutPayload
|
|
597
|
+
addPaymentToCheckout(
|
|
598
|
+
"""
|
|
599
|
+
Parameters for AddPaymentToCheckout
|
|
600
|
+
"""
|
|
601
|
+
input: AddPaymentToCheckoutInput!
|
|
602
|
+
): AddPaymentToCheckoutPayload
|
|
603
|
+
addToCart(
|
|
604
|
+
"""
|
|
605
|
+
Parameters for AddToCart
|
|
606
|
+
"""
|
|
607
|
+
input: AddToCartInput!
|
|
608
|
+
): AddToCartPayload
|
|
609
|
+
advanceCheckout(
|
|
610
|
+
"""
|
|
611
|
+
Parameters for AdvanceCheckout
|
|
612
|
+
"""
|
|
613
|
+
input: AdvanceCheckoutInput!
|
|
614
|
+
): AdvanceCheckoutPayload
|
|
615
|
+
applyCouponCode(
|
|
616
|
+
"""
|
|
617
|
+
Parameters for ApplyCouponCode
|
|
618
|
+
"""
|
|
619
|
+
input: ApplyCouponCodeInput!
|
|
620
|
+
): ApplyCouponCodePayload
|
|
621
|
+
completeCheckout(
|
|
622
|
+
"""
|
|
623
|
+
Parameters for CompleteCheckout
|
|
624
|
+
"""
|
|
625
|
+
input: CompleteCheckoutInput!
|
|
626
|
+
): CompleteCheckoutPayload
|
|
627
|
+
createOrder(
|
|
628
|
+
"""
|
|
629
|
+
Parameters for CreateOrder
|
|
630
|
+
"""
|
|
631
|
+
input: CreateOrderInput!
|
|
632
|
+
): CreateOrderPayload
|
|
633
|
+
emptyCart(
|
|
634
|
+
"""
|
|
635
|
+
Parameters for EmptyCart
|
|
636
|
+
"""
|
|
637
|
+
input: EmptyCartInput!
|
|
638
|
+
): EmptyCartPayload
|
|
639
|
+
markDefaultShipAddress(
|
|
640
|
+
"""
|
|
641
|
+
Parameters for MarkDefaultShipAddress
|
|
642
|
+
"""
|
|
643
|
+
input: MarkDefaultShipAddressInput!
|
|
644
|
+
): MarkDefaultShipAddressPayload
|
|
645
|
+
nextCheckoutState(
|
|
646
|
+
"""
|
|
647
|
+
Parameters for NextCheckoutState
|
|
648
|
+
"""
|
|
649
|
+
input: NextCheckoutStateInput!
|
|
650
|
+
): NextCheckoutStatePayload
|
|
651
|
+
removeFromAddressBook(
|
|
652
|
+
"""
|
|
653
|
+
Parameters for RemoveFromAddressBook
|
|
654
|
+
"""
|
|
655
|
+
input: RemoveFromAddressBookInput!
|
|
656
|
+
): RemoveFromAddressBookPayload
|
|
657
|
+
removeFromCart(
|
|
658
|
+
"""
|
|
659
|
+
Parameters for RemoveFromCart
|
|
660
|
+
"""
|
|
661
|
+
input: RemoveFromCartInput!
|
|
662
|
+
): RemoveFromCartPayload
|
|
663
|
+
saveInAddressBook(
|
|
664
|
+
"""
|
|
665
|
+
Parameters for SaveInAddressBook
|
|
666
|
+
"""
|
|
667
|
+
input: SaveInAddressBookInput!
|
|
668
|
+
): SaveInAddressBookPayload
|
|
669
|
+
selectShippingRate(
|
|
670
|
+
"""
|
|
671
|
+
Parameters for SelectShippingRate
|
|
672
|
+
"""
|
|
673
|
+
input: SelectShippingRateInput!
|
|
674
|
+
): SelectShippingRatePayload
|
|
675
|
+
setOrderEmail(
|
|
676
|
+
"""
|
|
677
|
+
Parameters for SetOrderEmail
|
|
678
|
+
"""
|
|
679
|
+
input: SetOrderEmailInput!
|
|
680
|
+
): SetOrderEmailPayload
|
|
681
|
+
updateCartQuantity(
|
|
682
|
+
"""
|
|
683
|
+
Parameters for UpdateCartQuantity
|
|
684
|
+
"""
|
|
685
|
+
input: UpdateCartQuantityInput!
|
|
686
|
+
): UpdateCartQuantityPayload
|
|
604
687
|
}
|
|
605
688
|
|
|
606
689
|
"""
|
|
@@ -710,6 +793,7 @@ type OptionValue implements Node {
|
|
|
710
793
|
createdAt: ISO8601DateTime
|
|
711
794
|
id: ID!
|
|
712
795
|
name: String!
|
|
796
|
+
optionType: OptionType!
|
|
713
797
|
position: String!
|
|
714
798
|
presentation: String!
|
|
715
799
|
updatedAt: ISO8601DateTime
|
|
@@ -1387,6 +1471,7 @@ Autogenerated input type of SaveInAddressBook
|
|
|
1387
1471
|
"""
|
|
1388
1472
|
input SaveInAddressBookInput {
|
|
1389
1473
|
address: AddressInput!
|
|
1474
|
+
addressType: AddressTypeInput = shipping
|
|
1390
1475
|
|
|
1391
1476
|
"""
|
|
1392
1477
|
A unique identifier for the client performing the mutation.
|
|
@@ -1524,6 +1609,23 @@ type ShipmentEdge {
|
|
|
1524
1609
|
node: Shipment
|
|
1525
1610
|
}
|
|
1526
1611
|
|
|
1612
|
+
"""
|
|
1613
|
+
Shipping Method.
|
|
1614
|
+
"""
|
|
1615
|
+
type ShippingMethod implements Node {
|
|
1616
|
+
adminName: String
|
|
1617
|
+
availableToAll: Boolean!
|
|
1618
|
+
availableToUsers: Boolean!
|
|
1619
|
+
carrier: String
|
|
1620
|
+
code: String
|
|
1621
|
+
createdAt: ISO8601DateTime
|
|
1622
|
+
id: ID!
|
|
1623
|
+
name: String!
|
|
1624
|
+
serviceLevel: String
|
|
1625
|
+
trackingUrl: String
|
|
1626
|
+
updatedAt: ISO8601DateTime
|
|
1627
|
+
}
|
|
1628
|
+
|
|
1527
1629
|
"""
|
|
1528
1630
|
Shipping Rate.
|
|
1529
1631
|
"""
|
|
@@ -1533,6 +1635,7 @@ type ShippingRate implements Node {
|
|
|
1533
1635
|
currency: String!
|
|
1534
1636
|
id: ID!
|
|
1535
1637
|
selected: Boolean!
|
|
1638
|
+
shippingMethod: ShippingMethod!
|
|
1536
1639
|
updatedAt: ISO8601DateTime
|
|
1537
1640
|
}
|
|
1538
1641
|
|
|
@@ -1861,7 +1964,6 @@ type User implements Node {
|
|
|
1861
1964
|
billAddress: Address
|
|
1862
1965
|
createdAt: ISO8601DateTime
|
|
1863
1966
|
currentSignInAt: ISO8601DateTime
|
|
1864
|
-
defaultAddress: Address
|
|
1865
1967
|
email: String!
|
|
1866
1968
|
id: ID!
|
|
1867
1969
|
lastSignInAt: ISO8601DateTime
|
|
@@ -2067,4 +2169,4 @@ type WalletPaymentSourceEdge {
|
|
|
2067
2169
|
The item at the end of the edge.
|
|
2068
2170
|
"""
|
|
2069
2171
|
node: WalletPaymentSource
|
|
2070
|
-
}
|
|
2172
|
+
}
|
|
@@ -2,7 +2,7 @@ mutation ($input: SaveInAddressBookInput!) {
|
|
|
2
2
|
saveInAddressBook(input: $input) {
|
|
3
3
|
user {
|
|
4
4
|
email
|
|
5
|
-
|
|
5
|
+
shipAddress {
|
|
6
6
|
address1
|
|
7
7
|
address2
|
|
8
8
|
alternativePhone
|
|
@@ -13,8 +13,7 @@ mutation ($input: SaveInAddressBookInput!) {
|
|
|
13
13
|
name
|
|
14
14
|
}
|
|
15
15
|
createdAt
|
|
16
|
-
|
|
17
|
-
lastname
|
|
16
|
+
name
|
|
18
17
|
phone
|
|
19
18
|
stateName
|
|
20
19
|
state {
|
|
@@ -24,6 +23,9 @@ mutation ($input: SaveInAddressBookInput!) {
|
|
|
24
23
|
updatedAt
|
|
25
24
|
zipcode
|
|
26
25
|
}
|
|
26
|
+
billAddress {
|
|
27
|
+
name
|
|
28
|
+
}
|
|
27
29
|
addresses {
|
|
28
30
|
nodes {
|
|
29
31
|
address1
|
|
@@ -36,8 +38,7 @@ mutation ($input: SaveInAddressBookInput!) {
|
|
|
36
38
|
name
|
|
37
39
|
}
|
|
38
40
|
createdAt
|
|
39
|
-
|
|
40
|
-
lastname
|
|
41
|
+
name
|
|
41
42
|
phone
|
|
42
43
|
stateName
|
|
43
44
|
state {
|
|
@@ -18,9 +18,8 @@ query {
|
|
|
18
18
|
updatedAt
|
|
19
19
|
}
|
|
20
20
|
createdAt
|
|
21
|
-
|
|
21
|
+
name
|
|
22
22
|
id
|
|
23
|
-
lastname
|
|
24
23
|
phone
|
|
25
24
|
state {
|
|
26
25
|
name
|
|
@@ -50,9 +49,8 @@ query {
|
|
|
50
49
|
updatedAt
|
|
51
50
|
}
|
|
52
51
|
createdAt
|
|
53
|
-
|
|
52
|
+
name
|
|
54
53
|
id
|
|
55
|
-
lastname
|
|
56
54
|
phone
|
|
57
55
|
state {
|
|
58
56
|
name
|
|
@@ -66,7 +64,7 @@ query {
|
|
|
66
64
|
}
|
|
67
65
|
createdAt
|
|
68
66
|
currentSignInAt
|
|
69
|
-
|
|
67
|
+
shipAddress {
|
|
70
68
|
address1
|
|
71
69
|
address2
|
|
72
70
|
alternativePhone
|
|
@@ -83,9 +81,8 @@ query {
|
|
|
83
81
|
updatedAt
|
|
84
82
|
}
|
|
85
83
|
createdAt
|
|
86
|
-
|
|
84
|
+
name
|
|
87
85
|
id
|
|
88
|
-
lastname
|
|
89
86
|
phone
|
|
90
87
|
state {
|
|
91
88
|
name
|
|
@@ -118,9 +115,8 @@ query {
|
|
|
118
115
|
updatedAt
|
|
119
116
|
}
|
|
120
117
|
createdAt
|
|
121
|
-
|
|
118
|
+
name
|
|
122
119
|
id
|
|
123
|
-
lastname
|
|
124
120
|
phone
|
|
125
121
|
state {
|
|
126
122
|
name
|
|
@@ -159,9 +155,8 @@ query {
|
|
|
159
155
|
updatedAt
|
|
160
156
|
}
|
|
161
157
|
createdAt
|
|
162
|
-
|
|
158
|
+
name
|
|
163
159
|
id
|
|
164
|
-
lastname
|
|
165
160
|
phone
|
|
166
161
|
state {
|
|
167
162
|
name
|
|
@@ -22,8 +22,7 @@
|
|
|
22
22
|
"updatedAt": "2012-12-21T12:00:00Z"
|
|
23
23
|
},
|
|
24
24
|
"createdAt": "2012-12-21T12:00:00Z",
|
|
25
|
-
"
|
|
26
|
-
"lastname": null,
|
|
25
|
+
"name": "John Von Doe",
|
|
27
26
|
"phone": "555-555-0199",
|
|
28
27
|
"state": {
|
|
29
28
|
"id": 2,
|
|
@@ -57,8 +56,7 @@
|
|
|
57
56
|
"updatedAt": "2012-12-21T12:00:00Z"
|
|
58
57
|
},
|
|
59
58
|
"createdAt": "2012-12-21T12:00:00Z",
|
|
60
|
-
"
|
|
61
|
-
"lastname": null,
|
|
59
|
+
"name": "John Von Doe",
|
|
62
60
|
"phone": "555-555-0199",
|
|
63
61
|
"state": {
|
|
64
62
|
"id": 4,
|
|
@@ -22,8 +22,7 @@
|
|
|
22
22
|
"updatedAt": "2012-12-21T12:00:00Z"
|
|
23
23
|
},
|
|
24
24
|
"createdAt": "2012-12-21T12:00:00Z",
|
|
25
|
-
"
|
|
26
|
-
"lastname": null,
|
|
25
|
+
"name": "John Von Doe",
|
|
27
26
|
"phone": "555-555-0199",
|
|
28
27
|
"state": {
|
|
29
28
|
"id": 1,
|
|
@@ -57,8 +56,7 @@
|
|
|
57
56
|
"updatedAt": "2012-12-21T12:00:00Z"
|
|
58
57
|
},
|
|
59
58
|
"createdAt": "2012-12-21T12:00:00Z",
|
|
60
|
-
"
|
|
61
|
-
"lastname": null,
|
|
59
|
+
"name": "John Von Doe",
|
|
62
60
|
"phone": "555-555-0199",
|
|
63
61
|
"state": {
|
|
64
62
|
"id": 3,
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"default": true,
|
|
24
24
|
"defaultCurrency": "USD",
|
|
25
|
-
"mailFromAddress": "
|
|
25
|
+
"mailFromAddress": "solidus_graphql_api@example.org",
|
|
26
26
|
"metaDescription": "store description",
|
|
27
27
|
"metaKeywords": "store, metaKeywords",
|
|
28
28
|
"name": "Solidus Test Store",
|
|
@@ -20,9 +20,8 @@
|
|
|
20
20
|
"updatedAt": "2012-12-21T12:00:00Z"
|
|
21
21
|
},
|
|
22
22
|
"createdAt": "2012-12-21T12:00:00Z",
|
|
23
|
-
"
|
|
23
|
+
"name": "John Von Doe",
|
|
24
24
|
"id": 1,
|
|
25
|
-
"lastname": null,
|
|
26
25
|
"phone": "555-555-0199",
|
|
27
26
|
"state": {
|
|
28
27
|
"name": "Alabama",
|
|
@@ -51,9 +50,8 @@
|
|
|
51
50
|
"updatedAt": "2012-12-21T12:00:00Z"
|
|
52
51
|
},
|
|
53
52
|
"createdAt": "2012-12-21T12:00:00Z",
|
|
54
|
-
"
|
|
53
|
+
"name": "John Von Doe",
|
|
55
54
|
"id": 2,
|
|
56
|
-
"lastname": null,
|
|
57
55
|
"phone": "555-555-0199",
|
|
58
56
|
"state": {
|
|
59
57
|
"name": "Alabama",
|
|
@@ -84,9 +82,8 @@
|
|
|
84
82
|
"updatedAt": "2012-12-21T12:00:00Z"
|
|
85
83
|
},
|
|
86
84
|
"createdAt": "2012-12-21T12:00:00Z",
|
|
87
|
-
"
|
|
85
|
+
"name": "John Von Doe",
|
|
88
86
|
"id": 2,
|
|
89
|
-
"lastname": null,
|
|
90
87
|
"phone": "555-555-0199",
|
|
91
88
|
"state": {
|
|
92
89
|
"name": "Alabama",
|
|
@@ -100,7 +97,7 @@
|
|
|
100
97
|
},
|
|
101
98
|
"createdAt": "2012-12-21T12:00:00Z",
|
|
102
99
|
"currentSignInAt": null,
|
|
103
|
-
"
|
|
100
|
+
"shipAddress": {
|
|
104
101
|
"address1": "A Different Road",
|
|
105
102
|
"address2": "Northwest",
|
|
106
103
|
"alternativePhone": "555-555-0199",
|
|
@@ -117,9 +114,8 @@
|
|
|
117
114
|
"updatedAt": "2012-12-21T12:00:00Z"
|
|
118
115
|
},
|
|
119
116
|
"createdAt": "2012-12-21T12:00:00Z",
|
|
120
|
-
"
|
|
117
|
+
"name": "John Von Doe",
|
|
121
118
|
"id": 1,
|
|
122
|
-
"lastname": null,
|
|
123
119
|
"phone": "555-555-0199",
|
|
124
120
|
"state": {
|
|
125
121
|
"name": "Alabama",
|
|
@@ -152,9 +148,8 @@
|
|
|
152
148
|
"updatedAt": "2012-12-21T12:00:00Z"
|
|
153
149
|
},
|
|
154
150
|
"createdAt": "2012-12-21T12:00:00Z",
|
|
155
|
-
"
|
|
151
|
+
"name": "John Von Doe",
|
|
156
152
|
"id": 1,
|
|
157
|
-
"lastname": null,
|
|
158
153
|
"phone": "555-555-0199",
|
|
159
154
|
"state": {
|
|
160
155
|
"name": "Alabama",
|
|
@@ -193,9 +188,8 @@
|
|
|
193
188
|
"updatedAt": "2012-12-21T12:00:00Z"
|
|
194
189
|
},
|
|
195
190
|
"createdAt": "2012-12-21T12:00:00Z",
|
|
196
|
-
"
|
|
191
|
+
"name": "John Von Doe",
|
|
197
192
|
"id": 1,
|
|
198
|
-
"lastname": null,
|
|
199
193
|
"phone": "555-555-0199",
|
|
200
194
|
"state": {
|
|
201
195
|
"name": "Alabama",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"createdAt": "2012-12-21T12:00:00Z",
|
|
18
18
|
"description": null,
|
|
19
|
-
"iconUrl": "
|
|
19
|
+
"iconUrl": "<%= taxon_url %>",
|
|
20
20
|
"id": 3,
|
|
21
21
|
"metaDescription": null,
|
|
22
22
|
"metaKeywords": null,
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"createdAt": "2012-12-21T12:00:00Z",
|
|
34
34
|
"description": "Brand description",
|
|
35
|
-
"iconUrl": "
|
|
35
|
+
"iconUrl": "<%= brand_url %>",
|
|
36
36
|
"id": 1,
|
|
37
37
|
"metaDescription": "Brand meta description",
|
|
38
38
|
"metaKeywords": "Brand meta keywords",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
{
|
|
51
51
|
"createdAt": "2012-12-21T12:00:00Z",
|
|
52
52
|
"description": null,
|
|
53
|
-
"iconUrl": "
|
|
53
|
+
"iconUrl": "<%= taxon_url %>",
|
|
54
54
|
"id": 3,
|
|
55
55
|
"metaDescription": null,
|
|
56
56
|
"metaKeywords": null,
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
},
|
|
67
67
|
"createdAt": "2012-12-21T12:00:00Z",
|
|
68
68
|
"description": "Brand description",
|
|
69
|
-
"iconUrl": "
|
|
69
|
+
"iconUrl": "<%= brand_url %>",
|
|
70
70
|
"id": 1,
|
|
71
71
|
"metaDescription": "Brand meta description",
|
|
72
72
|
"metaKeywords": "Brand meta keywords",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
},
|
|
83
83
|
"createdAt": "2012-12-21T12:00:00Z",
|
|
84
84
|
"description": null,
|
|
85
|
-
"iconUrl": "
|
|
85
|
+
"iconUrl": "<%= taxon_url %>",
|
|
86
86
|
"id": 3,
|
|
87
87
|
"metaDescription": null,
|
|
88
88
|
"metaKeywords": null,
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
},
|
|
109
109
|
"createdAt": "2012-12-21T12:00:00Z",
|
|
110
110
|
"description": null,
|
|
111
|
-
"iconUrl": "
|
|
111
|
+
"iconUrl": "<%= category_url %>",
|
|
112
112
|
"id": 2,
|
|
113
113
|
"metaDescription": null,
|
|
114
114
|
"metaKeywords": null,
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
},
|
|
127
127
|
"createdAt": "2012-12-21T12:00:00Z",
|
|
128
128
|
"description": null,
|
|
129
|
-
"iconUrl": "
|
|
129
|
+
"iconUrl": "<%= category_url %>",
|
|
130
130
|
"id": 2,
|
|
131
131
|
"metaDescription": null,
|
|
132
132
|
"metaKeywords": null,
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Helpers
|
|
4
|
+
module ActiveRecord
|
|
5
|
+
def run_migrations(&block)
|
|
6
|
+
migration = Class.new(::ActiveRecord::Migration[6.1]).tap do |klass|
|
|
7
|
+
klass.define_method(:up, &block)
|
|
8
|
+
end
|
|
9
|
+
::ActiveRecord::Migration.suppress_messages { migration.migrate(:up) }
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def create_model(name, &block)
|
|
13
|
+
stub_const(name, Class.new(ApplicationRecord)).tap do |klass|
|
|
14
|
+
klass.class_eval(&block) if block_given?
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|