solidus_graphql_api 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (253) hide show
  1. checksums.yaml +7 -0
  2. data/.circleci/config.yml +93 -0
  3. data/.gem_release.yml +5 -0
  4. data/.github/stale.yml +17 -0
  5. data/.gitignore +20 -0
  6. data/.rspec +2 -0
  7. data/.rubocop.yml +62 -0
  8. data/CHANGELOG.md +0 -0
  9. data/CONTRIBUTING.md +57 -0
  10. data/Gemfile +33 -0
  11. data/LICENSE +26 -0
  12. data/LICENSE.md +26 -0
  13. data/README.md +245 -0
  14. data/Rakefile +43 -0
  15. data/app/controllers/spree/graphql_controller.rb +49 -0
  16. data/bin/console +17 -0
  17. data/bin/rails +9 -0
  18. data/bin/rails-engine +16 -0
  19. data/bin/rails-sandbox +18 -0
  20. data/bin/rake +8 -0
  21. data/bin/sandbox +84 -0
  22. data/bin/setup +8 -0
  23. data/config/locales/en.yml +6 -0
  24. data/config/routes.rb +5 -0
  25. data/lib/generators/solidus_graphql_api/install/install_generator.rb +8 -0
  26. data/lib/solidus_graphql_api.rb +11 -0
  27. data/lib/solidus_graphql_api/batch_loader.rb +114 -0
  28. data/lib/solidus_graphql_api/batch_loader/belongs_to.rb +30 -0
  29. data/lib/solidus_graphql_api/batch_loader/has_many.rb +24 -0
  30. data/lib/solidus_graphql_api/batch_loader/has_many_through.rb +42 -0
  31. data/lib/solidus_graphql_api/batch_loader/has_one.rb +22 -0
  32. data/lib/solidus_graphql_api/configuration.rb +19 -0
  33. data/lib/solidus_graphql_api/context.rb +76 -0
  34. data/lib/solidus_graphql_api/engine.rb +25 -0
  35. data/lib/solidus_graphql_api/factories.rb +11 -0
  36. data/lib/solidus_graphql_api/factories/address_factory.rb +8 -0
  37. data/lib/solidus_graphql_api/factories/country_factory.rb +12 -0
  38. data/lib/solidus_graphql_api/factories/store_factory.rb +16 -0
  39. data/lib/solidus_graphql_api/factories/taxonomy_factory.rb +26 -0
  40. data/lib/solidus_graphql_api/mutations/.keep +0 -0
  41. data/lib/solidus_graphql_api/mutations/base_mutation.rb +45 -0
  42. data/lib/solidus_graphql_api/mutations/checkout/add_addresses_to_checkout.rb +41 -0
  43. data/lib/solidus_graphql_api/mutations/checkout/add_payment_to_checkout.rb +45 -0
  44. data/lib/solidus_graphql_api/mutations/checkout/add_to_cart.rb +30 -0
  45. data/lib/solidus_graphql_api/mutations/checkout/advance_checkout.rb +27 -0
  46. data/lib/solidus_graphql_api/mutations/checkout/apply_coupon_code.rb +32 -0
  47. data/lib/solidus_graphql_api/mutations/checkout/complete_checkout.rb +31 -0
  48. data/lib/solidus_graphql_api/mutations/checkout/create_order.rb +27 -0
  49. data/lib/solidus_graphql_api/mutations/checkout/empty_cart.rb +29 -0
  50. data/lib/solidus_graphql_api/mutations/checkout/next_checkout_state.rb +27 -0
  51. data/lib/solidus_graphql_api/mutations/checkout/remove_from_cart.rb +33 -0
  52. data/lib/solidus_graphql_api/mutations/checkout/select_shipping_rate.rb +40 -0
  53. data/lib/solidus_graphql_api/mutations/checkout/set_order_email.rb +29 -0
  54. data/lib/solidus_graphql_api/mutations/checkout/update_cart_quantity.rb +41 -0
  55. data/lib/solidus_graphql_api/mutations/user/mark_default_address.rb +31 -0
  56. data/lib/solidus_graphql_api/mutations/user/remove_from_address_book.rb +25 -0
  57. data/lib/solidus_graphql_api/mutations/user/save_in_address_book.rb +30 -0
  58. data/lib/solidus_graphql_api/queries/address/country_query.rb +19 -0
  59. data/lib/solidus_graphql_api/queries/address/state_query.rb +19 -0
  60. data/lib/solidus_graphql_api/queries/completed_orders_query.rb +19 -0
  61. data/lib/solidus_graphql_api/queries/countries_query.rb +11 -0
  62. data/lib/solidus_graphql_api/queries/country/states_query.rb +19 -0
  63. data/lib/solidus_graphql_api/queries/line_item/variant_query.rb +19 -0
  64. data/lib/solidus_graphql_api/queries/option_type/option_values_query.rb +19 -0
  65. data/lib/solidus_graphql_api/queries/order/adjustments_query.rb +19 -0
  66. data/lib/solidus_graphql_api/queries/order/billing_address_query.rb +19 -0
  67. data/lib/solidus_graphql_api/queries/order/line_items_query.rb +19 -0
  68. data/lib/solidus_graphql_api/queries/order/payments_query.rb +19 -0
  69. data/lib/solidus_graphql_api/queries/order/shipments_query.rb +19 -0
  70. data/lib/solidus_graphql_api/queries/order/shipping_address_query.rb +19 -0
  71. data/lib/solidus_graphql_api/queries/product/master_variant_query.rb +19 -0
  72. data/lib/solidus_graphql_api/queries/product/option_types_query.rb +19 -0
  73. data/lib/solidus_graphql_api/queries/product/product_properties_query.rb +19 -0
  74. data/lib/solidus_graphql_api/queries/product/variants_query.rb +19 -0
  75. data/lib/solidus_graphql_api/queries/product_by_slug_query.rb +11 -0
  76. data/lib/solidus_graphql_api/queries/product_property/property_query.rb +19 -0
  77. data/lib/solidus_graphql_api/queries/products_query.rb +29 -0
  78. data/lib/solidus_graphql_api/queries/shipment/shipping_rates_query.rb +19 -0
  79. data/lib/solidus_graphql_api/queries/taxon/children_query.rb +19 -0
  80. data/lib/solidus_graphql_api/queries/taxon/parent_taxon_query.rb +19 -0
  81. data/lib/solidus_graphql_api/queries/taxonomies_query.rb +11 -0
  82. data/lib/solidus_graphql_api/queries/taxonomy/root_taxon_query.rb +19 -0
  83. data/lib/solidus_graphql_api/queries/taxonomy/taxons_query.rb +19 -0
  84. data/lib/solidus_graphql_api/queries/variant/default_price_query.rb +19 -0
  85. data/lib/solidus_graphql_api/queries/variant/images_query.rb +19 -0
  86. data/lib/solidus_graphql_api/queries/variant/option_values_query.rb +19 -0
  87. data/lib/solidus_graphql_api/queries/variant/prices_query.rb +19 -0
  88. data/lib/solidus_graphql_api/schema.rb +40 -0
  89. data/lib/solidus_graphql_api/types/.keep +0 -0
  90. data/lib/solidus_graphql_api/types/address.rb +32 -0
  91. data/lib/solidus_graphql_api/types/base/argument.rb +10 -0
  92. data/lib/solidus_graphql_api/types/base/enum.rb +10 -0
  93. data/lib/solidus_graphql_api/types/base/field.rb +13 -0
  94. data/lib/solidus_graphql_api/types/base/input_object.rb +10 -0
  95. data/lib/solidus_graphql_api/types/base/interface.rb +11 -0
  96. data/lib/solidus_graphql_api/types/base/object.rb +25 -0
  97. data/lib/solidus_graphql_api/types/base/relay_node.rb +13 -0
  98. data/lib/solidus_graphql_api/types/base/scalar.rb +10 -0
  99. data/lib/solidus_graphql_api/types/base/union.rb +10 -0
  100. data/lib/solidus_graphql_api/types/country.rb +23 -0
  101. data/lib/solidus_graphql_api/types/credit_card.rb +18 -0
  102. data/lib/solidus_graphql_api/types/currency.rb +14 -0
  103. data/lib/solidus_graphql_api/types/image.rb +27 -0
  104. data/lib/solidus_graphql_api/types/input_objects/address_input.rb +24 -0
  105. data/lib/solidus_graphql_api/types/input_objects/products_query_input.rb +15 -0
  106. data/lib/solidus_graphql_api/types/interfaces/adjustment.rb +32 -0
  107. data/lib/solidus_graphql_api/types/interfaces/payment_source.rb +19 -0
  108. data/lib/solidus_graphql_api/types/json.rb +63 -0
  109. data/lib/solidus_graphql_api/types/line_item.rb +26 -0
  110. data/lib/solidus_graphql_api/types/manifest_item.rb +12 -0
  111. data/lib/solidus_graphql_api/types/mutation.rb +24 -0
  112. data/lib/solidus_graphql_api/types/option_type.rb +22 -0
  113. data/lib/solidus_graphql_api/types/option_value.rb +15 -0
  114. data/lib/solidus_graphql_api/types/order.rb +63 -0
  115. data/lib/solidus_graphql_api/types/payment.rb +15 -0
  116. data/lib/solidus_graphql_api/types/payment_method.rb +15 -0
  117. data/lib/solidus_graphql_api/types/price.rb +21 -0
  118. data/lib/solidus_graphql_api/types/product.rb +38 -0
  119. data/lib/solidus_graphql_api/types/product_property.rb +19 -0
  120. data/lib/solidus_graphql_api/types/promotion_adjustment.rb +17 -0
  121. data/lib/solidus_graphql_api/types/property.rb +14 -0
  122. data/lib/solidus_graphql_api/types/query.rb +84 -0
  123. data/lib/solidus_graphql_api/types/shipment.rb +23 -0
  124. data/lib/solidus_graphql_api/types/shipping_rate.rb +15 -0
  125. data/lib/solidus_graphql_api/types/state.rb +14 -0
  126. data/lib/solidus_graphql_api/types/store.rb +27 -0
  127. data/lib/solidus_graphql_api/types/tax_adjustment.rb +11 -0
  128. data/lib/solidus_graphql_api/types/taxon.rb +33 -0
  129. data/lib/solidus_graphql_api/types/taxonomy.rb +23 -0
  130. data/lib/solidus_graphql_api/types/user.rb +23 -0
  131. data/lib/solidus_graphql_api/types/user_error.rb +12 -0
  132. data/lib/solidus_graphql_api/types/variant.rb +39 -0
  133. data/lib/solidus_graphql_api/types/wallet_payment_source.rb +14 -0
  134. data/lib/solidus_graphql_api/version.rb +5 -0
  135. data/schema.graphql +2070 -0
  136. data/solidus_graphql_api.gemspec +43 -0
  137. data/spec/integration/mutations/add_to_cart_spec.rb +67 -0
  138. data/spec/integration/mutations/checkout/add_addresses_to_checkout_spec.rb +115 -0
  139. data/spec/integration/mutations/checkout/add_payment_to_checkout_spec.rb +87 -0
  140. data/spec/integration/mutations/checkout/advance_checkout_spec.rb +71 -0
  141. data/spec/integration/mutations/checkout/apply_coupon_code_spec.rb +76 -0
  142. data/spec/integration/mutations/checkout/complete_checkout_spec.rb +56 -0
  143. data/spec/integration/mutations/checkout/next_checkout_state_spec.rb +69 -0
  144. data/spec/integration/mutations/checkout/select_shipping_rate_spec.rb +89 -0
  145. data/spec/integration/mutations/create_order_spec.rb +55 -0
  146. data/spec/integration/mutations/empty_cart_spec.rb +58 -0
  147. data/spec/integration/mutations/mark_default_address_spec.rb +33 -0
  148. data/spec/integration/mutations/remove_from_address_book_spec.rb +48 -0
  149. data/spec/integration/mutations/remove_from_cart_spec.rb +65 -0
  150. data/spec/integration/mutations/save_in_address_book_spec.rb +90 -0
  151. data/spec/integration/mutations/set_order_email_spec.rb +61 -0
  152. data/spec/integration/mutations/update_cart_quantity_spec.rb +68 -0
  153. data/spec/integration/queries/completed_orders_spec.rb +158 -0
  154. data/spec/integration/queries/countries_spec.rb +18 -0
  155. data/spec/integration/queries/current_order_spec.rb +15 -0
  156. data/spec/integration/queries/current_store_spec.rb +15 -0
  157. data/spec/integration/queries/current_user_spec.rb +43 -0
  158. data/spec/integration/queries/product_by_slug_spec.rb +42 -0
  159. data/spec/integration/queries/products_spec.rb +40 -0
  160. data/spec/integration/queries/taxonomies_spec.rb +22 -0
  161. data/spec/lib/solidus_graphql_api/batch_loader/belongs_to_spec.rb +67 -0
  162. data/spec/lib/solidus_graphql_api/batch_loader/has_many_spec.rb +38 -0
  163. data/spec/lib/solidus_graphql_api/batch_loader/has_many_through_spec.rb +47 -0
  164. data/spec/lib/solidus_graphql_api/batch_loader/has_one_spec.rb +38 -0
  165. data/spec/lib/solidus_graphql_api/context_spec.rb +236 -0
  166. data/spec/lib/solidus_graphql_api/queries/address/country_query_spec.rb +13 -0
  167. data/spec/lib/solidus_graphql_api/queries/address/state_query_spec.rb +13 -0
  168. data/spec/lib/solidus_graphql_api/queries/completed_orders_query_spec.rb +12 -0
  169. data/spec/lib/solidus_graphql_api/queries/countries_query_spec.rb +11 -0
  170. data/spec/lib/solidus_graphql_api/queries/country/states_query_spec.rb +11 -0
  171. data/spec/lib/solidus_graphql_api/queries/line_item/variant_query_spec.rb +9 -0
  172. data/spec/lib/solidus_graphql_api/queries/option_type/option_values_query_spec.rb +11 -0
  173. data/spec/lib/solidus_graphql_api/queries/order/adjustments_query_spec.rb +10 -0
  174. data/spec/lib/solidus_graphql_api/queries/order/billing_address_query_spec.rb +11 -0
  175. data/spec/lib/solidus_graphql_api/queries/order/line_items_query_spec.rb +9 -0
  176. data/spec/lib/solidus_graphql_api/queries/order/payments_query_spec.rb +9 -0
  177. data/spec/lib/solidus_graphql_api/queries/order/shipments_query_spec.rb +18 -0
  178. data/spec/lib/solidus_graphql_api/queries/order/shipping_address_query_spec.rb +11 -0
  179. data/spec/lib/solidus_graphql_api/queries/product/master_variant_query_spec.rb +11 -0
  180. data/spec/lib/solidus_graphql_api/queries/product/option_types_query_spec.rb +11 -0
  181. data/spec/lib/solidus_graphql_api/queries/product/product_properties_query_spec.rb +11 -0
  182. data/spec/lib/solidus_graphql_api/queries/product/variants_query_spec.rb +11 -0
  183. data/spec/lib/solidus_graphql_api/queries/product_by_slug_query_spec.rb +13 -0
  184. data/spec/lib/solidus_graphql_api/queries/product_property/property_query_spec.rb +11 -0
  185. data/spec/lib/solidus_graphql_api/queries/products_query_spec.rb +49 -0
  186. data/spec/lib/solidus_graphql_api/queries/shipment/shipping_rates_query_spec.rb +18 -0
  187. data/spec/lib/solidus_graphql_api/queries/taxon/children_query_spec.rb +11 -0
  188. data/spec/lib/solidus_graphql_api/queries/taxon/parent_taxon_query_spec.rb +10 -0
  189. data/spec/lib/solidus_graphql_api/queries/taxonomies_query_spec.rb +11 -0
  190. data/spec/lib/solidus_graphql_api/queries/taxonomy/root_taxon_query_spec.rb +10 -0
  191. data/spec/lib/solidus_graphql_api/queries/taxonomy/taxons_query_spec.rb +11 -0
  192. data/spec/lib/solidus_graphql_api/queries/variant/default_price_query_spec.rb +9 -0
  193. data/spec/lib/solidus_graphql_api/queries/variant/images_query_spec.rb +11 -0
  194. data/spec/lib/solidus_graphql_api/queries/variant/option_values_query_spec.rb +11 -0
  195. data/spec/lib/solidus_graphql_api/queries/variant/prices_query_spec.rb +13 -0
  196. data/spec/lib/solidus_graphql_api/schema_spec.rb +80 -0
  197. data/spec/lib/solidus_graphql_api/types/base/object_spec.rb +29 -0
  198. data/spec/lib/solidus_graphql_api/types/json_spec.rb +115 -0
  199. data/spec/lib/solidus_graphql_api/types/option_type_spec.rb +7 -0
  200. data/spec/lib/solidus_graphql_api/types/product_property_spec.rb +22 -0
  201. data/spec/lib/solidus_graphql_api/types/product_spec.rb +56 -0
  202. data/spec/lib/solidus_graphql_api/types/query_spec.rb +33 -0
  203. data/spec/lib/solidus_graphql_api/types/variant_spec.rb +58 -0
  204. data/spec/requests/spree/graphql_controller_spec.rb +17 -0
  205. data/spec/spec_helper.rb +62 -0
  206. data/spec/support/expected_schema.graphql +2070 -0
  207. data/spec/support/graphql/mutations/add_addresses_to_checkout.gql +19 -0
  208. data/spec/support/graphql/mutations/add_payment_to_checkout.gql +13 -0
  209. data/spec/support/graphql/mutations/add_to_cart.gql +21 -0
  210. data/spec/support/graphql/mutations/advance_checkout.gql +13 -0
  211. data/spec/support/graphql/mutations/apply_coupon_code.gql +13 -0
  212. data/spec/support/graphql/mutations/complete_checkout.gql +13 -0
  213. data/spec/support/graphql/mutations/create_order.gql +11 -0
  214. data/spec/support/graphql/mutations/empty_cart.gql +17 -0
  215. data/spec/support/graphql/mutations/mark_default_address.gql +9 -0
  216. data/spec/support/graphql/mutations/next_checkout_state.gql +13 -0
  217. data/spec/support/graphql/mutations/remove_from_address_book.gql +14 -0
  218. data/spec/support/graphql/mutations/remove_from_cart.gql +17 -0
  219. data/spec/support/graphql/mutations/save_in_address_book.gql +57 -0
  220. data/spec/support/graphql/mutations/select_shipping_rate.gql +23 -0
  221. data/spec/support/graphql/mutations/set_order_email.gql +13 -0
  222. data/spec/support/graphql/mutations/update_cart_quantity.gql +18 -0
  223. data/spec/support/graphql/queries/completed_orders.gql +29 -0
  224. data/spec/support/graphql/queries/completed_orders/adjustments.gql +24 -0
  225. data/spec/support/graphql/queries/completed_orders/available_payment_methods.gql +15 -0
  226. data/spec/support/graphql/queries/completed_orders/billing_address.gql +40 -0
  227. data/spec/support/graphql/queries/completed_orders/line_items.gql +23 -0
  228. data/spec/support/graphql/queries/completed_orders/payments.gql +23 -0
  229. data/spec/support/graphql/queries/completed_orders/shipping_address.gql +40 -0
  230. data/spec/support/graphql/queries/countries.gql +24 -0
  231. data/spec/support/graphql/queries/current_order.gql +32 -0
  232. data/spec/support/graphql/queries/current_store.gql +24 -0
  233. data/spec/support/graphql/queries/current_user.gql +197 -0
  234. data/spec/support/graphql/queries/product_by_slug.gql +106 -0
  235. data/spec/support/graphql/queries/products.gql +7 -0
  236. data/spec/support/graphql/queries/taxonomies.gql +81 -0
  237. data/spec/support/graphql/responses/completed_orders.json.erb +58 -0
  238. data/spec/support/graphql/responses/completed_orders/adjustments.json.erb +34 -0
  239. data/spec/support/graphql/responses/completed_orders/available_payment_methods.json.erb +29 -0
  240. data/spec/support/graphql/responses/completed_orders/billing_address.json.erb +78 -0
  241. data/spec/support/graphql/responses/completed_orders/line_items.json.erb +43 -0
  242. data/spec/support/graphql/responses/completed_orders/payments.json.erb +27 -0
  243. data/spec/support/graphql/responses/completed_orders/shipping_address.json.erb +78 -0
  244. data/spec/support/graphql/responses/countries.json.erb +51 -0
  245. data/spec/support/graphql/responses/current_order.json.erb +36 -0
  246. data/spec/support/graphql/responses/current_store.json.erb +34 -0
  247. data/spec/support/graphql/responses/current_user.json.erb +232 -0
  248. data/spec/support/graphql/responses/product_by_slug.json.erb +123 -0
  249. data/spec/support/graphql/responses/taxonomies.json.erb +145 -0
  250. data/spec/support/helpers/graphql.rb +43 -0
  251. data/spec/support/matchers/graphql.rb +35 -0
  252. data/spec/support/shared_contexts/graphql_query_subject.rb +21 -0
  253. metadata +572 -0
@@ -0,0 +1,36 @@
1
+ {
2
+ "data": {
3
+ "currentOrder": {
4
+ "id": 1,
5
+ "number": "fake number",
6
+ "shipments": {
7
+ "nodes": [{
8
+ "createdAt": "2012-12-21T12:00:00Z",
9
+ "number": "<%= shipment_number %>",
10
+ "shippedAt": null,
11
+ "shippingRates": {
12
+ "nodes": [{
13
+ "cost": "100.0",
14
+ "createdAt": "2012-12-21T12:00:00Z",
15
+ "currency": "USD",
16
+ "selected": true,
17
+ "updatedAt": "2012-12-21T12:00:00Z"
18
+ }]
19
+ },
20
+ "manifest": [
21
+ {
22
+ "variant": {
23
+ "sku": "<%= variant_sku %>"
24
+ },
25
+ "quantity": 1
26
+ }
27
+ ],
28
+ "state": "pending",
29
+ "tracking": "U10000",
30
+ "trackingUrl": null,
31
+ "updatedAt": "2012-12-21T12:00:00Z"
32
+ }]
33
+ }
34
+ }
35
+ }
36
+ }
@@ -0,0 +1,34 @@
1
+ {
2
+ "data": {
3
+ "currentStore": {
4
+ "cartTaxCountryIso": "US",
5
+ "code": "solidus",
6
+ "createdAt": "2012-12-21T12:00:00Z",
7
+ "currencies": {
8
+ "nodes": [
9
+ {
10
+ "htmlEntity": "$",
11
+ "isoCode": "USD",
12
+ "name": "United States Dollar",
13
+ "symbol": "$"
14
+ },
15
+ {
16
+ "htmlEntity": "&#x20AC;",
17
+ "isoCode": "EUR",
18
+ "name": "Euro",
19
+ "symbol": "€"
20
+ }
21
+ ]
22
+ },
23
+ "default": true,
24
+ "defaultCurrency": "USD",
25
+ "mailFromAddress": "spree@example.org",
26
+ "metaDescription": "store description",
27
+ "metaKeywords": "store, metaKeywords",
28
+ "name": "Solidus Test Store",
29
+ "seoTitle": "Store Title",
30
+ "updatedAt": "2012-12-21T12:00:00Z",
31
+ "url": "www.example.com"
32
+ }
33
+ }
34
+ }
@@ -0,0 +1,232 @@
1
+ {
2
+ "data": {
3
+ "currentUser": {
4
+ "addresses": {
5
+ "nodes": [
6
+ {
7
+ "address1": "A Different Road",
8
+ "address2": "Northwest",
9
+ "alternativePhone": "555-555-0199",
10
+ "city": "Herndon",
11
+ "company": "Company",
12
+ "country": {
13
+ "isoName": "UNITED STATES",
14
+ "iso": "US",
15
+ "iso3": "USA",
16
+ "name": "United States",
17
+ "numcode": 840,
18
+ "statesRequired": false,
19
+ "createdAt": "2012-12-21T12:00:00Z",
20
+ "updatedAt": "2012-12-21T12:00:00Z"
21
+ },
22
+ "createdAt": "2012-12-21T12:00:00Z",
23
+ "firstname": "John",
24
+ "id": 1,
25
+ "lastname": null,
26
+ "phone": "555-555-0199",
27
+ "state": {
28
+ "name": "Alabama",
29
+ "abbr": "AL",
30
+ "createdAt": "2012-12-21T12:00:00Z",
31
+ "updatedAt": "2012-12-21T12:00:00Z"
32
+ },
33
+ "stateName": null,
34
+ "updatedAt": "2012-12-21T12:00:00Z",
35
+ "zipcode": "10001"
36
+ },
37
+ {
38
+ "address1": "PO Box 1337",
39
+ "address2": "Northwest",
40
+ "alternativePhone": "555-555-0199",
41
+ "city": "Herndon",
42
+ "company": "Company",
43
+ "country": {
44
+ "isoName": "UNITED STATES",
45
+ "iso": "US",
46
+ "iso3": "USA",
47
+ "name": "United States",
48
+ "numcode": 840,
49
+ "statesRequired": false,
50
+ "createdAt": "2012-12-21T12:00:00Z",
51
+ "updatedAt": "2012-12-21T12:00:00Z"
52
+ },
53
+ "createdAt": "2012-12-21T12:00:00Z",
54
+ "firstname": "John",
55
+ "id": 2,
56
+ "lastname": null,
57
+ "phone": "555-555-0199",
58
+ "state": {
59
+ "name": "Alabama",
60
+ "abbr": "AL",
61
+ "createdAt": "2012-12-21T12:00:00Z",
62
+ "updatedAt": "2012-12-21T12:00:00Z"
63
+ },
64
+ "stateName": null,
65
+ "updatedAt": "2012-12-21T12:00:00Z",
66
+ "zipcode": "10002"
67
+ }
68
+ ]
69
+ },
70
+ "billAddress": {
71
+ "address1": "PO Box 1337",
72
+ "address2": "Northwest",
73
+ "alternativePhone": "555-555-0199",
74
+ "city": "Herndon",
75
+ "company": "Company",
76
+ "country": {
77
+ "isoName": "UNITED STATES",
78
+ "iso": "US",
79
+ "iso3": "USA",
80
+ "name": "United States",
81
+ "numcode": 840,
82
+ "statesRequired": false,
83
+ "createdAt": "2012-12-21T12:00:00Z",
84
+ "updatedAt": "2012-12-21T12:00:00Z"
85
+ },
86
+ "createdAt": "2012-12-21T12:00:00Z",
87
+ "firstname": "John",
88
+ "id": 2,
89
+ "lastname": null,
90
+ "phone": "555-555-0199",
91
+ "state": {
92
+ "name": "Alabama",
93
+ "abbr": "AL",
94
+ "createdAt": "2012-12-21T12:00:00Z",
95
+ "updatedAt": "2012-12-21T12:00:00Z"
96
+ },
97
+ "stateName": null,
98
+ "updatedAt": "2012-12-21T12:00:00Z",
99
+ "zipcode": "10002"
100
+ },
101
+ "createdAt": "2012-12-21T12:00:00Z",
102
+ "currentSignInAt": null,
103
+ "defaultAddress": {
104
+ "address1": "A Different Road",
105
+ "address2": "Northwest",
106
+ "alternativePhone": "555-555-0199",
107
+ "city": "Herndon",
108
+ "company": "Company",
109
+ "country": {
110
+ "isoName": "UNITED STATES",
111
+ "iso": "US",
112
+ "iso3": "USA",
113
+ "name": "United States",
114
+ "numcode": 840,
115
+ "statesRequired": false,
116
+ "createdAt": "2012-12-21T12:00:00Z",
117
+ "updatedAt": "2012-12-21T12:00:00Z"
118
+ },
119
+ "createdAt": "2012-12-21T12:00:00Z",
120
+ "firstname": "John",
121
+ "id": 1,
122
+ "lastname": null,
123
+ "phone": "555-555-0199",
124
+ "state": {
125
+ "name": "Alabama",
126
+ "abbr": "AL",
127
+ "createdAt": "2012-12-21T12:00:00Z",
128
+ "updatedAt": "2012-12-21T12:00:00Z"
129
+ },
130
+ "stateName": null,
131
+ "updatedAt": "2012-12-21T12:00:00Z",
132
+ "zipcode": "10001"
133
+ },
134
+ "email": "email@example.com",
135
+ "id": 1,
136
+ "lastSignInAt": null,
137
+ "login": "email@example.com",
138
+ "shipAddress": {
139
+ "address1": "A Different Road",
140
+ "address2": "Northwest",
141
+ "alternativePhone": "555-555-0199",
142
+ "city": "Herndon",
143
+ "company": "Company",
144
+ "country": {
145
+ "isoName": "UNITED STATES",
146
+ "iso": "US",
147
+ "iso3": "USA",
148
+ "name": "United States",
149
+ "numcode": 840,
150
+ "statesRequired": false,
151
+ "createdAt": "2012-12-21T12:00:00Z",
152
+ "updatedAt": "2012-12-21T12:00:00Z"
153
+ },
154
+ "createdAt": "2012-12-21T12:00:00Z",
155
+ "firstname": "John",
156
+ "id": 1,
157
+ "lastname": null,
158
+ "phone": "555-555-0199",
159
+ "state": {
160
+ "name": "Alabama",
161
+ "abbr": "AL",
162
+ "createdAt": "2012-12-21T12:00:00Z",
163
+ "updatedAt": "2012-12-21T12:00:00Z"
164
+ },
165
+ "stateName": null,
166
+ "updatedAt": "2012-12-21T12:00:00Z",
167
+ "zipcode": "10001"
168
+ },
169
+ "signInCount": 0,
170
+ "spreeApiKey": "123",
171
+ "updatedAt": "2012-12-21T12:00:00Z",
172
+ "wallet": {
173
+ "nodes": [
174
+ {
175
+ "createdAt": "2012-12-21T12:00:00Z",
176
+ "default": true,
177
+ "id": <%= wallet.default_wallet_payment_source.id %>,
178
+ "paymentSource": {
179
+ "address": {
180
+ "address1": "A Different Road",
181
+ "address2": "Northwest",
182
+ "alternativePhone": "555-555-0199",
183
+ "city": "Herndon",
184
+ "company": "Company",
185
+ "country": {
186
+ "isoName": "UNITED STATES",
187
+ "iso": "US",
188
+ "iso3": "USA",
189
+ "name": "United States",
190
+ "numcode": 840,
191
+ "statesRequired": false,
192
+ "createdAt": "2012-12-21T12:00:00Z",
193
+ "updatedAt": "2012-12-21T12:00:00Z"
194
+ },
195
+ "createdAt": "2012-12-21T12:00:00Z",
196
+ "firstname": "John",
197
+ "id": 1,
198
+ "lastname": null,
199
+ "phone": "555-555-0199",
200
+ "state": {
201
+ "name": "Alabama",
202
+ "abbr": "AL",
203
+ "createdAt": "2012-12-21T12:00:00Z",
204
+ "updatedAt": "2012-12-21T12:00:00Z"
205
+ },
206
+ "stateName": null,
207
+ "updatedAt": "2012-12-21T12:00:00Z",
208
+ "zipcode": "10001"
209
+ },
210
+ "ccType": "visa",
211
+ "lastDigits": "1111",
212
+ "month": "12",
213
+ "name": "Spree Commerce",
214
+ "year": "2013",
215
+ "createdAt": "2012-12-21T12:00:00Z",
216
+ "updatedAt": "2012-12-21T12:00:00Z",
217
+ "paymentMethod": {
218
+ "createdAt": "2012-12-21T12:00:00Z",
219
+ "description": null,
220
+ "id": 1,
221
+ "name": "Credit Card",
222
+ "position": "1",
223
+ "updatedAt": "2012-12-21T12:00:00Z"
224
+ }
225
+ },
226
+ "updatedAt": "2012-12-21T12:00:00Z"
227
+ }
228
+ ]
229
+ }
230
+ }
231
+ }
232
+ }
@@ -0,0 +1,123 @@
1
+ {
2
+ "data": {
3
+ "productBySlug": {
4
+ "createdAt": "2012-12-21T12:00:00Z",
5
+ "description": "As seen on TV!",
6
+ "id": 1,
7
+ "masterVariant": {
8
+ "createdAt": "2012-12-21T12:00:00Z",
9
+ "defaultPrice": {
10
+ "amount": "19.99",
11
+ "countryIso": null,
12
+ "createdAt": "2012-12-21T12:00:00Z",
13
+ "currency": {
14
+ "htmlEntity": "$",
15
+ "isoCode": "USD",
16
+ "name": "United States Dollar",
17
+ "symbol": "$"
18
+ },
19
+ "displayAmount": "$19.99",
20
+ "displayCountry": "Any Country",
21
+ "id": <%= product.master.default_price.id %>,
22
+ "updatedAt": "2012-12-21T12:00:00Z"
23
+ },
24
+ "depth": null,
25
+ "height": null,
26
+ "id": <%= product.master.id %>,
27
+ "isMaster": true,
28
+ "optionValues": {
29
+ "nodes": [
30
+ {
31
+ "createdAt": "2012-12-21T12:00:00Z",
32
+ "id": 1,
33
+ "name": "Size",
34
+ "position": "1",
35
+ "presentation": "S",
36
+ "updatedAt": "2012-12-21T12:00:00Z"
37
+ }
38
+ ]
39
+ },
40
+ "position": 1,
41
+ "prices": {
42
+ "nodes": [
43
+ {
44
+ "amount": "19.99",
45
+ "countryIso": null,
46
+ "createdAt": "2012-12-21T12:00:00Z",
47
+ "currency": {
48
+ "htmlEntity": "$",
49
+ "isoCode": "USD",
50
+ "name": "United States Dollar",
51
+ "symbol": "$"
52
+ },
53
+ "displayAmount": "$19.99",
54
+ "displayCountry": "Any Country",
55
+ "id": <%= product.master.prices.first.id %>,
56
+ "updatedAt": "2012-12-21T12:00:00Z"
57
+ }
58
+ ]
59
+ },
60
+ "sku": "SKU",
61
+ "updatedAt": "2012-12-21T12:00:00Z",
62
+ "weight": "0.0",
63
+ "width": null
64
+ },
65
+ "metaDescription": null,
66
+ "metaKeywords": null,
67
+ "metaTitle": null,
68
+ "name": "Product",
69
+ "optionTypes": {
70
+ "nodes": [
71
+ {
72
+ "createdAt": "2012-12-21T12:00:00Z",
73
+ "id": 1,
74
+ "name": "foo-size",
75
+ "optionValues": {
76
+ "nodes": [
77
+ {
78
+ "createdAt": "2012-12-21T12:00:00Z",
79
+ "id": 1,
80
+ "name": "Size",
81
+ "position": "1",
82
+ "presentation": "S",
83
+ "updatedAt": "2012-12-21T12:00:00Z"
84
+ }
85
+ ]
86
+ },
87
+ "position": 1,
88
+ "presentation": "Size",
89
+ "updatedAt": "2012-12-21T12:00:00Z"
90
+ }
91
+ ]
92
+ },
93
+ "productProperties": {
94
+ "nodes": [
95
+ {
96
+ "createdAt": "2012-12-21T12:00:00Z",
97
+ "position": 1,
98
+ "property": {
99
+ "createdAt": "2012-12-21T12:00:00Z",
100
+ "name": "baseball_cap_color",
101
+ "presentation": "cap color",
102
+ "updatedAt": "2012-12-21T12:00:00Z"
103
+ },
104
+ "updatedAt": "2012-12-21T12:00:00Z",
105
+ "value": null
106
+ }
107
+ ]
108
+ },
109
+ "slug": "slug",
110
+ "updatedAt": "2012-12-21T12:00:00Z",
111
+ "variants": {
112
+ "nodes": [
113
+ {
114
+ "id": <%= first_variant.id %>
115
+ },
116
+ {
117
+ "id": <%= second_variant.id %>
118
+ }
119
+ ]
120
+ }
121
+ }
122
+ }
123
+ }
@@ -0,0 +1,145 @@
1
+ {
2
+ "data": {
3
+ "taxonomies": {
4
+ "nodes": [
5
+ {
6
+ "createdAt": "2012-12-21T12:00:00Z",
7
+ "id": 1,
8
+ "name": "Brand",
9
+ "updatedAt": "2012-12-21T12:00:00Z",
10
+ "rootTaxon": {
11
+ "children": {
12
+ "nodes": [
13
+ {
14
+ "children": {
15
+ "nodes": []
16
+ },
17
+ "createdAt": "2012-12-21T12:00:00Z",
18
+ "description": null,
19
+ "iconUrl": "/assets/default_taxon.png",
20
+ "id": 3,
21
+ "metaDescription": null,
22
+ "metaKeywords": null,
23
+ "metaTitle": null,
24
+ "name": "Solidus",
25
+ "parentTaxon": {
26
+ "id": 1
27
+ },
28
+ "permalink": "brand/solidus",
29
+ "updatedAt": "2012-12-21T12:00:00Z"
30
+ }
31
+ ]
32
+ },
33
+ "createdAt": "2012-12-21T12:00:00Z",
34
+ "description": "Brand description",
35
+ "iconUrl": "/assets/default_taxon.png",
36
+ "id": 1,
37
+ "metaDescription": "Brand meta description",
38
+ "metaKeywords": "Brand meta keywords",
39
+ "metaTitle": "Brand meta title",
40
+ "name": "Brand",
41
+ "parentTaxon": null,
42
+ "permalink": "brand",
43
+ "updatedAt": "2012-12-21T12:00:00Z"
44
+ },
45
+ "taxons": {
46
+ "nodes": [
47
+ {
48
+ "children": {
49
+ "nodes": [
50
+ {
51
+ "createdAt": "2012-12-21T12:00:00Z",
52
+ "description": null,
53
+ "iconUrl": "/assets/default_taxon.png",
54
+ "id": 3,
55
+ "metaDescription": null,
56
+ "metaKeywords": null,
57
+ "metaTitle": null,
58
+ "name": "Solidus",
59
+ "parentTaxon": {
60
+ "id": 1
61
+ },
62
+ "permalink": "brand/solidus",
63
+ "updatedAt": "2012-12-21T12:00:00Z"
64
+ }
65
+ ]
66
+ },
67
+ "createdAt": "2012-12-21T12:00:00Z",
68
+ "description": "Brand description",
69
+ "iconUrl": "/assets/default_taxon.png",
70
+ "id": 1,
71
+ "metaDescription": "Brand meta description",
72
+ "metaKeywords": "Brand meta keywords",
73
+ "metaTitle": "Brand meta title",
74
+ "name": "Brand",
75
+ "parentTaxon": null,
76
+ "permalink": "brand",
77
+ "updatedAt": "2012-12-21T12:00:00Z"
78
+ },
79
+ {
80
+ "children": {
81
+ "nodes": []
82
+ },
83
+ "createdAt": "2012-12-21T12:00:00Z",
84
+ "description": null,
85
+ "iconUrl": "/assets/default_taxon.png",
86
+ "id": 3,
87
+ "metaDescription": null,
88
+ "metaKeywords": null,
89
+ "metaTitle": null,
90
+ "name": "Solidus",
91
+ "parentTaxon": {
92
+ "id": 1
93
+ },
94
+ "permalink": "brand/solidus",
95
+ "updatedAt": "2012-12-21T12:00:00Z"
96
+ }
97
+ ]
98
+ }
99
+ },
100
+ {
101
+ "createdAt": "2012-12-21T12:00:00Z",
102
+ "id": 2,
103
+ "name": "Category",
104
+ "updatedAt": "2012-12-21T12:00:00Z",
105
+ "rootTaxon": {
106
+ "children": {
107
+ "nodes": []
108
+ },
109
+ "createdAt": "2012-12-21T12:00:00Z",
110
+ "description": null,
111
+ "iconUrl": "/assets/default_taxon.png",
112
+ "id": 2,
113
+ "metaDescription": null,
114
+ "metaKeywords": null,
115
+ "metaTitle": null,
116
+ "name": "Category",
117
+ "parentTaxon": null,
118
+ "permalink": "category",
119
+ "updatedAt": "2012-12-21T12:00:00Z"
120
+ },
121
+ "taxons": {
122
+ "nodes": [
123
+ {
124
+ "children": {
125
+ "nodes": []
126
+ },
127
+ "createdAt": "2012-12-21T12:00:00Z",
128
+ "description": null,
129
+ "iconUrl": "/assets/default_taxon.png",
130
+ "id": 2,
131
+ "metaDescription": null,
132
+ "metaKeywords": null,
133
+ "metaTitle": null,
134
+ "name": "Category",
135
+ "parentTaxon": null,
136
+ "permalink": "category",
137
+ "updatedAt": "2012-12-21T12:00:00Z"
138
+ }
139
+ ]
140
+ }
141
+ }
142
+ ]
143
+ }
144
+ }
145
+ }