solidus_graphql_api 0.1.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (282) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +43 -67
  3. data/.github/dependabot.yml +23 -0
  4. data/.github/stale.yml +3 -3
  5. data/.github_changelog_generator +2 -0
  6. data/.rubocop.yml +10 -4
  7. data/CHANGELOG.md +4 -0
  8. data/CONTRIBUTING.md +5 -5
  9. data/Gemfile +1 -1
  10. data/Gemfile-local +1 -0
  11. data/LICENSE +1 -1
  12. data/OLD_CHANGELOG.md +170 -0
  13. data/README.md +26 -10
  14. data/Rakefile +22 -7
  15. data/app/assets/javascripts/spree/backend/solidus_graphql_api.js +2 -0
  16. data/app/assets/javascripts/spree/frontend/solidus_graphql_api.js +2 -0
  17. data/app/assets/stylesheets/spree/backend/solidus_graphql_api.css +4 -0
  18. data/app/assets/stylesheets/spree/frontend/solidus_graphql_api.css +4 -0
  19. data/app/controllers/spree/graphql_controller.rb +2 -0
  20. data/bin/console +2 -2
  21. data/bin/rails +0 -2
  22. data/bin/rails-engine +0 -3
  23. data/bin/rails-sandbox +1 -3
  24. data/bin/rake +0 -1
  25. data/bin/sandbox +5 -7
  26. data/docs/assets/images/graphiql-headers.png +0 -0
  27. data/docs/assets/images/graphiql-variables.png +0 -0
  28. data/docs/assets/images/graphiql.png +0 -0
  29. data/docs/assets/images/menu.png +0 -0
  30. data/docs/assets/images/navbar.png +0 -0
  31. data/docs/assets/style.css +1115 -0
  32. data/docs/assets/webfonts/2C4B9D_B_0.eot +0 -0
  33. data/docs/assets/webfonts/2C4B9D_B_0.ttf +0 -0
  34. data/docs/assets/webfonts/2C4B9D_B_0.woff +0 -0
  35. data/docs/assets/webfonts/2C4B9D_B_0.woff2 +0 -0
  36. data/docs/assets/webfonts/2C4B9D_C_0.eot +0 -0
  37. data/docs/assets/webfonts/2C4B9D_C_0.ttf +0 -0
  38. data/docs/assets/webfonts/2C4B9D_C_0.woff +0 -0
  39. data/docs/assets/webfonts/2C4B9D_C_0.woff2 +0 -0
  40. data/docs/assets/webfonts/2C4B9D_D_0.eot +0 -0
  41. data/docs/assets/webfonts/2C4B9D_D_0.ttf +0 -0
  42. data/docs/assets/webfonts/2C4B9D_D_0.woff +0 -0
  43. data/docs/assets/webfonts/2C4B9D_D_0.woff2 +0 -0
  44. data/docs/assets/webfonts/2C4B9D_E_0.eot +0 -0
  45. data/docs/assets/webfonts/2C4B9D_E_0.ttf +0 -0
  46. data/docs/assets/webfonts/2C4B9D_E_0.woff +0 -0
  47. data/docs/assets/webfonts/2C4B9D_E_0.woff2 +0 -0
  48. data/docs/directive/deprecated/index.html +1142 -0
  49. data/docs/directive/include/index.html +1141 -0
  50. data/docs/directive/index.html +1113 -0
  51. data/docs/directive/skip/index.html +1141 -0
  52. data/docs/enum/__directivelocation/index.html +1204 -0
  53. data/docs/enum/__typekind/index.html +1154 -0
  54. data/docs/enum/addresstypeinput/index.html +1121 -0
  55. data/docs/enum/index.html +1113 -0
  56. data/docs/index.html +1122 -0
  57. data/docs/input_object/addaddressestocheckoutinput/index.html +1135 -0
  58. data/docs/input_object/addpaymenttocheckoutinput/index.html +1135 -0
  59. data/docs/input_object/addressinput/index.html +1169 -0
  60. data/docs/input_object/addtocartinput/index.html +1130 -0
  61. data/docs/input_object/advancecheckoutinput/index.html +1120 -0
  62. data/docs/input_object/applycouponcodeinput/index.html +1125 -0
  63. data/docs/input_object/completecheckoutinput/index.html +1120 -0
  64. data/docs/input_object/createorderinput/index.html +1120 -0
  65. data/docs/input_object/emptycartinput/index.html +1120 -0
  66. data/docs/input_object/index.html +1113 -0
  67. data/docs/input_object/markdefaultshipaddressinput/index.html +1125 -0
  68. data/docs/input_object/nextcheckoutstateinput/index.html +1120 -0
  69. data/docs/input_object/productsqueryinput/index.html +1132 -0
  70. data/docs/input_object/removefromaddressbookinput/index.html +1125 -0
  71. data/docs/input_object/removefromcartinput/index.html +1125 -0
  72. data/docs/input_object/saveinaddressbookinput/index.html +1135 -0
  73. data/docs/input_object/selectshippingrateinput/index.html +1125 -0
  74. data/docs/input_object/setorderemailinput/index.html +1125 -0
  75. data/docs/input_object/updatecartquantityinput/index.html +1130 -0
  76. data/docs/interface/adjustment/index.html +1145 -0
  77. data/docs/interface/index.html +1113 -0
  78. data/docs/interface/node/index.html +1151 -0
  79. data/docs/interface/paymentsource/index.html +1134 -0
  80. data/docs/mutation/addaddressestocheckout/index.html +1137 -0
  81. data/docs/mutation/addpaymenttocheckout/index.html +1137 -0
  82. data/docs/mutation/addtocart/index.html +1137 -0
  83. data/docs/mutation/advancecheckout/index.html +1137 -0
  84. data/docs/mutation/applycouponcode/index.html +1137 -0
  85. data/docs/mutation/completecheckout/index.html +1137 -0
  86. data/docs/mutation/createorder/index.html +1137 -0
  87. data/docs/mutation/emptycart/index.html +1137 -0
  88. data/docs/mutation/markdefaultshipaddress/index.html +1132 -0
  89. data/docs/mutation/nextcheckoutstate/index.html +1137 -0
  90. data/docs/mutation/removefromaddressbook/index.html +1132 -0
  91. data/docs/mutation/removefromcart/index.html +1137 -0
  92. data/docs/mutation/saveinaddressbook/index.html +1137 -0
  93. data/docs/mutation/selectshippingrate/index.html +1137 -0
  94. data/docs/mutation/setorderemail/index.html +1137 -0
  95. data/docs/mutation/updatecartquantity/index.html +1137 -0
  96. data/docs/object/__directive/index.html +1182 -0
  97. data/docs/object/__enumvalue/index.html +1134 -0
  98. data/docs/object/__field/index.html +1164 -0
  99. data/docs/object/__inputvalue/index.html +1145 -0
  100. data/docs/object/__schema/index.html +1144 -0
  101. data/docs/object/__type/index.html +1220 -0
  102. data/docs/object/addaddressestocheckoutpayload/index.html +1130 -0
  103. data/docs/object/addpaymenttocheckoutpayload/index.html +1130 -0
  104. data/docs/object/address/index.html +1189 -0
  105. data/docs/object/addressconnection/index.html +1132 -0
  106. data/docs/object/addressedge/index.html +1126 -0
  107. data/docs/object/addtocartpayload/index.html +1130 -0
  108. data/docs/object/adjustmentconnection/index.html +1132 -0
  109. data/docs/object/adjustmentedge/index.html +1126 -0
  110. data/docs/object/advancecheckoutpayload/index.html +1130 -0
  111. data/docs/object/applycouponcodepayload/index.html +1130 -0
  112. data/docs/object/completecheckoutpayload/index.html +1130 -0
  113. data/docs/object/country/index.html +1218 -0
  114. data/docs/object/countryconnection/index.html +1132 -0
  115. data/docs/object/countryedge/index.html +1126 -0
  116. data/docs/object/createorderpayload/index.html +1130 -0
  117. data/docs/object/creditcard/index.html +1170 -0
  118. data/docs/object/currency/index.html +1144 -0
  119. data/docs/object/currencyconnection/index.html +1132 -0
  120. data/docs/object/currencyedge/index.html +1126 -0
  121. data/docs/object/emptycartpayload/index.html +1130 -0
  122. data/docs/object/image/index.html +1169 -0
  123. data/docs/object/imageconnection/index.html +1132 -0
  124. data/docs/object/imageedge/index.html +1126 -0
  125. data/docs/object/index.html +1113 -0
  126. data/docs/object/lineitem/index.html +1184 -0
  127. data/docs/object/lineitemconnection/index.html +1132 -0
  128. data/docs/object/lineitemedge/index.html +1126 -0
  129. data/docs/object/manifestitem/index.html +1124 -0
  130. data/docs/object/markdefaultshipaddresspayload/index.html +1125 -0
  131. data/docs/object/nextcheckoutstatepayload/index.html +1130 -0
  132. data/docs/object/optiontype/index.html +1203 -0
  133. data/docs/object/optiontypeconnection/index.html +1132 -0
  134. data/docs/object/optiontypeedge/index.html +1126 -0
  135. data/docs/object/optionvalue/index.html +1154 -0
  136. data/docs/object/optionvalueconnection/index.html +1132 -0
  137. data/docs/object/optionvalueedge/index.html +1126 -0
  138. data/docs/object/order/index.html +1412 -0
  139. data/docs/object/orderconnection/index.html +1132 -0
  140. data/docs/object/orderedge/index.html +1126 -0
  141. data/docs/object/pageinfo/index.html +1138 -0
  142. data/docs/object/payment/index.html +1149 -0
  143. data/docs/object/paymentmethod/index.html +1149 -0
  144. data/docs/object/price/index.html +1159 -0
  145. data/docs/object/priceconnection/index.html +1132 -0
  146. data/docs/object/priceedge/index.html +1126 -0
  147. data/docs/object/product/index.html +1327 -0
  148. data/docs/object/productconnection/index.html +1132 -0
  149. data/docs/object/productedge/index.html +1126 -0
  150. data/docs/object/productproperty/index.html +1149 -0
  151. data/docs/object/productpropertyconnection/index.html +1132 -0
  152. data/docs/object/productpropertyedge/index.html +1126 -0
  153. data/docs/object/promotionadjustment/index.html +1155 -0
  154. data/docs/object/property/index.html +1144 -0
  155. data/docs/object/removefromaddressbookpayload/index.html +1125 -0
  156. data/docs/object/removefromcartpayload/index.html +1130 -0
  157. data/docs/object/saveinaddressbookpayload/index.html +1130 -0
  158. data/docs/object/selectshippingratepayload/index.html +1130 -0
  159. data/docs/object/setorderemailpayload/index.html +1130 -0
  160. data/docs/object/shipment/index.html +1218 -0
  161. data/docs/object/shipmentconnection/index.html +1132 -0
  162. data/docs/object/shipmentedge/index.html +1126 -0
  163. data/docs/object/shippingmethod/index.html +1174 -0
  164. data/docs/object/shippingrate/index.html +1154 -0
  165. data/docs/object/shippingrateconnection/index.html +1132 -0
  166. data/docs/object/shippingrateedge/index.html +1126 -0
  167. data/docs/object/state/index.html +1144 -0
  168. data/docs/object/stateconnection/index.html +1132 -0
  169. data/docs/object/stateedge/index.html +1126 -0
  170. data/docs/object/store/index.html +1238 -0
  171. data/docs/object/taxadjustment/index.html +1150 -0
  172. data/docs/object/taxon/index.html +1228 -0
  173. data/docs/object/taxonconnection/index.html +1132 -0
  174. data/docs/object/taxonedge/index.html +1126 -0
  175. data/docs/object/taxonomy/index.html +1198 -0
  176. data/docs/object/taxonomyconnection/index.html +1132 -0
  177. data/docs/object/taxonomyedge/index.html +1126 -0
  178. data/docs/object/updatecartquantitypayload/index.html +1130 -0
  179. data/docs/object/user/index.html +1280 -0
  180. data/docs/object/usererror/index.html +1126 -0
  181. data/docs/object/variant/index.html +1332 -0
  182. data/docs/object/variantconnection/index.html +1132 -0
  183. data/docs/object/variantedge/index.html +1126 -0
  184. data/docs/object/walletpaymentsource/index.html +1144 -0
  185. data/docs/object/walletpaymentsourceconnection/index.html +1132 -0
  186. data/docs/object/walletpaymentsourceedge/index.html +1126 -0
  187. data/docs/operation/mutation/index.html +1114 -0
  188. data/docs/operation/query/index.html +1431 -0
  189. data/docs/scalar/boolean/index.html +1112 -0
  190. data/docs/scalar/float/index.html +1112 -0
  191. data/docs/scalar/id/index.html +1112 -0
  192. data/docs/scalar/index.html +1113 -0
  193. data/docs/scalar/int/index.html +1112 -0
  194. data/docs/scalar/iso8601datetime/index.html +1112 -0
  195. data/docs/scalar/json/index.html +1112 -0
  196. data/docs/scalar/string/index.html +1112 -0
  197. data/docs/union/index.html +1113 -0
  198. data/lib/generators/solidus_graphql_api/install/install_generator.rb +19 -0
  199. data/lib/generators/solidus_graphql_api/install/templates/initializer.rb +6 -0
  200. data/lib/graphql_docs/landing_pages/index.md +16 -0
  201. data/lib/solidus_graphql_api/batch_loader/has_many_through.rb +1 -0
  202. data/lib/solidus_graphql_api/batch_loader.rb +1 -1
  203. data/lib/solidus_graphql_api/configuration.rb +12 -8
  204. data/lib/solidus_graphql_api/context.rb +8 -2
  205. data/lib/solidus_graphql_api/engine.rb +2 -2
  206. data/lib/solidus_graphql_api/mutations/base_mutation.rb +3 -3
  207. data/lib/solidus_graphql_api/mutations/checkout/add_payment_to_checkout.rb +1 -1
  208. data/lib/solidus_graphql_api/mutations/user/{mark_default_address.rb → mark_default_ship_address.rb} +2 -2
  209. data/lib/solidus_graphql_api/mutations/user/save_in_address_book.rb +8 -2
  210. data/lib/solidus_graphql_api/queries/option_value/option_type_query.rb +19 -0
  211. data/lib/solidus_graphql_api/queries/shipping_rate/shipping_method_query.rb +19 -0
  212. data/lib/solidus_graphql_api/queries/taxon/children_query.rb +1 -1
  213. data/lib/solidus_graphql_api/queries/taxonomy/taxons_query.rb +1 -1
  214. data/lib/solidus_graphql_api/queries/variant/default_price_query.rb +1 -1
  215. data/lib/solidus_graphql_api/{factories → testing_support/factories}/address_factory.rb +1 -2
  216. data/lib/solidus_graphql_api/{factories → testing_support/factories}/taxonomy_factory.rb +10 -0
  217. data/lib/solidus_graphql_api/testing_support/factories.rb +9 -0
  218. data/lib/solidus_graphql_api/types/address.rb +1 -2
  219. data/lib/solidus_graphql_api/types/base/relay_node.rb +1 -1
  220. data/lib/solidus_graphql_api/types/input_objects/address_input.rb +1 -2
  221. data/lib/solidus_graphql_api/types/json.rb +6 -3
  222. data/lib/solidus_graphql_api/types/mutation.rb +1 -1
  223. data/lib/solidus_graphql_api/types/option_value.rb +5 -0
  224. data/lib/solidus_graphql_api/types/query.rb +2 -2
  225. data/lib/solidus_graphql_api/types/shipping_method.rb +20 -0
  226. data/lib/solidus_graphql_api/types/shipping_rate.rb +5 -0
  227. data/lib/solidus_graphql_api/types/user.rb +1 -1
  228. data/lib/solidus_graphql_api/version.rb +1 -1
  229. data/lib/solidus_graphql_api.rb +0 -3
  230. data/schema.graphql +128 -26
  231. data/solidus_graphql_api.gemspec +12 -12
  232. data/spec/integration/mutations/checkout/add_addresses_to_checkout_spec.rb +13 -19
  233. data/spec/integration/mutations/checkout/apply_coupon_code_spec.rb +3 -1
  234. data/spec/integration/mutations/{mark_default_address_spec.rb → mark_default_ship_address_spec.rb} +5 -5
  235. data/spec/integration/mutations/remove_from_address_book_spec.rb +4 -4
  236. data/spec/integration/mutations/save_in_address_book_spec.rb +25 -12
  237. data/spec/integration/queries/completed_orders_spec.rb +19 -15
  238. data/spec/integration/queries/countries_spec.rb +2 -2
  239. data/spec/integration/queries/current_order_spec.rb +4 -1
  240. data/spec/integration/queries/current_store_spec.rb +1 -1
  241. data/spec/integration/queries/current_user_spec.rb +7 -2
  242. data/spec/integration/queries/products_spec.rb +4 -1
  243. data/spec/integration/queries/taxonomies_spec.rb +12 -4
  244. data/spec/integration/types/json_spec.rb +17 -0
  245. data/spec/lib/solidus_graphql_api/batch_loader/belongs_to_spec.rb +24 -25
  246. data/spec/lib/solidus_graphql_api/batch_loader/has_many_spec.rb +17 -15
  247. data/spec/lib/solidus_graphql_api/batch_loader/has_many_through_spec.rb +42 -25
  248. data/spec/lib/solidus_graphql_api/batch_loader/has_one_spec.rb +17 -15
  249. data/spec/lib/solidus_graphql_api/context_spec.rb +119 -6
  250. data/spec/lib/solidus_graphql_api/queries/option_value/option_type_query_spec.rb +10 -0
  251. data/spec/lib/solidus_graphql_api/queries/shipping_rate/shipping_method_query_spec.rb +11 -0
  252. data/spec/lib/solidus_graphql_api/queries/taxon/children_query_spec.rb +9 -5
  253. data/spec/lib/solidus_graphql_api/queries/taxonomy/taxons_query_spec.rb +8 -5
  254. data/spec/lib/solidus_graphql_api/queries/variant/default_price_query_spec.rb +1 -1
  255. data/spec/lib/solidus_graphql_api/types/base/object_spec.rb +5 -1
  256. data/spec/lib/solidus_graphql_api/types/json_spec.rb +2 -1
  257. data/spec/lib/solidus_graphql_api/types/option_value_spec.rb +22 -0
  258. data/spec/lib/solidus_graphql_api/types/product_spec.rb +3 -1
  259. data/spec/lib/solidus_graphql_api/types/query_spec.rb +3 -1
  260. data/spec/lib/solidus_graphql_api/types/shipping_rate_spec.rb +22 -0
  261. data/spec/requests/spree/graphql_controller_spec.rb +15 -2
  262. data/spec/spec_helper.rb +20 -12
  263. data/spec/support/expected_schema.graphql +128 -26
  264. data/spec/support/graphql/mutations/add_addresses_to_checkout.gql +2 -2
  265. data/spec/support/graphql/mutations/mark_default_ship_address.gql +9 -0
  266. data/spec/support/graphql/mutations/remove_from_address_book.gql +1 -1
  267. data/spec/support/graphql/mutations/save_in_address_book.gql +6 -5
  268. data/spec/support/graphql/queries/completed_orders/billing_address.gql +1 -2
  269. data/spec/support/graphql/queries/completed_orders/shipping_address.gql +1 -2
  270. data/spec/support/graphql/queries/current_user.gql +6 -11
  271. data/spec/support/graphql/responses/completed_orders/billing_address.json.erb +2 -4
  272. data/spec/support/graphql/responses/completed_orders/shipping_address.json.erb +2 -4
  273. data/spec/support/graphql/responses/current_store.json.erb +1 -1
  274. data/spec/support/graphql/responses/current_user.json.erb +7 -13
  275. data/spec/support/graphql/responses/taxonomies.json.erb +7 -7
  276. data/spec/support/helpers/active_record.rb +18 -0
  277. data/spec/support/helpers/graphql.rb +4 -4
  278. metadata +245 -54
  279. data/lib/solidus_graphql_api/factories.rb +0 -11
  280. data/spec/support/graphql/mutations/mark_default_address.gql +0 -9
  281. /data/lib/solidus_graphql_api/{factories → testing_support/factories}/country_factory.rb +0 -0
  282. /data/lib/solidus_graphql_api/{factories → testing_support/factories}/store_factory.rb +0 -0
data/bin/rails CHANGED
@@ -1,7 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- # frozen_string_literal: true
4
-
5
3
  if %w[g generate].include? ARGV.first
6
4
  exec "#{__dir__}/rails-engine", *ARGV
7
5
  else
data/bin/rails-engine CHANGED
@@ -1,7 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
-
3
- # frozen_string_literal: true
4
-
5
2
  # This command will automatically be run when you run "rails" with Rails gems
6
3
  # installed from the root of your application.
7
4
 
data/bin/rails-sandbox CHANGED
@@ -1,13 +1,11 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- # frozen_string_literal: true
4
-
5
3
  app_root = 'sandbox'
6
4
 
7
5
  unless File.exist? "#{app_root}/bin/rails"
8
6
  warn 'Creating the sandbox app...'
9
7
  Dir.chdir "#{__dir__}/.." do
10
- system "#{__dir__}/sandbox" or begin # rubocop:disable Style/AndOr
8
+ system "#{__dir__}/sandbox" or begin
11
9
  warn 'Automatic creation of the sandbox app failed'
12
10
  exit 1
13
11
  end
data/bin/rake CHANGED
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
-
3
2
  # frozen_string_literal: true
4
3
 
5
4
  require "rubygems"
data/bin/sandbox CHANGED
@@ -22,7 +22,7 @@ if [ ! -z $SOLIDUS_BRANCH ]
22
22
  then
23
23
  BRANCH=$SOLIDUS_BRANCH
24
24
  else
25
- BRANCH="master"
25
+ BRANCH="main"
26
26
  fi
27
27
 
28
28
  extension_name="solidus_graphql_api"
@@ -50,7 +50,6 @@ fi
50
50
  cd ./sandbox
51
51
  cat <<RUBY >> Gemfile
52
52
  gem 'solidus', github: 'solidusio/solidus', branch: '$BRANCH'
53
- gem 'solidus_auth_devise', '>= 2.1.0'
54
53
  gem 'rails-i18n'
55
54
  gem 'solidus_i18n'
56
55
 
@@ -67,14 +66,13 @@ unbundled bundle install --gemfile Gemfile
67
66
 
68
67
  unbundled bundle exec rake db:drop db:create
69
68
 
70
- unbundled bundle exec rails generate spree:install \
69
+ unbundled bundle exec rails generate solidus:install \
71
70
  --auto-accept \
72
- --user_class=Spree::User \
73
- --enforce_available_locales=true \
74
- --with-authentication=false \
71
+ --authentication=devise \
72
+ --payment-method=none \
75
73
  $@
76
74
 
77
- unbundled bundle exec rails generate solidus:auth:install
75
+ unbundled bundle exec rails generate ${extension_name}:install
78
76
 
79
77
  echo
80
78
  echo "🚀 Sandbox app successfully created for $extension_name!"
Binary file
Binary file
Binary file