diff --git a/.env.template b/.env.template new file mode 100644 index 0000000..b172f8f --- /dev/null +++ b/.env.template @@ -0,0 +1,8 @@ +# To run tests: +# +# 1. Copy this file to .env +# 2. Fill-in the below variables with valid values. +# These values will be used by the tests. Data will be written to SHOPIFY_DOMAIN +# +SHOPIFY_DOMAIN= +SHOPIFY_TOKEN= diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..02da538 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,21 @@ +name: CI + +on: + - push + - pull_request + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + ruby: ['3.2', '3.1', '3.0', '2.7', '2.6', '2.5', '2.4' ] + + steps: + - uses: actions/checkout@v3 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + + - run: bundle exec rake diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..06f66e6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,62 @@ +# Created by https://www.toptal.com/developers/gitignore/api/ruby +# Edit at https://www.toptal.com/developers/gitignore?templates=ruby + +### Ruby ### +*.gem +*.rbc +/.config +/coverage/ +/InstalledFiles +/pkg/ +/spec/reports/ +/spec/examples.txt +/test/tmp/ +/test/version_tmp/ +/tmp/ + +# Used by dotenv library to load environment variables. +.env* +!.env.template + +# Ignore Byebug command history file. +.byebug_history + +## Specific to RubyMotion: +.dat* +.repl_history +build/ +*.bridgesupport +build-iPhoneOS/ +build-iPhoneSimulator/ + +## Specific to RubyMotion (use of CocoaPods): +# +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# vendor/Pods/ + +## Documentation cache and generated files: +/.yardoc/ +/_yardoc/ +/doc/ +/rdoc/ + +## Environment normalization: +/.bundle/ +/vendor/bundle +/lib/bundler/man/ + +# for a library or gem, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# Gemfile.lock +# .ruby-version +# .ruby-gemset + +# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: +.rvmrc + +# Used by RuboCop. Remote config files pulled in from inherit_from directive. +# .rubocop-https?--* + +# End of https://www.toptal.com/developers/gitignore/api/ruby diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..589bfff --- /dev/null +++ b/Gemfile @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +source "https://rubygems.org" + +# Specify your gem's dependencies in shopify-default_variant.gemspec +gemspec + +gem "rake", "~> 13.0" + +gem "rspec", "~> 3.0" diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..b6466a2 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2024 sshaw + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..7d694f4 --- /dev/null +++ b/README.md @@ -0,0 +1,50 @@ +# Shopify::DefaultVariant + +Determine if the given Shopify product only has a default variant, or if the given variant is the default variant. + +Works with a variety of objects: + +- ShopifyAPI gem response objects +- GraphQL response `Hash` with `String` or `Symbol` keys +- Plain Ol' Ruby Object (PORO) +- Plain `Hash` with `String` or `Symbol` keys + +## Usage + +```rb +Shopify::DefaultVariant.match?(object) +``` + +Where `object` can be a product or a variant in any of the aforementioned forms. + +More examples: + +```rb +require "shopify_api" + +product = ShopifyAPI::Product.find(id: id) +Shopify::DefaultVariant.match?(product) +Shopify::DefaultVariant.match?(product.variants) +Shopify::DefaultVariant.match?(product.variants.sample) + +require "shopify_api-graphql-tiny" + +gql = ShopifyAPI::GraphQL::Tiny.new("shop", "token") + +data = gql.execute(YOUR_QUERY) +# Be sure to remove the data key and query's name key (whatever it may be) +Shopify::DefaultVariant.match?(data.dig("data", "queryName")) + +# Or use a Object or Hash that resembles one of the well-known forms +Shopify::DefaultVariant.match?(my_custom_object) +``` + +## Testing + +The GraphQL tests require a Shopify store and access token. You can set this by +copying `.env.template` to `.env.test` and adding the appropriate values. +VCR is used to record these requests. + +--- + +Made by [ScreenStaring](http://screenstaring.com) diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..b6ae734 --- /dev/null +++ b/Rakefile @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +require "bundler/gem_tasks" +require "rspec/core/rake_task" + +RSpec::Core::RakeTask.new(:spec) + +task default: :spec diff --git a/bin/console b/bin/console new file mode 100755 index 0000000..a2d5908 --- /dev/null +++ b/bin/console @@ -0,0 +1,15 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +require "bundler/setup" +require "shopify/default_variant" + +# You can add fixtures and/or initialization code here to make experimenting +# with your gem easier. You can also use a different console, if you like. + +# (If you use this, don't forget to add pry to your Gemfile!) +# require "pry" +# Pry.start + +require "irb" +IRB.start(__FILE__) diff --git a/bin/setup b/bin/setup new file mode 100755 index 0000000..dce67d8 --- /dev/null +++ b/bin/setup @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -euo pipefail +IFS=$'\n\t' +set -vx + +bundle install + +# Do any other automated setup that you need to do here diff --git a/lib/shopify/default_variant.rb b/lib/shopify/default_variant.rb new file mode 100644 index 0000000..8485abf --- /dev/null +++ b/lib/shopify/default_variant.rb @@ -0,0 +1,139 @@ +# frozen_string_literal: true + +module Shopify + module DefaultVariant + VERSION = "0.0.1" + TITLE = "Default Title" + + class Object + def initialize(object) + @object = object + end + + def match? + # TODO: arity??? + if @object.respond_to?(:variants) + variants = @object.variants + return variants.size == 1 && default_variant?(variants[0]) + end + + default_variant?(@object) + end + + private + + def default_variant?(object) + return false unless object.respond_to?(:title) + match = object.title == DefaultVariant::TITLE + + return match unless object.respond_to?(:option1) + + match &&= (object.option1.nil? || object.option1 == DefaultVariant::TITLE) + return match unless object.respond_to?(:option2) + + match && (object.option2.nil? || object.option2 == DefaultVariant::TITLE) + end + end + + class Hash + def initialize(hash) + @hash = hash + end + + def match? + return false unless @hash.is_a?(::Hash) + + plain_hash_match? || graphql_hash_match? + end + + private + + def plain_hash_match? + v = variants + return default_variant?(@hash) unless v + + v.is_a?(Array) && v.size == 1 && v[0].is_a?(::Hash) && default_variant?(v[0]) + end + + def graphql_hash_match? + if @hash.include?(:hasOnlyDefaultVariant) || @hash.include?("hasOnlyDefaultVariant") + return @hash[:hasOnlyDefaultVariant] || @hash["hasOnlyDefaultVariant"] + end + + v = variants + match = v.is_a?(::Hash) ? graphql_default_variant?(v) : false + return match unless match && (@hash.include?(:totalVariants) || @hash.include?("totalVariants")) + + match && (@hash[:totalVariants] || @hash["totalVariants"]) == 1 + end + + def variants + @hash[:variants] || @hash["variants"] + end + + def default_variant?(hash) + match = default_title?(hash) + # FIXME: should do like we do for GraphQL and not assume we have a title + return match unless match && (hash.include?(:option1) || hash.include?("option1")) + + match &&= (hash[:option1] || hash["option1"]) == DefaultVariant::TITLE + return match unless match && (hash.include?(:option2) || hash.include?("option2")) + + match && (hash[:option2] || hash["option2"]).nil? + + # option3 too! + end + + def graphql_default_variant?(variants) + edges = variants[:edges] || variants["edges"] + return false unless edges.is_a?(Array) + + nodes = edges.map { |e| e[:node] || e["node"] } + return false unless nodes.size == 1 && nodes[0].is_a?(::Hash) + + match = nil + if nodes[0].include?(:title) || nodes[0].include?("title") + match = default_title?(nodes[0]) + end + + return false if match == false + + if nodes[0].include?(:selectedOptions) || nodes[0].include?("selectedOptions") + match = graphql_default_option?(nodes[0][:selectedOptions] || nodes[0]["selectedOptions"]) + end + + # Could still be nil so we force a boolean + !!match + end + + def graphql_default_option?(options) + return false unless options.is_a?(Array) && options.size == 1 + + name = options[0][:name] || options[0]["name"] + value = options[0][:value] || options[0]["value"] + + name == "Title" && value == DefaultVariant::TITLE + end + + def default_title?(hash) + hash[:title] == DefaultVariant::TITLE || hash["title"] == DefaultVariant::TITLE + end + end + + class << self + def match?(object) + handler(object).match? + end + + private + + def handler(object) + if object.is_a?(::Hash) + DefaultVariant::Hash.new(object) + else + DefaultVariant::Object.new(object) + end + end + end + end +end diff --git a/shopify-default_variant.gemspec b/shopify-default_variant.gemspec new file mode 100644 index 0000000..55f64f8 --- /dev/null +++ b/shopify-default_variant.gemspec @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +require_relative "lib/shopify/default_variant" + +Gem::Specification.new do |spec| + spec.name = "shopify-default_variant" + spec.version = Shopify::DefaultVariant::VERSION + spec.authors = ["sshaw"] + spec.email = ["skye.shaw@gmail.com"] + + spec.summary = "Determine if the given Shopify product only has a default variant, or if the given variant is the default variant" + spec.description = "Determine if the given Shopify product only has a default variant, or if the given variant is the default variant. Works with ShopifyAPI, a GraphQL response hash with Symbol or String keys, POROs or plain Hashes" + spec.homepage = "https://github.com/ScreenStaring/shopify-default_variant" + spec.license = "MIT" + spec.required_ruby_version = ">= 2.4" + + spec.metadata["homepage_uri"] = spec.homepage + spec.metadata["source_code_uri"] = spec.homepage + #spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here." + + # Specify which files should be added to the gem when it is released. + # The `git ls-files -z` loads the files in the RubyGem that have been added into git. + spec.files = Dir.chdir(File.expand_path(__dir__)) do + `git ls-files -z`.split("\x0").reject do |f| + (f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features)/|\.(?:git|travis|circleci)|appveyor)}) + end + end + spec.bindir = "exe" + spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) } + spec.require_paths = ["lib"] + + spec.add_development_dependency "bundler" + spec.add_development_dependency "rake", "~> 13.0" + spec.add_development_dependency "rspec", "~> 3.0" + spec.add_development_dependency "shopify_api-graphql-tiny", "~> 0.1.1" + spec.add_development_dependency "vcr" + spec.add_development_dependency "dotenv" + spec.add_development_dependency "webmock" +end diff --git a/spec/cassettes/Shopify_DefaultVariant/_match_/given_a_GraphQL_response_hash/given_a_default_variant/returns_true_when_its_variants_contain_a_default_variant_title.yml b/spec/cassettes/Shopify_DefaultVariant/_match_/given_a_GraphQL_response_hash/given_a_default_variant/returns_true_when_its_variants_contain_a_default_variant_title.yml new file mode 100644 index 0000000..8f373d1 --- /dev/null +++ b/spec/cassettes/Shopify_DefaultVariant/_match_/given_a_GraphQL_response_hash/given_a_default_variant/returns_true_when_its_variants_contain_a_default_variant_title.yml @@ -0,0 +1,530 @@ +--- +http_interactions: +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productCreate($input: ProductInput!) {\n productCreate(input: + $input) {\n product {\n id\n }\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"title":"Shopify::DefaultVariant + Test Product Without Variants"}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:43 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=460.000038 + - processing;dur=402, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=b1b3179f-5e03-4798-8c3c-05c23695cbd9' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=b1b3179f-5e03-4798-8c3c-05c23695cbd9 + X-Envoy-Upstream-Service-Time: + - '404' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - b1b3179f-5e03-4798-8c3c-05c23695cbd9 + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=8pJVeRMc336p%2FfSX1BwIN%2FKbZ9ddSewtCpb4u4%2B5UO2clDTWxqULNy2BhwJqw8cFLS%2BuXLTpk4Nnc%2FqVglLZ%2F8ZlpcEEotinkll%2FfCQMW%2FM3cGfPlnWD6Ff6DahbwWAbqGCjh1pdWf9f"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c5b093557b5-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productCreate":{"product":{"id":"gid://shopify/Product/7352959205429"},"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productCreate","product","id"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","product"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:37 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productCreate($input: ProductInput!) {\n productCreate(input: + $input) {\n product {\n id\n }\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"title":"Shopify::DefaultVariant + Test Product With Variants","options":["Color"],"variants":[{"title":"Variant + 1","options":["Red"]}]}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:44 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + X-Shopify-Api-Deprecated-Reason: + - https://shopify.dev/api/usage/versioning#deprecation-practices + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=345.000029 + - processing;dur=286, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=866742b0-54a5-4ed2-8a09-50fa00f448b9' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=866742b0-54a5-4ed2-8a09-50fa00f448b9 + X-Envoy-Upstream-Service-Time: + - '289' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - 866742b0-54a5-4ed2-8a09-50fa00f448b9 + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=N88oZLg%2BnhxpIDa2a6AMRujbbZzq68tKKpQEXO1XaxfjEleRZIjewjk9wpXpchqfcvblgwfzXLKvE5DCZ6RUeoXGXzomxwjNlJlWP4GOq%2BjDbNPfv0qY5By%2BX655MJpa4G3W8k9pR1bI"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c5e6c425a82-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productCreate":{"product":{"id":"gid://shopify/Product/7352959238197"},"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productCreate","product","id"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","product"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:38 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" query {\n product(id: \"gid://shopify/Product/7352959205429\") + {\n variants(first: 10) {\n edges {\n node + {\n title\n }\n }\n }\n }\n }\n"}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:44 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=124.000072 + - processing;dur=69, graphql;desc="admin/query/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=27d0150a-bf72-460c-a6e5-3dfcf7400ff7' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=27d0150a-bf72-460c-a6e5-3dfcf7400ff7 + X-Envoy-Upstream-Service-Time: + - '71' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - 27d0150a-bf72-460c-a6e5-3dfcf7400ff7 + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=g5OTnXcZikM53RMRFA%2BMxpP9wiYdsFqZdCHCceU9Kz%2B9eflACM742WPJhGDcepIlI76g7LaleYaUO5vqXTU5IeMeWKGb4BdzR5xUh3I83M0adYdF%2FqqLFvQZTXmkP25drPRuYgcsQBlQ"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c610e767fd5-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"product":{"variants":{"edges":[{"node":{"title":"Default + Title"}}]}}},"extensions":{"cost":{"requestedQueryCost":7,"actualQueryCost":4,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1996,"restoreRate":100.0},"fields":[{"path":["product","variants","edges","node","title"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["product","variants","edges","node"],"definedCost":1,"requestedTotalCost":1,"requestedChildrenCost":0},{"path":["product","variants","edges"],"definedCost":0,"requestedTotalCost":1,"requestedChildrenCost":1},{"path":["product","variants"],"definedCost":null,"requestedTotalCost":6,"requestedChildrenCost":1},{"path":["product"],"definedCost":1,"requestedTotalCost":7,"requestedChildrenCost":6}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:38 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productDelete($input: ProductDeleteInput!) {\n productDelete(input: + $input) {\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"id":"gid://shopify/Product/7352959205429"}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:45 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=539.999962 + - processing;dur=480, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=2fe02f52-6654-4b23-85eb-eb32be402b34' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=2fe02f52-6654-4b23-85eb-eb32be402b34 + X-Envoy-Upstream-Service-Time: + - '482' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - 2fe02f52-6654-4b23-85eb-eb32be402b34 + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=0Jmhn2UqGcsOjgIE1JsBPsJX%2FI7zPcZk8pHTtUGxjNTUwA7yanWhj7E2tV21jb8fICo180aLTIWLXoqT15P%2FrID%2BovmU5aHbR0IVGR05%2BJnay1wgwi%2F%2F6Z62QfVjBedJrRZGONtuXIyR"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c622fcf1750-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productDelete":{"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productDelete","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productDelete"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:38 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productDelete($input: ProductDeleteInput!) {\n productDelete(input: + $input) {\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"id":"gid://shopify/Product/7352959238197"}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:45 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=484.999895 + - processing;dur=426, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=2afa2994-8811-4987-95d5-afc36c7f8a2b' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=2afa2994-8811-4987-95d5-afc36c7f8a2b + X-Envoy-Upstream-Service-Time: + - '428' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - 2afa2994-8811-4987-95d5-afc36c7f8a2b + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=BPhtAF4HKgRLpRmUxpnKXyCF2ISEfOJ4Il1MCri06rbqfejYleFDQejuXQJM7%2FmF43SjDc0LaPp4%2FresPgCRhoZt3rNKhVdQ3ta%2FBkVZkaYqtm0BgtBUvyB0Jj5dTGEEEGKrv7ur556u"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c65dc800611-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productDelete":{"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productDelete","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productDelete"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:39 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/cassettes/Shopify_DefaultVariant/_match_/given_a_GraphQL_response_hash/given_a_default_variant/returns_true_when_its_variants_contain_a_default_variant_title_and_the_default_variant_s_selectedOptions.yml b/spec/cassettes/Shopify_DefaultVariant/_match_/given_a_GraphQL_response_hash/given_a_default_variant/returns_true_when_its_variants_contain_a_default_variant_title_and_the_default_variant_s_selectedOptions.yml new file mode 100644 index 0000000..ba246cf --- /dev/null +++ b/spec/cassettes/Shopify_DefaultVariant/_match_/given_a_GraphQL_response_hash/given_a_default_variant/returns_true_when_its_variants_contain_a_default_variant_title_and_the_default_variant_s_selectedOptions.yml @@ -0,0 +1,530 @@ +--- +http_interactions: +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productCreate($input: ProductInput!) {\n productCreate(input: + $input) {\n product {\n id\n }\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"title":"Shopify::DefaultVariant + Test Product Without Variants"}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:46 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=328.000069 + - processing;dur=272, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=1342b6b5-8601-41fb-9366-e44539861441' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=1342b6b5-8601-41fb-9366-e44539861441 + X-Envoy-Upstream-Service-Time: + - '274' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - 1342b6b5-8601-41fb-9366-e44539861441 + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=u4GFvyEuCCWfo2FOR8Z1Kn9qEQB7ldvBnz1hJ0AOFDlyIskS1yTZ67i2AvDiDdrh1T90VERak0T3NF73RL3LbOYf0YZFaiAfgnzBReDRSTt%2B8bGdK3raaG8%2BC8QjX0jCOqjHKcmdZxAE"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c6958dd060f-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productCreate":{"product":{"id":"gid://shopify/Product/7352959303733"},"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productCreate","product","id"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","product"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:39 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productCreate($input: ProductInput!) {\n productCreate(input: + $input) {\n product {\n id\n }\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"title":"Shopify::DefaultVariant + Test Product With Variants","options":["Color"],"variants":[{"title":"Variant + 1","options":["Red"]}]}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:46 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + X-Shopify-Api-Deprecated-Reason: + - https://shopify.dev/api/usage/versioning#deprecation-practices + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=402.000189 + - processing;dur=342, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=d977e7ee-d8ea-4cb0-8cfc-a0c2f9634d1a' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=d977e7ee-d8ea-4cb0-8cfc-a0c2f9634d1a + X-Envoy-Upstream-Service-Time: + - '346' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - d977e7ee-d8ea-4cb0-8cfc-a0c2f9634d1a + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=YQJjOJeobe4T6tEqyfmL33sVOmrtpo3SUkUZcQCS%2B5uTm%2Bfzm3nlmnm%2Fw4dL50BCG0o%2B3t34HI7lh6PXPl4iszie03SBwu1ec7YqEe3ACuEXZ4QOl2gVcmax3EYsOYRvIrb5cRLLhoR3"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c6bcdd4063b-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productCreate":{"product":{"id":"gid://shopify/Product/7352959336501"},"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productCreate","product","id"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","product"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:40 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" query {\n product(id: \"gid://shopify/Product/7352959303733\") + {\n variants(first: 10) {\n edges {\n node + {\n title\n selectedOptions {\n name\n value\n }\n }\n }\n }\n }\n }\n"}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:46 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=131.999969 + - processing;dur=74, graphql;desc="admin/query/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=2749e60b-5c74-422d-8922-cc38934d2d57' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=2749e60b-5c74-422d-8922-cc38934d2d57 + X-Envoy-Upstream-Service-Time: + - '76' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - 2749e60b-5c74-422d-8922-cc38934d2d57 + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=hDJshpPBHztNG3FHwgtP9ASfUAsuNzqlZhbmMJvPBW%2FJ6VmQpfWoylq1jD7LHRhgqmXzONUg64VvnkxyBsPE4smzRBIJ4M60%2BcdLwkl3%2BpuWiGEBbAnlH5OKxtDqXXSQvzxjWRFGr3T9"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c6eab9105d5-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"product":{"variants":{"edges":[{"node":{"title":"Default + Title","selectedOptions":[{"name":"Title","value":"Default Title"}]}}]}}},"extensions":{"cost":{"requestedQueryCost":11,"actualQueryCost":5,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1995,"restoreRate":100.0},"fields":[{"path":["product","variants","edges","node","title"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["product","variants","edges","node","selectedOptions","name"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["product","variants","edges","node","selectedOptions","value"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["product","variants","edges","node","selectedOptions"],"definedCost":1,"requestedTotalCost":1,"requestedChildrenCost":0},{"path":["product","variants","edges","node"],"definedCost":1,"requestedTotalCost":2,"requestedChildrenCost":1},{"path":["product","variants","edges"],"definedCost":0,"requestedTotalCost":2,"requestedChildrenCost":2},{"path":["product","variants"],"definedCost":null,"requestedTotalCost":10,"requestedChildrenCost":2},{"path":["product"],"definedCost":1,"requestedTotalCost":11,"requestedChildrenCost":10}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:40 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productDelete($input: ProductDeleteInput!) {\n productDelete(input: + $input) {\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"id":"gid://shopify/Product/7352959303733"}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:47 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=464.999914 + - processing;dur=411, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=1e17bf6e-528c-422e-a3e2-1a348548b508' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=1e17bf6e-528c-422e-a3e2-1a348548b508 + X-Envoy-Upstream-Service-Time: + - '413' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - 1e17bf6e-528c-422e-a3e2-1a348548b508 + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=a6guKOBccm4MPBya2n888WpE3wzxNGpc7R86ndKYCjtR5Lit%2FCmOQ%2FIRFPEyFpVM6ixbqUqEKJdrPHtzBVu8qSJLyH1dYqYcDm%2Fd8WvBo%2BF6FyyYUY8yG0J78Iw%2Be4OwM7uR%2FGia9qJd"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c6fccf59c8b-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productDelete":{"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productDelete","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productDelete"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:41 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productDelete($input: ProductDeleteInput!) {\n productDelete(input: + $input) {\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"id":"gid://shopify/Product/7352959336501"}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:47 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=595.999956 + - processing;dur=540, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=19214403-86d1-4921-8621-b991f53e206e' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=19214403-86d1-4921-8621-b991f53e206e + X-Envoy-Upstream-Service-Time: + - '542' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - 19214403-86d1-4921-8621-b991f53e206e + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=ElnA7foK4%2FWqVu3YAbld1qq406fz5sDR4I9Uii1ctm4wEY%2BbXUBrlLDlpE89IH2uHW8GT5th%2Fv6K1Fp9V5jGl4feE8nSLYh6uLei8IFpyzSZUfiWPCH7zb%2F48UW25dlPBW7FMk6mFctA"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c730e1f07f9-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productDelete":{"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productDelete","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productDelete"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:41 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/cassettes/Shopify_DefaultVariant/_match_/given_a_GraphQL_response_hash/given_a_product_with_a_default_variant/returns_true_when_hasOnlyDefaultVariant_is_true.yml b/spec/cassettes/Shopify_DefaultVariant/_match_/given_a_GraphQL_response_hash/given_a_product_with_a_default_variant/returns_true_when_hasOnlyDefaultVariant_is_true.yml new file mode 100644 index 0000000..aca6b6a --- /dev/null +++ b/spec/cassettes/Shopify_DefaultVariant/_match_/given_a_GraphQL_response_hash/given_a_product_with_a_default_variant/returns_true_when_hasOnlyDefaultVariant_is_true.yml @@ -0,0 +1,528 @@ +--- +http_interactions: +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productCreate($input: ProductInput!) {\n productCreate(input: + $input) {\n product {\n id\n }\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"title":"Shopify::DefaultVariant + Test Product Without Variants"}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:22 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=451.999903 + - processing;dur=391, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=8a4b8803-f23f-4eea-8d91-6978508a50ae' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=8a4b8803-f23f-4eea-8d91-6978508a50ae + X-Envoy-Upstream-Service-Time: + - '395' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - 8a4b8803-f23f-4eea-8d91-6978508a50ae + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=2IsCqvUL3utRUY4M1Y2TOihaYAM80wPXmdJ3kqv9W9HUAtvVtKLpoNX5UVeQdSd%2BSAfgqvyKVZ0YMsE0YI%2F3NNDgUXj2nf%2F5K363ZAJLRKx5GysHWRdSgh1JL5A%2FbhSaKidlMwFSbUNO"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9bd6efab6fcb-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productCreate":{"product":{"id":"gid://shopify/Product/7352958156853"},"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productCreate","product","id"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","product"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:16 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productCreate($input: ProductInput!) {\n productCreate(input: + $input) {\n product {\n id\n }\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"title":"Shopify::DefaultVariant + Test Product With Variants","options":["Color"],"variants":[{"title":"Variant + 1","options":["Red"]}]}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:23 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + X-Shopify-Api-Deprecated-Reason: + - https://shopify.dev/api/usage/versioning#deprecation-practices + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=369.999886 + - processing;dur=305, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=0301ab76-ba0b-47b2-915b-ba22c4b8fa77' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=0301ab76-ba0b-47b2-915b-ba22c4b8fa77 + X-Envoy-Upstream-Service-Time: + - '307' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - 0301ab76-ba0b-47b2-915b-ba22c4b8fa77 + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=gHLh4qyT711GRm9yP0apnLGTeB9AhBVsB8yFI2SO8mTwvKR%2Foc1EIA9iFvQBHef8bZDq7VLkbfqyno3UePDj4NlL7M7JigJZOUoKL2Gz9MSm45KFRMTaBnpqgWpURrUwCcnVr1ZRcErp"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9bda194f2d22-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productCreate":{"product":{"id":"gid://shopify/Product/7352958189621"},"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productCreate","product","id"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","product"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:17 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" query {\n product(id: \"gid://shopify/Product/7352958156853\") + {\n hasOnlyDefaultVariant\n }\n }\n"}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:23 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=109.999895 + - processing;dur=60, graphql;desc="admin/query/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=3835dc6c-afa8-41fd-8ad1-f858b7377dd7' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=3835dc6c-afa8-41fd-8ad1-f858b7377dd7 + X-Envoy-Upstream-Service-Time: + - '62' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - 3835dc6c-afa8-41fd-8ad1-f858b7377dd7 + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=2vJTfTF1f4uyjdq1cpZTxF0NQFDjgB%2FZ7tPmzK6o59lWHTfIFzi0NbxdLnhCpO13UYHGH26OZAVvLXnbXVeVzWjDbqRU%2Fqi%2FaiKJOWFQK%2BFI1Ye82z99MXZGtNasyMGC1q%2Byjxs3DOdX"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9bdd289f2024-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"product":{"hasOnlyDefaultVariant":true}},"extensions":{"cost":{"requestedQueryCost":1,"actualQueryCost":1,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1999,"restoreRate":100.0},"fields":[{"path":["product","hasOnlyDefaultVariant"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["product"],"definedCost":1,"requestedTotalCost":1,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:17 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productDelete($input: ProductDeleteInput!) {\n productDelete(input: + $input) {\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"id":"gid://shopify/Product/7352958156853"}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:24 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=463.999987 + - processing;dur=411, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=69568f5a-d8ed-4808-99b8-7d4d5e91ca1c' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=69568f5a-d8ed-4808-99b8-7d4d5e91ca1c + X-Envoy-Upstream-Service-Time: + - '413' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - 69568f5a-d8ed-4808-99b8-7d4d5e91ca1c + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=KA2mehrUhkquxrl9C1%2FC4kg46CQAmXjWmAuwuJrQPNkcb2kJ8eq8Okcvy7gNLF9X2Kn0jedY28%2FtcUrytXxPvQkObXsWWUrW7FvwVQ4Oy50QZl82V7viw1CyfOBP5Wr5VY7T3WgN8V0v"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9bde2d2559d9-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productDelete":{"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productDelete","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productDelete"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:17 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productDelete($input: ProductDeleteInput!) {\n productDelete(input: + $input) {\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"id":"gid://shopify/Product/7352958189621"}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:24 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=424.000025 + - processing;dur=375, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=f5758ed7-cf61-4665-83be-065b87bdecf6' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=f5758ed7-cf61-4665-83be-065b87bdecf6 + X-Envoy-Upstream-Service-Time: + - '377' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - f5758ed7-cf61-4665-83be-065b87bdecf6 + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=L8M88p0nydAiUJlFJLRbwi%2BYO5LliJwh477zcdXGVVyd6yVOGWIDQVDak%2F9SZ48K0gU5f1pcC86hLfP6QGGXx75Znr2IihjyZ84wm0Jyx%2F3q1e257Sj0gzF%2BuTOdsRzwffgBs9Ua4PF%2B"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9be1a9053b44-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productDelete":{"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productDelete","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productDelete"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:18 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/cassettes/Shopify_DefaultVariant/_match_/given_a_GraphQL_response_hash/given_a_product_with_a_default_variant/returns_true_when_it_contains_the_variant_count_and_its_variants_only_contain_a_default_variant.yml b/spec/cassettes/Shopify_DefaultVariant/_match_/given_a_GraphQL_response_hash/given_a_product_with_a_default_variant/returns_true_when_it_contains_the_variant_count_and_its_variants_only_contain_a_default_variant.yml new file mode 100644 index 0000000..41a30fd --- /dev/null +++ b/spec/cassettes/Shopify_DefaultVariant/_match_/given_a_GraphQL_response_hash/given_a_product_with_a_default_variant/returns_true_when_it_contains_the_variant_count_and_its_variants_only_contain_a_default_variant.yml @@ -0,0 +1,530 @@ +--- +http_interactions: +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productCreate($input: ProductInput!) {\n productCreate(input: + $input) {\n product {\n id\n }\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"title":"Shopify::DefaultVariant + Test Product Without Variants"}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:32 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=381.999969 + - processing;dur=327, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=387303ad-8941-497c-b70c-87275f33d990' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=387303ad-8941-497c-b70c-87275f33d990 + X-Envoy-Upstream-Service-Time: + - '329' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - 387303ad-8941-497c-b70c-87275f33d990 + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=mCl2aWCqaT%2FIQuMvTKdfeIsfth01M6tqP6D18MuZod7w3Cw90F3A0m5rVS8vI0S40cRJZ7Jl6U8ySbTPpOIbZSxTqMRICLkh6RjE3EeWXNd4%2FCMBe7usVsuYGL3r4GcfVjAoc831gJpT"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c12efbb56d4-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productCreate":{"product":{"id":"gid://shopify/Product/7352958746677"},"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productCreate","product","id"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","product"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:26 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productCreate($input: ProductInput!) {\n productCreate(input: + $input) {\n product {\n id\n }\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"title":"Shopify::DefaultVariant + Test Product With Variants","options":["Color"],"variants":[{"title":"Variant + 1","options":["Red"]}]}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:33 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + X-Shopify-Api-Deprecated-Reason: + - https://shopify.dev/api/usage/versioning#deprecation-practices + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=483.000040 + - processing;dur=410, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=ffce7e12-f878-48cc-bad7-a5c55e1e6c91' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=ffce7e12-f878-48cc-bad7-a5c55e1e6c91 + X-Envoy-Upstream-Service-Time: + - '412' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - ffce7e12-f878-48cc-bad7-a5c55e1e6c91 + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=rx9Qt4%2FeEG2tl%2FRMv70d4LgGPbLwFow1AMc65OvxiN4GHIw%2FXdsJXcVETK6g0Ou6LeCZ5ncZ6v7pPuVqh%2FUHQ%2Bc4qan%2FVvrmUoPeUXaOrCHC6okKo3VSfjDV9q1vcqgn7UeZZ%2BIb1LNT"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c163f3c0a8b-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productCreate":{"product":{"id":"gid://shopify/Product/7352958779445"},"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productCreate","product","id"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","product"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:26 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" query {\n product(id: \"gid://shopify/Product/7352958746677\") + {\n totalVariants\n variants(first: 10) {\n edges + {\n node {\n title\n }\n }\n }\n }\n }\n"}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:33 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=173.000097 + - processing;dur=75, graphql;desc="admin/query/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=6308a235-cee6-412b-9148-8d2e3af5cb1c' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=6308a235-cee6-412b-9148-8d2e3af5cb1c + X-Envoy-Upstream-Service-Time: + - '118' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - 6308a235-cee6-412b-9148-8d2e3af5cb1c + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=wFH0L0iHEbaoNpSQRZ3JgY67K1rbSeR%2FbZ%2Bl%2FvpHnhE3%2FZF3YNt1VC%2FA6f6zietYlcWZKT1vrOaqt%2Fkd%2FgPXTUjt%2FUNtEVRM4XBhs3oD2K3mEQfe2KlXfHMBmik7heENDJApG9f%2FRCGH"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c19a820081f-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"product":{"totalVariants":1,"variants":{"edges":[{"node":{"title":"Default + Title"}}]}}},"extensions":{"cost":{"requestedQueryCost":7,"actualQueryCost":4,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1996,"restoreRate":100.0},"fields":[{"path":["product","totalVariants"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["product","variants","edges","node","title"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["product","variants","edges","node"],"definedCost":1,"requestedTotalCost":1,"requestedChildrenCost":0},{"path":["product","variants","edges"],"definedCost":0,"requestedTotalCost":1,"requestedChildrenCost":1},{"path":["product","variants"],"definedCost":null,"requestedTotalCost":6,"requestedChildrenCost":1},{"path":["product"],"definedCost":1,"requestedTotalCost":7,"requestedChildrenCost":6}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:26 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productDelete($input: ProductDeleteInput!) {\n productDelete(input: + $input) {\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"id":"gid://shopify/Product/7352958746677"}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:33 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=459.999800 + - processing;dur=386, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=67878b19-2da8-40eb-ba56-6edd4182588c' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=67878b19-2da8-40eb-ba56-6edd4182588c + X-Envoy-Upstream-Service-Time: + - '389' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - 67878b19-2da8-40eb-ba56-6edd4182588c + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=Ujkc%2BQDbGOBKspxWs6BmZ94gHFHbkLZQyij9UrRg7kioWhNaI4IoB2X%2FQnp9fkR%2Fi7cpWVshDKYNNL8FaQjhYHWRnIU9Bod8hWfrifHFmPd5dpxNqYGtDaHANxk3qqMnlCp%2B3%2FRZHgvw"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c1b08e46f9e-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productDelete":{"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productDelete","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productDelete"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:27 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productDelete($input: ProductDeleteInput!) {\n productDelete(input: + $input) {\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"id":"gid://shopify/Product/7352958779445"}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:34 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=476.000071 + - processing;dur=425, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=ea09425e-8547-4e66-9fb9-b3f9a16d786e' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=ea09425e-8547-4e66-9fb9-b3f9a16d786e + X-Envoy-Upstream-Service-Time: + - '427' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - ea09425e-8547-4e66-9fb9-b3f9a16d786e + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=c3CQALTxoTkVpXlbPU5rtT0xbOAFI8yqW4J40oxauZ68NkuuwariYf6n%2BHHfbwnX9JgW81tDK4KMwFd90i179I84pELr%2Fejfc8fYR7HNpPyBzOSmqPVoXwd1t8n0szY6i33YntRYtKZC"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c1e68215a22-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productDelete":{"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productDelete","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productDelete"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:28 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/cassettes/Shopify_DefaultVariant/_match_/given_a_GraphQL_response_hash/given_a_product_with_a_default_variant/returns_true_when_its_variants_only_contain_the_default_variant_s_selectedOptions.yml b/spec/cassettes/Shopify_DefaultVariant/_match_/given_a_GraphQL_response_hash/given_a_product_with_a_default_variant/returns_true_when_its_variants_only_contain_the_default_variant_s_selectedOptions.yml new file mode 100644 index 0000000..6204ba0 --- /dev/null +++ b/spec/cassettes/Shopify_DefaultVariant/_match_/given_a_GraphQL_response_hash/given_a_product_with_a_default_variant/returns_true_when_its_variants_only_contain_the_default_variant_s_selectedOptions.yml @@ -0,0 +1,530 @@ +--- +http_interactions: +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productCreate($input: ProductInput!) {\n productCreate(input: + $input) {\n product {\n id\n }\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"title":"Shopify::DefaultVariant + Test Product Without Variants"}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:25 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=392.999887 + - processing;dur=336, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=e6571736-abe9-4e90-a18a-658095c099cd' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=e6571736-abe9-4e90-a18a-658095c099cd + X-Envoy-Upstream-Service-Time: + - '338' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - e6571736-abe9-4e90-a18a-658095c099cd + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=V9kNrMlrwY0CLdlWBxRYUqLf3jMoiTcwaTPoGCEFN7G%2FInvVUEu2xGSkioDaxtF9xnbTMdI91pe%2BkuW3TqwxMkRGc6gVbhcezpy08uRHZslRD7G%2Fd0mu6al0pftTV5c3Y%2FIV6juOcZfi"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9be4ffe81785-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productCreate":{"product":{"id":"gid://shopify/Product/7352958320693"},"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productCreate","product","id"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","product"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:18 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productCreate($input: ProductInput!) {\n productCreate(input: + $input) {\n product {\n id\n }\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"title":"Shopify::DefaultVariant + Test Product With Variants","options":["Color"],"variants":[{"title":"Variant + 1","options":["Red"]}]}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:25 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + X-Shopify-Api-Deprecated-Reason: + - https://shopify.dev/api/usage/versioning#deprecation-practices + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=391.999960 + - processing;dur=324, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=ab4fc37a-a9e4-4d33-8ecd-ee7696683ccf' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=ab4fc37a-a9e4-4d33-8ecd-ee7696683ccf + X-Envoy-Upstream-Service-Time: + - '326' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - ab4fc37a-a9e4-4d33-8ecd-ee7696683ccf + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=xGRJ0y9SuHKJpqceAykDMN41Lh8rreWZb0lOnngg3wXFmR5O%2BZ02YSFRAlJwPn495BPeI90FYybEOBtqP9U8DDoFJ7BpyJ%2FT0O99HKXoAYrrTVrGArjHHyHOyW4zfbJ1xI1sySx0tg3N"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9be86e6e57d0-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productCreate":{"product":{"id":"gid://shopify/Product/7352958353461"},"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productCreate","product","id"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","product"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:19 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" query {\n product(id: \"gid://shopify/Product/7352958320693\") + {\n variants(first: 10) {\n edges {\n node + {\n selectedOptions {\n name\n value\n }\n }\n }\n }\n }\n }\n"}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:25 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=140.999794 + - processing;dur=89, graphql;desc="admin/query/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=ee0b731a-f928-42df-9405-c2c55b9ae3f5' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=ee0b731a-f928-42df-9405-c2c55b9ae3f5 + X-Envoy-Upstream-Service-Time: + - '91' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - ee0b731a-f928-42df-9405-c2c55b9ae3f5 + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=FC0cGnjKrzmuSFuvmDn7oXPuTuGzx%2FGwmGpbsqQVZKA7%2FD2A3WGmhiTiynB23tzqidaOOAJU2x%2FEpL3LQb4hEigeNHRNeLqfwRm5%2BtAlrzk3phuZsO8EKNXPdMdizumWiENUVUITP9OW"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9beb3fa68230-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"product":{"variants":{"edges":[{"node":{"selectedOptions":[{"name":"Title","value":"Default + Title"}]}}]}}},"extensions":{"cost":{"requestedQueryCost":11,"actualQueryCost":5,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1995,"restoreRate":100.0},"fields":[{"path":["product","variants","edges","node","selectedOptions","name"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["product","variants","edges","node","selectedOptions","value"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["product","variants","edges","node","selectedOptions"],"definedCost":1,"requestedTotalCost":1,"requestedChildrenCost":0},{"path":["product","variants","edges","node"],"definedCost":1,"requestedTotalCost":2,"requestedChildrenCost":1},{"path":["product","variants","edges"],"definedCost":0,"requestedTotalCost":2,"requestedChildrenCost":2},{"path":["product","variants"],"definedCost":null,"requestedTotalCost":10,"requestedChildrenCost":2},{"path":["product"],"definedCost":1,"requestedTotalCost":11,"requestedChildrenCost":10}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:19 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productDelete($input: ProductDeleteInput!) {\n productDelete(input: + $input) {\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"id":"gid://shopify/Product/7352958320693"}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:26 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=569.000006 + - processing;dur=505, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=df057036-d5b9-42da-ac95-54beac7badb6' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=df057036-d5b9-42da-ac95-54beac7badb6 + X-Envoy-Upstream-Service-Time: + - '507' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - df057036-d5b9-42da-ac95-54beac7badb6 + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=05CzHtfd8xKS96fU28hEFSadYWz1xyZVQiK0op%2BvZyKUDOWQygcuHUr5X53CKis93%2F%2BfI3As6PNztWog2DOUGQLvP15ZDjr%2Fli8SwbnVwGfhLaIwX%2Bqnkm%2BtpT094lx1GtKxHWlqV2EJ"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9bec596d1763-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productDelete":{"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productDelete","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productDelete"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:20 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productDelete($input: ProductDeleteInput!) {\n productDelete(input: + $input) {\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"id":"gid://shopify/Product/7352958353461"}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:26 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=420.999765 + - processing;dur=367, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=3c9f6389-582b-4c94-9076-247e1c0f80e1' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=3c9f6389-582b-4c94-9076-247e1c0f80e1 + X-Envoy-Upstream-Service-Time: + - '369' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - 3c9f6389-582b-4c94-9076-247e1c0f80e1 + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=LEjNOgceZBNESJVYcHyduqas2%2FZVeXuvQ6Kv4DtEpDO5%2B8nN0TMA73jIgZFAvbAgbTOKuAjiVJ8T8IYDZ9%2BCMrbUlp56xKzcod6sY36V0KB03DM4jAA45aymxYZNzmwFAyeJsrMQQgJ0"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9bf09880062c-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productDelete":{"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productDelete","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productDelete"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:20 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/cassettes/Shopify_DefaultVariant/_match_/given_a_GraphQL_response_hash/given_a_product_with_a_default_variant/returns_true_when_its_variants_only_contain_the_default_variant_s_title.yml b/spec/cassettes/Shopify_DefaultVariant/_match_/given_a_GraphQL_response_hash/given_a_product_with_a_default_variant/returns_true_when_its_variants_only_contain_the_default_variant_s_title.yml new file mode 100644 index 0000000..738b66a --- /dev/null +++ b/spec/cassettes/Shopify_DefaultVariant/_match_/given_a_GraphQL_response_hash/given_a_product_with_a_default_variant/returns_true_when_its_variants_only_contain_the_default_variant_s_title.yml @@ -0,0 +1,530 @@ +--- +http_interactions: +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productCreate($input: ProductInput!) {\n productCreate(input: + $input) {\n product {\n id\n }\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"title":"Shopify::DefaultVariant + Test Product Without Variants"}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:27 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=365.000010 + - processing;dur=311, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=f1189602-fb26-438d-88cf-680cb2808beb' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=f1189602-fb26-438d-88cf-680cb2808beb + X-Envoy-Upstream-Service-Time: + - '314' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - f1189602-fb26-438d-88cf-680cb2808beb + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=QajQJmipKAoSx%2FEDi3144sv5bNPvtYpzf8STW9ioI0MXGEDzW4CZUZGM6Q0voEd7wcDWq6UOeX66duW74AxeB%2BPAAmvFj61eTiFUxm2qtZv6mk%2BuN%2FanmTKLC8QafaG9VFysrS3CsuU3"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9bf38ad36fec-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productCreate":{"product":{"id":"gid://shopify/Product/7352958484533"},"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productCreate","product","id"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","product"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:21 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productCreate($input: ProductInput!) {\n productCreate(input: + $input) {\n product {\n id\n }\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"title":"Shopify::DefaultVariant + Test Product With Variants","options":["Color"],"variants":[{"title":"Variant + 1","options":["Red"]}]}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:27 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + X-Shopify-Api-Deprecated-Reason: + - https://shopify.dev/api/usage/versioning#deprecation-practices + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=375.999928 + - processing;dur=318, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=3125bd5c-89b0-40c2-ac12-1fcc159e61be' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=3125bd5c-89b0-40c2-ac12-1fcc159e61be + X-Envoy-Upstream-Service-Time: + - '320' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - 3125bd5c-89b0-40c2-ac12-1fcc159e61be + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=RBdeAneyzfp3l3om2PR8GPgZnvf04Oz9MJ7MtsnwIU1XbJp1NVIjOEqMmlsFVMYBXwFxMz6I6whmpD0ugdENabJ7H4RT6%2B4y4ZN%2BF1ZrbAVEv6n1Kls3GWhRec2cTnyz%2Fm%2BUNDLATXRV"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9bf61ccb28c8-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productCreate":{"product":{"id":"gid://shopify/Product/7352958517301"},"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productCreate","product","id"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","product"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:21 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" query {\n product(id: \"gid://shopify/Product/7352958484533\") + {\n variants(first: 10) {\n edges {\n node + {\n title\n }\n }\n }\n }\n }\n"}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:28 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=128.000021 + - processing;dur=78, graphql;desc="admin/query/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=149eec38-ada7-41dd-af55-9334cccda65a' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=149eec38-ada7-41dd-af55-9334cccda65a + X-Envoy-Upstream-Service-Time: + - '81' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - 149eec38-ada7-41dd-af55-9334cccda65a + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=X4Q7kSHuGy3uS38mCKz383NODCVHQMOt7KNSvSNUShQsJD0I6drn%2Fa5IUk%2FX55AQNlQ3NnGoAb10slPycPyTFHty3sXpZ8Dfehl9Yiil9NnWN8D85jv0wclO1Lf8mX3y33UvIEWiuo5h"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9bf94ee87009-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"product":{"variants":{"edges":[{"node":{"title":"Default + Title"}}]}}},"extensions":{"cost":{"requestedQueryCost":7,"actualQueryCost":4,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1996,"restoreRate":100.0},"fields":[{"path":["product","variants","edges","node","title"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["product","variants","edges","node"],"definedCost":1,"requestedTotalCost":1,"requestedChildrenCost":0},{"path":["product","variants","edges"],"definedCost":0,"requestedTotalCost":1,"requestedChildrenCost":1},{"path":["product","variants"],"definedCost":null,"requestedTotalCost":6,"requestedChildrenCost":1},{"path":["product"],"definedCost":1,"requestedTotalCost":7,"requestedChildrenCost":6}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:21 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productDelete($input: ProductDeleteInput!) {\n productDelete(input: + $input) {\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"id":"gid://shopify/Product/7352958484533"}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:28 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=630.000114 + - processing;dur=522, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=2872bd83-5936-49c0-9e97-6dfbb72acdd3' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=2872bd83-5936-49c0-9e97-6dfbb72acdd3 + X-Envoy-Upstream-Service-Time: + - '524' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - 2872bd83-5936-49c0-9e97-6dfbb72acdd3 + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=NuXYl1aHV0ix%2BUI7TVXA8hxvU9brakuSZ%2FXCXyTgtNn6kL7f86Lktqc1nKBhdzmrte1uPy%2BqOTnsEq54wNRIR8ulHWJkTCG843dewmKQgKkmTuuZeT2nAWfmkUpgYTIou%2F0HbYSEcI%2B%2F"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9bfa5d0757ac-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productDelete":{"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productDelete","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productDelete"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:22 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productDelete($input: ProductDeleteInput!) {\n productDelete(input: + $input) {\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"id":"gid://shopify/Product/7352958517301"}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:29 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=471.999884 + - processing;dur=412, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=eea268ad-c959-4a65-b8c6-c74840c2c795' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=eea268ad-c959-4a65-b8c6-c74840c2c795 + X-Envoy-Upstream-Service-Time: + - '414' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - eea268ad-c959-4a65-b8c6-c74840c2c795 + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=Li6kLU5MRVCdrvZbWJgqffHH0uu9ILN5RyTgQhRRJhHdtA8En496f%2BIxBsKCr%2F8ImDHftDtiwCROTvY7Lb%2FyBrTk5pF8q9wynHC5JZH7moFZ5nbHZRlW7RBavMYlEzhQrCdvx20fsWuo"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9bff0eb0081a-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productDelete":{"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productDelete","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productDelete"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:23 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/cassettes/Shopify_DefaultVariant/_match_/given_a_GraphQL_response_hash/given_a_product_with_a_default_variant/returns_true_when_its_variants_only_contain_the_default_variant_s_title_and_selectedOptions.yml b/spec/cassettes/Shopify_DefaultVariant/_match_/given_a_GraphQL_response_hash/given_a_product_with_a_default_variant/returns_true_when_its_variants_only_contain_the_default_variant_s_title_and_selectedOptions.yml new file mode 100644 index 0000000..fbb2535 --- /dev/null +++ b/spec/cassettes/Shopify_DefaultVariant/_match_/given_a_GraphQL_response_hash/given_a_product_with_a_default_variant/returns_true_when_its_variants_only_contain_the_default_variant_s_title_and_selectedOptions.yml @@ -0,0 +1,530 @@ +--- +http_interactions: +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productCreate($input: ProductInput!) {\n productCreate(input: + $input) {\n product {\n id\n }\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"title":"Shopify::DefaultVariant + Test Product Without Variants"}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:29 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=350.000143 + - processing;dur=288, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - canary + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=095d96c6-d702-422b-9920-250c6f1eeb99' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=095d96c6-d702-422b-9920-250c6f1eeb99 + X-Envoy-Upstream-Service-Time: + - '290' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - '095d96c6-d702-422b-9920-250c6f1eeb99' + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=bymxYMDdfRdjjJAwCkcOkxW3Iq6R44qq3cOGVPcdU0vHUBMo20W3mpBxoUEyvNyTGrSdeV9GIuaSvbNonXsirBt%2BS1wPK0vzAO4JJqxHHmk6mIOsD2POT%2BPn0HvkW6sTsPcNzISMMKS6"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c030f4305ec-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productCreate":{"product":{"id":"gid://shopify/Product/7352958615605"},"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productCreate","product","id"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","product"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:23 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productCreate($input: ProductInput!) {\n productCreate(input: + $input) {\n product {\n id\n }\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"title":"Shopify::DefaultVariant + Test Product With Variants","options":["Color"],"variants":[{"title":"Variant + 1","options":["Red"]}]}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:30 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + X-Shopify-Api-Deprecated-Reason: + - https://shopify.dev/api/usage/versioning#deprecation-practices + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=428.999901 + - processing;dur=372, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=63bbd43b-ac6c-44a9-b8f6-c61c871a7bbc' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=63bbd43b-ac6c-44a9-b8f6-c61c871a7bbc + X-Envoy-Upstream-Service-Time: + - '374' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - 63bbd43b-ac6c-44a9-b8f6-c61c871a7bbc + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=XT3ewCNHIQHL37cbJ540zoVFgmG0ZHGTYageGKDjemGE5I7wTInTb3wfomeEXN3Li7vdDFyXo3eIWH7Nirt1B2A%2BYKNnTla%2B1W2lgfd2Iv3Z6zsSNV1txrEZUMxGzeb%2FzYpslD%2Foxbp6"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c06eb6007a8-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productCreate":{"product":{"id":"gid://shopify/Product/7352958681141"},"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productCreate","product","id"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","product"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:24 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" query {\n product(id: \"gid://shopify/Product/7352958615605\") + {\n variants(first: 10) {\n edges {\n node + {\n title\n selectedOptions {\n name\n value\n }\n }\n }\n }\n }\n }\n"}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:30 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=131.000042 + - processing;dur=74, graphql;desc="admin/query/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=26dbeb24-d1d7-435f-91bb-dec9ba270e14' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=26dbeb24-d1d7-435f-91bb-dec9ba270e14 + X-Envoy-Upstream-Service-Time: + - '80' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - 26dbeb24-d1d7-435f-91bb-dec9ba270e14 + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=FY5JUGWH2G6vWt3BfXNb1PN3BbnN1W%2Bq0XdyqZNVN0sJRe3FYzqDYTRpQB7xpmjkb1ybrB%2BfW3Mgm5UGbDJAn3Z0gXeK7ADdPFnh8d%2FyH93%2B%2Ffxbz3W%2BAvBGEGrtj22%2FIGGLVsRreswE"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c0a9c5c56e6-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"product":{"variants":{"edges":[{"node":{"title":"Default + Title","selectedOptions":[{"name":"Title","value":"Default Title"}]}}]}}},"extensions":{"cost":{"requestedQueryCost":11,"actualQueryCost":5,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1995,"restoreRate":100.0},"fields":[{"path":["product","variants","edges","node","title"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["product","variants","edges","node","selectedOptions","name"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["product","variants","edges","node","selectedOptions","value"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["product","variants","edges","node","selectedOptions"],"definedCost":1,"requestedTotalCost":1,"requestedChildrenCost":0},{"path":["product","variants","edges","node"],"definedCost":1,"requestedTotalCost":2,"requestedChildrenCost":1},{"path":["product","variants","edges"],"definedCost":0,"requestedTotalCost":2,"requestedChildrenCost":2},{"path":["product","variants"],"definedCost":null,"requestedTotalCost":10,"requestedChildrenCost":2},{"path":["product"],"definedCost":1,"requestedTotalCost":11,"requestedChildrenCost":10}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:24 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productDelete($input: ProductDeleteInput!) {\n productDelete(input: + $input) {\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"id":"gid://shopify/Product/7352958615605"}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:31 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=432.999849 + - processing;dur=361, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=8153e03d-7934-4715-a070-98f5cc8412f2' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=8153e03d-7934-4715-a070-98f5cc8412f2 + X-Envoy-Upstream-Service-Time: + - '362' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - 8153e03d-7934-4715-a070-98f5cc8412f2 + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=sw%2BVuKfkt1aGA7BaZr6X9%2Bku0v%2BKRUtPkMfQhthIptJaZc5xo4ClzT%2BqR1T143r%2BTnmUVM0Q%2FfQ1VlA5TzS6eexdk8fq%2BlwlTCcx6SpjataMhuaMjlWtFA8EgzwtpUVwYj6xCWQ%2BkEKC"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c0bbbb92d13-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productDelete":{"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productDelete","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productDelete"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:25 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productDelete($input: ProductDeleteInput!) {\n productDelete(input: + $input) {\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"id":"gid://shopify/Product/7352958681141"}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:31 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=514.999866 + - processing;dur=452, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=8ccd18a1-2e49-4b00-8652-53f53e1da3b0' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=8ccd18a1-2e49-4b00-8652-53f53e1da3b0 + X-Envoy-Upstream-Service-Time: + - '454' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - 8ccd18a1-2e49-4b00-8652-53f53e1da3b0 + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=zpzQPf0YH3eN5w6Sws9UfxHyLx3BbhTo9SOR4TFGJBzacFWLgqnxuWMz0LdeVjX61kSkc9KmxHXXmfTNBJmFHRVrpf%2FGIBO9s6xilbXHgEAoc4%2BXECS1nfVTkgt8EK%2Bo22L8ULH8KGJE"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c0f1e1e20ab-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productDelete":{"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productDelete","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productDelete"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:25 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/cassettes/Shopify_DefaultVariant/_match_/given_a_GraphQL_response_hash/given_a_product_without_a_default_variant/returns_false_when_hasOnlyDefaultVariant_is_false.yml b/spec/cassettes/Shopify_DefaultVariant/_match_/given_a_GraphQL_response_hash/given_a_product_without_a_default_variant/returns_false_when_hasOnlyDefaultVariant_is_false.yml new file mode 100644 index 0000000..e699404 --- /dev/null +++ b/spec/cassettes/Shopify_DefaultVariant/_match_/given_a_GraphQL_response_hash/given_a_product_without_a_default_variant/returns_false_when_hasOnlyDefaultVariant_is_false.yml @@ -0,0 +1,528 @@ +--- +http_interactions: +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productCreate($input: ProductInput!) {\n productCreate(input: + $input) {\n product {\n id\n }\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"title":"Shopify::DefaultVariant + Test Product Without Variants"}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:34 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=407.999992 + - processing;dur=351, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=081050a5-286c-4667-9e59-a5625def8d09' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=081050a5-286c-4667-9e59-a5625def8d09 + X-Envoy-Upstream-Service-Time: + - '353' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - '081050a5-286c-4667-9e59-a5625def8d09' + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=83OP4IU28tb4TsdZ%2BdV%2BXGe8lrpJNC7cRGjKStBNk7w2PSQuJHtRt4sCGCvuH1AER2BEVvpoYleiNoXvBwhrP6O1eqmjYtc48%2BTyKT%2BX54SMSe8ye3Ww%2Bukt0%2Bk8mbQ3xUJ52IMyFAU9"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c222cd138a6-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productCreate":{"product":{"id":"gid://shopify/Product/7352958877749"},"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productCreate","product","id"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","product"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:28 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productCreate($input: ProductInput!) {\n productCreate(input: + $input) {\n product {\n id\n }\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"title":"Shopify::DefaultVariant + Test Product With Variants","options":["Color"],"variants":[{"title":"Variant + 1","options":["Red"]}]}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:35 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + X-Shopify-Api-Deprecated-Reason: + - https://shopify.dev/api/usage/versioning#deprecation-practices + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=405.999899 + - processing;dur=327, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=3662b0c1-1c11-426d-8343-9e8a42593b66' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=3662b0c1-1c11-426d-8343-9e8a42593b66 + X-Envoy-Upstream-Service-Time: + - '329' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - 3662b0c1-1c11-426d-8343-9e8a42593b66 + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=NY6fApZuSOPEkGIkaaWkofMTOGj34w8BPUoovlTYnswwIfhimXPqpPjzTIFUI0HxWZQ%2Biy75hj7N9qE10Z03i%2F%2FOjA2%2Bc06Pt6xybpPBY2LmX26cXqvNYlaRfpibILXvXAM06f0wdskm"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c24fa261753-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productCreate":{"product":{"id":"gid://shopify/Product/7352958910517"},"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productCreate","product","id"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","product"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:29 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" query {\n product(id: \"gid://shopify/Product/7352958910517\") + {\n hasOnlyDefaultVariant\n }\n }\n"}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:35 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=127.000093 + - processing;dur=75, graphql;desc="admin/query/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=82197fb8-10fd-49fe-9835-866fdb314747' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=82197fb8-10fd-49fe-9835-866fdb314747 + X-Envoy-Upstream-Service-Time: + - '77' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - 82197fb8-10fd-49fe-9835-866fdb314747 + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=xaKEGeKUcpCZBOYAlnbsqAD3VegDVUFpiIzsE%2FcqVst5hx456roM8ECKJlb4f4iwCm%2FA1cmv3CGVDfnYo6tbx06fhkShSTM%2BwdkB1FoOA0bvdoGuCpwh9cKg34LKiQPv9gC6uniIPxo7"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c28092e82a2-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"product":{"hasOnlyDefaultVariant":false}},"extensions":{"cost":{"requestedQueryCost":1,"actualQueryCost":1,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1999,"restoreRate":100.0},"fields":[{"path":["product","hasOnlyDefaultVariant"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["product"],"definedCost":1,"requestedTotalCost":1,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:29 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productDelete($input: ProductDeleteInput!) {\n productDelete(input: + $input) {\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"id":"gid://shopify/Product/7352958877749"}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:36 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=490.999937 + - processing;dur=423, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=f50764a5-6b9d-49fa-9787-c2690826a54d' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=f50764a5-6b9d-49fa-9787-c2690826a54d + X-Envoy-Upstream-Service-Time: + - '427' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - f50764a5-6b9d-49fa-9787-c2690826a54d + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=iMmJzT441l9a5FCAXPrjTkSQuogU0053TsKdUrmlz6IMq2d39Fj7pZ6QHRvt40TrMA5wgR%2BLtuXvIw30D6If1RhNjYH0D3WCvOxtDbw03h5M69u%2FXX95EGB1I9jqWDy9y8ZDHdIHMe9U"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c292de4241b-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productDelete":{"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productDelete","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productDelete"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:29 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productDelete($input: ProductDeleteInput!) {\n productDelete(input: + $input) {\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"id":"gid://shopify/Product/7352958910517"}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:36 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=454.999924 + - processing;dur=377, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=8c2190d0-9be1-4a0f-b306-044aaa737e14' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=8c2190d0-9be1-4a0f-b306-044aaa737e14 + X-Envoy-Upstream-Service-Time: + - '380' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - 8c2190d0-9be1-4a0f-b306-044aaa737e14 + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=4XEnZXwHJcr8pujYHeAXEm68fBrD%2BnjvIKoTpFa%2FxVLInLEalcDF1rMuuU3wk%2FQ8Kj61ECorlwTiW%2BXfUdRhvPgQ8NTJVKz3AGPXbJVLD6VAAIhLuG6t91lavJm4l4kiHTq%2BHY6QzGSt"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c2c9aaa398b-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productDelete":{"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productDelete","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productDelete"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:30 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/cassettes/Shopify_DefaultVariant/_match_/given_a_GraphQL_response_hash/given_a_product_without_a_default_variant/returns_false_when_it_contains_the_variant_count_and_its_variants_do_not_contain_a_default_variant.yml b/spec/cassettes/Shopify_DefaultVariant/_match_/given_a_GraphQL_response_hash/given_a_product_without_a_default_variant/returns_false_when_it_contains_the_variant_count_and_its_variants_do_not_contain_a_default_variant.yml new file mode 100644 index 0000000..66cf18a --- /dev/null +++ b/spec/cassettes/Shopify_DefaultVariant/_match_/given_a_GraphQL_response_hash/given_a_product_without_a_default_variant/returns_false_when_it_contains_the_variant_count_and_its_variants_do_not_contain_a_default_variant.yml @@ -0,0 +1,529 @@ +--- +http_interactions: +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productCreate($input: ProductInput!) {\n productCreate(input: + $input) {\n product {\n id\n }\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"title":"Shopify::DefaultVariant + Test Product Without Variants"}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:41 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=398.999929 + - processing;dur=344, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=8a26cb73-2768-4f8c-8f94-f3f35d4189b1' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=8a26cb73-2768-4f8c-8f94-f3f35d4189b1 + X-Envoy-Upstream-Service-Time: + - '347' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - 8a26cb73-2768-4f8c-8f94-f3f35d4189b1 + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=Bq7rbTlFJnLU8XNfNUmdLaYPEIdHKz9PEgtmM%2FpltrD8HG4g3T0rTFZ0AtEYhsxRij%2BsRZKrKdckYkgXRYyXH5PGi3SJkgRnVgcu7xHTeiuvlHa0eRjyin3E8Ba%2FeaXHEYyAfVVnoYxc"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c4cfa4e8f11-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productCreate":{"product":{"id":"gid://shopify/Product/7352959139893"},"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productCreate","product","id"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","product"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:35 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productCreate($input: ProductInput!) {\n productCreate(input: + $input) {\n product {\n id\n }\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"title":"Shopify::DefaultVariant + Test Product With Variants","options":["Color"],"variants":[{"title":"Variant + 1","options":["Red"]}]}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:42 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + X-Shopify-Api-Deprecated-Reason: + - https://shopify.dev/api/usage/versioning#deprecation-practices + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=326.999903 + - processing;dur=278, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=58720419-698a-4273-be10-d89bb4d98a6f' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=58720419-698a-4273-be10-d89bb4d98a6f + X-Envoy-Upstream-Service-Time: + - '279' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - 58720419-698a-4273-be10-d89bb4d98a6f + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=XGejQNxwg36KgM2vKVQIBmb1LA34Ncft8eQNeh2y88klMpsIjA7A3S9WJwOO3RSSBfn%2BE8qnFrhQ5gHXoWQUmMXw5dYsZXToDYv%2BT8p30xilSiA9dWIfE8xS%2Fd24xMNVNIWLoMLGkUHO"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c505b868021-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productCreate":{"product":{"id":"gid://shopify/Product/7352959172661"},"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productCreate","product","id"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","product"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:35 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" query {\n product(id: \"gid://shopify/Product/7352959172661\") + {\n totalVariants\n variants(first: 10) {\n edges + {\n node {\n title\n }\n }\n }\n }\n }\n"}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:42 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=135.999918 + - processing;dur=73, graphql;desc="admin/query/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=cfd30927-5343-4a83-90b4-77e5da56d841' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=cfd30927-5343-4a83-90b4-77e5da56d841 + X-Envoy-Upstream-Service-Time: + - '75' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - cfd30927-5343-4a83-90b4-77e5da56d841 + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=5an8tTvqIycW9Aj1FdUdqbY8Z3%2FgVcawRxCvjkFUpa4bbsp%2Bof6DHXysqy5MMe%2F2%2BCXL5iX%2FJFnnhMxZqFUl9kPKnbBJWDEQs6Ix4aNqnq9%2FTRQ1gVeLntRiToDvtyEjxOM%2Bc7OgCAbB"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c52db5105e5-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"product":{"totalVariants":1,"variants":{"edges":[{"node":{"title":"Red"}}]}}},"extensions":{"cost":{"requestedQueryCost":7,"actualQueryCost":4,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1996,"restoreRate":100.0},"fields":[{"path":["product","totalVariants"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["product","variants","edges","node","title"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["product","variants","edges","node"],"definedCost":1,"requestedTotalCost":1,"requestedChildrenCost":0},{"path":["product","variants","edges"],"definedCost":0,"requestedTotalCost":1,"requestedChildrenCost":1},{"path":["product","variants"],"definedCost":null,"requestedTotalCost":6,"requestedChildrenCost":1},{"path":["product"],"definedCost":1,"requestedTotalCost":7,"requestedChildrenCost":6}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:36 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productDelete($input: ProductDeleteInput!) {\n productDelete(input: + $input) {\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"id":"gid://shopify/Product/7352959139893"}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:42 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=575.999975 + - processing;dur=525, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=54fa7e99-1b4b-4994-ba92-c41b8aabf66c' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=54fa7e99-1b4b-4994-ba92-c41b8aabf66c + X-Envoy-Upstream-Service-Time: + - '526' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - 54fa7e99-1b4b-4994-ba92-c41b8aabf66c + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=nYno5KJ%2BqLa6PbOdrw74l1yFIqfvUWXKNCNFIs56mw%2FeO%2FUYreanwmHydrxLDwVF47VgEkhBTeTI%2F64mzy9DmqbO6VeonHdKy5fIjyrjEan%2B%2FpwtLGyJ3IguhUsDfTmYTk%2Fdum9%2B31G2"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c540ebd59bb-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productDelete":{"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productDelete","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productDelete"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:36 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productDelete($input: ProductDeleteInput!) {\n productDelete(input: + $input) {\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"id":"gid://shopify/Product/7352959172661"}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:43 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=398.000002 + - processing;dur=340, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=b53d02f4-5272-4b70-a4b7-9e59129b27f9' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=b53d02f4-5272-4b70-a4b7-9e59129b27f9 + X-Envoy-Upstream-Service-Time: + - '341' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - b53d02f4-5272-4b70-a4b7-9e59129b27f9 + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=89%2BaX2qMayBxVgawIN3Hgoyp%2FNhBjucF7zgb8e3zcs0kykwWOGlEg%2B3ZpOiN8IeBt13Q8noShGHqULGcB59ma4lH81dXUjH8xET6kgxyBFDdEAIoSvsoC88IxXZmUugJ8r8e2rvocsot"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c57fcd91752-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productDelete":{"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productDelete","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productDelete"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:37 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/cassettes/Shopify_DefaultVariant/_match_/given_a_GraphQL_response_hash/given_a_product_without_a_default_variant/returns_false_when_its_variants_do_not_contain_a_default_variant_title.yml b/spec/cassettes/Shopify_DefaultVariant/_match_/given_a_GraphQL_response_hash/given_a_product_without_a_default_variant/returns_false_when_its_variants_do_not_contain_a_default_variant_title.yml new file mode 100644 index 0000000..ea93ce8 --- /dev/null +++ b/spec/cassettes/Shopify_DefaultVariant/_match_/given_a_GraphQL_response_hash/given_a_product_without_a_default_variant/returns_false_when_its_variants_do_not_contain_a_default_variant_title.yml @@ -0,0 +1,529 @@ +--- +http_interactions: +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productCreate($input: ProductInput!) {\n productCreate(input: + $input) {\n product {\n id\n }\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"title":"Shopify::DefaultVariant + Test Product Without Variants"}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:39 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=372.999907 + - processing;dur=319, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=bab64e8b-e501-4149-b075-5041e92da1c5' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=bab64e8b-e501-4149-b075-5041e92da1c5 + X-Envoy-Upstream-Service-Time: + - '322' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - bab64e8b-e501-4149-b075-5041e92da1c5 + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=iVFO356uziPHYq%2F8SCOmjKpytIBO23455YhZzeP%2F8NZ1tczxiLUnSEvAlflNLH6VksSXoAC4s%2BQTXy5ji67xm4fRzFT5XMfw2RXdcgK2%2FHEKCSYzwyRfmq%2BaFglRbBAdp7WE7eEFVoI%2B"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c3e3fb86fd9-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productCreate":{"product":{"id":"gid://shopify/Product/7352959041589"},"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productCreate","product","id"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","product"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:32 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productCreate($input: ProductInput!) {\n productCreate(input: + $input) {\n product {\n id\n }\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"title":"Shopify::DefaultVariant + Test Product With Variants","options":["Color"],"variants":[{"title":"Variant + 1","options":["Red"]}]}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:39 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + X-Shopify-Api-Deprecated-Reason: + - https://shopify.dev/api/usage/versioning#deprecation-practices + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=332.000017 + - processing;dur=265, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=fb79f0ea-cb7b-4baf-a626-01ae5843f0c3' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=fb79f0ea-cb7b-4baf-a626-01ae5843f0c3 + X-Envoy-Upstream-Service-Time: + - '268' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - fb79f0ea-cb7b-4baf-a626-01ae5843f0c3 + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=gs8R%2B9kqgb1isX2%2FMzYVblZZz0PO1i1gMvze4ZmN4jouXW4BnkUktl2QGsvisIxzb93HWPMwusMrK5qBufql%2B6bgyhTVp%2F1RxhfPPSxVubSOnZkAE%2FD4s%2FhU0cNY5QewFhT0gPxZQC5a"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c40db1c3b06-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productCreate":{"product":{"id":"gid://shopify/Product/7352959074357"},"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productCreate","product","id"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","product"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:33 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" query {\n product(id: \"gid://shopify/Product/7352959074357\") + {\n variants(first: 10) {\n edges {\n node + {\n title\n }\n }\n }\n }\n }\n"}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:39 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=115.000010 + - processing;dur=68, graphql;desc="admin/query/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=bf36ae2f-90e4-4f7c-8980-a1357ddbeb3a' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=bf36ae2f-90e4-4f7c-8980-a1357ddbeb3a + X-Envoy-Upstream-Service-Time: + - '70' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - bf36ae2f-90e4-4f7c-8980-a1357ddbeb3a + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=Rh5RvBQNhhd5FC46jPhqgNa1fU3wIUxzF7CdxyyODvW7MiK4RA%2F2NVRkHOAmCHhv%2Bfurh1WtKvqcr86LaCLKDKoDBdu3%2FjhYx02nWbxXvTF3ziezIxQjUhDOyDkUnoTooBvarWNAz4q5"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c436ff92003-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"product":{"variants":{"edges":[{"node":{"title":"Red"}}]}}},"extensions":{"cost":{"requestedQueryCost":7,"actualQueryCost":4,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1996,"restoreRate":100.0},"fields":[{"path":["product","variants","edges","node","title"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["product","variants","edges","node"],"definedCost":1,"requestedTotalCost":1,"requestedChildrenCost":0},{"path":["product","variants","edges"],"definedCost":0,"requestedTotalCost":1,"requestedChildrenCost":1},{"path":["product","variants"],"definedCost":null,"requestedTotalCost":6,"requestedChildrenCost":1},{"path":["product"],"definedCost":1,"requestedTotalCost":7,"requestedChildrenCost":6}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:33 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productDelete($input: ProductDeleteInput!) {\n productDelete(input: + $input) {\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"id":"gid://shopify/Product/7352959041589"}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:40 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=502.000093 + - processing;dur=450, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=86e73683-1e17-4256-b59a-7f484c623da2' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=86e73683-1e17-4256-b59a-7f484c623da2 + X-Envoy-Upstream-Service-Time: + - '453' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - 86e73683-1e17-4256-b59a-7f484c623da2 + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=8wVZHxdexW9NUUw3E1z0t8BgqcPe4dlyaCbiyddLT11mBlTd57qof8a5QwaItya6DH1ccOruROvyLRPePus6GOhhtbWI%2Fui2FJvzyZUHvf11sNkSksB1nYQ1xp5APzmfywSZ7Lf8JY2R"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c44acf5587e-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productDelete":{"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productDelete","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productDelete"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:34 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productDelete($input: ProductDeleteInput!) {\n productDelete(input: + $input) {\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"id":"gid://shopify/Product/7352959074357"}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:41 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=645.999908 + - processing;dur=589, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=954b09aa-ba6f-49fe-85bd-197a695bdb57' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=954b09aa-ba6f-49fe-85bd-197a695bdb57 + X-Envoy-Upstream-Service-Time: + - '592' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - 954b09aa-ba6f-49fe-85bd-197a695bdb57 + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=7MZtlSJ5bcDWqqqfAqhGRZ8Asg8Nrwp6m%2F13iLWw2OOYDOjPQgpX0FjsNEgjcSA2InwNfqOppHT6XERUYzcZfTV36U4VJ0rtRIh%2BPLYz2eb0dQ0ROWoOIf30Q927GKHu3iaKrASqYnKF"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c482adf0628-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productDelete":{"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productDelete","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productDelete"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:34 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/cassettes/Shopify_DefaultVariant/_match_/given_a_GraphQL_response_hash/given_a_product_without_a_default_variant/returns_false_when_its_variants_only_contain_the_variant_s_selectedOptions.yml b/spec/cassettes/Shopify_DefaultVariant/_match_/given_a_GraphQL_response_hash/given_a_product_without_a_default_variant/returns_false_when_its_variants_only_contain_the_variant_s_selectedOptions.yml new file mode 100644 index 0000000..9fa9753 --- /dev/null +++ b/spec/cassettes/Shopify_DefaultVariant/_match_/given_a_GraphQL_response_hash/given_a_product_without_a_default_variant/returns_false_when_its_variants_only_contain_the_variant_s_selectedOptions.yml @@ -0,0 +1,529 @@ +--- +http_interactions: +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productCreate($input: ProductInput!) {\n productCreate(input: + $input) {\n product {\n id\n }\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"title":"Shopify::DefaultVariant + Test Product Without Variants"}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:37 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=430.000067 + - processing;dur=363, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=80f5ff81-9174-4fad-87a9-429b90f7e813' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=80f5ff81-9174-4fad-87a9-429b90f7e813 + X-Envoy-Upstream-Service-Time: + - '365' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - 80f5ff81-9174-4fad-87a9-429b90f7e813 + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=aVBrba%2FEGltpjBB5LTRNuu0cc5Sk67yKHZFqSIKc6%2F0bQJTNCK2iIMESO7IgbL5ao8iYRUHYzCBbEzQjFPemDtboSHAXATqG9O4dLEsxEBoO7U4%2Fh8a0dHIuSihunGpA6Dd%2BXLHNeudt"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c30b827066c-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productCreate":{"product":{"id":"gid://shopify/Product/7352958943285"},"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productCreate","product","id"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","product"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:30 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productCreate($input: ProductInput!) {\n productCreate(input: + $input) {\n product {\n id\n }\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"title":"Shopify::DefaultVariant + Test Product With Variants","options":["Color"],"variants":[{"title":"Variant + 1","options":["Red"]}]}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:37 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + X-Shopify-Api-Deprecated-Reason: + - https://shopify.dev/api/usage/versioning#deprecation-practices + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=357.000113 + - processing;dur=301, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=c12f21c7-2f04-4ebc-88fc-19facd7a91a1' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=c12f21c7-2f04-4ebc-88fc-19facd7a91a1 + X-Envoy-Upstream-Service-Time: + - '303' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - c12f21c7-2f04-4ebc-88fc-19facd7a91a1 + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=su1IKxuy%2Fk01uG8vNiFpWGZxLuEI7U6ntjTb2f7veO0zQUUjqwTYUr05pGSqLiLutC%2FseCSz1TA9Tsv1Spv4vD0rt9DUzQJx5X53CfC%2FhdoANIqxiWwm9DvzvBOJpViqH10944y7L7Kt"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c33e8510668-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productCreate":{"product":{"id":"gid://shopify/Product/7352959008821"},"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productCreate","product","id"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","product"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:31 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" query {\n product(id: \"gid://shopify/Product/7352959008821\") + {\n variants(first: 10) {\n edges {\n node + {\n selectedOptions {\n name\n value\n }\n }\n }\n }\n }\n }\n"}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:37 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=121.999741 + - processing;dur=68, graphql;desc="admin/query/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=0eb7f891-02d0-4442-819e-8968a6bc328c' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=0eb7f891-02d0-4442-819e-8968a6bc328c + X-Envoy-Upstream-Service-Time: + - '70' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - 0eb7f891-02d0-4442-819e-8968a6bc328c + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=yuTEnHYgahMc1S7uNSK4dpJQm0ln%2B%2FHdhGFo8syjab1Lq7XLFsnT%2BBwQ4%2FY5PVVgtYu0f2QQLQw5qy%2FpieWz4edUdNvkjDjErfccBBOiynnFhUTHDFcZ30i7RsGvbELl8C69pEqCz%2FN9"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c368b005b3a-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"product":{"variants":{"edges":[{"node":{"selectedOptions":[{"name":"Color","value":"Red"}]}}]}}},"extensions":{"cost":{"requestedQueryCost":11,"actualQueryCost":5,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1995,"restoreRate":100.0},"fields":[{"path":["product","variants","edges","node","selectedOptions","name"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["product","variants","edges","node","selectedOptions","value"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["product","variants","edges","node","selectedOptions"],"definedCost":1,"requestedTotalCost":1,"requestedChildrenCost":0},{"path":["product","variants","edges","node"],"definedCost":1,"requestedTotalCost":2,"requestedChildrenCost":1},{"path":["product","variants","edges"],"definedCost":0,"requestedTotalCost":2,"requestedChildrenCost":2},{"path":["product","variants"],"definedCost":null,"requestedTotalCost":10,"requestedChildrenCost":2},{"path":["product"],"definedCost":1,"requestedTotalCost":11,"requestedChildrenCost":10}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:31 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productDelete($input: ProductDeleteInput!) {\n productDelete(input: + $input) {\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"id":"gid://shopify/Product/7352958943285"}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:38 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=445.999861 + - processing;dur=388, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=379253b2-7425-41ef-893b-374bc190fe6c' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=379253b2-7425-41ef-893b-374bc190fe6c + X-Envoy-Upstream-Service-Time: + - '390' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - 379253b2-7425-41ef-893b-374bc190fe6c + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=eyAWoPGvCm7jYEohhQoKGAywHjbcl8vb8V95skG8dvRMIfXJIV89Kc%2FnHIf5qjn6VwmVIRkW3DdPC%2Fb5%2FoQI1Nd1B2OlYiR%2FkGgU5msxNJDAqB7J4114XyQmowqPTW9PKxaPkxKHTySF"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c379f8e388e-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productDelete":{"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productDelete","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productDelete"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:32 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productDelete($input: ProductDeleteInput!) {\n productDelete(input: + $input) {\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"id":"gid://shopify/Product/7352959008821"}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:38 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=460.000038 + - processing;dur=399, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=f88575f1-4ac5-406a-bc66-32a63d4d034a' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=f88575f1-4ac5-406a-bc66-32a63d4d034a + X-Envoy-Upstream-Service-Time: + - '401' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - f88575f1-4ac5-406a-bc66-32a63d4d034a + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=vjkycrziVZhCQ%2BDZ73EDfzmjl%2BmDW0C%2B7xYyaLp5LcW%2BWv%2BwyZnnBvMawfz%2FVyZFn6GWRvCDwOWtj%2FSOJaTh5FVbPdUQuDKoRjxULHhQlvURMKwxuPNk0vxe%2B%2Fz9sWhq%2B3ngE6cGZFBI"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c3acff707f9-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productDelete":{"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productDelete","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productDelete"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:32 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/cassettes/Shopify_DefaultVariant/_match_/given_a_GraphQL_response_hash/given_a_variant_that_is_not_a_default/returns_false_when_its_variants_contain_a_default_variant_title.yml b/spec/cassettes/Shopify_DefaultVariant/_match_/given_a_GraphQL_response_hash/given_a_variant_that_is_not_a_default/returns_false_when_its_variants_contain_a_default_variant_title.yml new file mode 100644 index 0000000..344a931 --- /dev/null +++ b/spec/cassettes/Shopify_DefaultVariant/_match_/given_a_GraphQL_response_hash/given_a_variant_that_is_not_a_default/returns_false_when_its_variants_contain_a_default_variant_title.yml @@ -0,0 +1,529 @@ +--- +http_interactions: +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productCreate($input: ProductInput!) {\n productCreate(input: + $input) {\n product {\n id\n }\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"title":"Shopify::DefaultVariant + Test Product Without Variants"}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:48 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=322.000027 + - processing;dur=269, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=1bed8b2a-c906-439f-b05a-66ca51ed39ff' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=1bed8b2a-c906-439f-b05a-66ca51ed39ff + X-Envoy-Upstream-Service-Time: + - '271' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - 1bed8b2a-c906-439f-b05a-66ca51ed39ff + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=q04p9p36mcCPvEnbqWRbbRzu4hmG%2BiZqibUz8xTatmKKbxOHPcCnKpfBMcDhx3DDZLB4033SfcLSFpS2uOg3aCZiEJYmE%2FzlgesvgInF9l0QLddfUZbBHGHq%2F49gHUzGi6cxITGDkqag"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c77dd79582a-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productCreate":{"product":{"id":"gid://shopify/Product/7352959434805"},"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productCreate","product","id"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","product"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:42 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productCreate($input: ProductInput!) {\n productCreate(input: + $input) {\n product {\n id\n }\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"title":"Shopify::DefaultVariant + Test Product With Variants","options":["Color"],"variants":[{"title":"Variant + 1","options":["Red"]}]}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:49 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + X-Shopify-Api-Deprecated-Reason: + - https://shopify.dev/api/usage/versioning#deprecation-practices + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=382.999897 + - processing;dur=328, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=effefd3e-0b69-459d-b41f-3ca63e34f2e2' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=effefd3e-0b69-459d-b41f-3ca63e34f2e2 + X-Envoy-Upstream-Service-Time: + - '330' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - effefd3e-0b69-459d-b41f-3ca63e34f2e2 + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=K08hH1nu9AGVgZx5jlDBxAeGa0I1FPztNjkMxvuRRYKoZdNC9zmLV9Sy1xk1wziXco89p8XARnjthIIoKKVEEAyTENCdk%2Ffbhwz14VfRywmQIcV6kVsx9%2B%2FjOxvsgZvtbS6BpLLEoaKs"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c80380d5a58-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productCreate":{"product":{"id":"gid://shopify/Product/7352959467573"},"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productCreate","product","id"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","product"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:43 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" query {\n product(id: \"gid://shopify/Product/7352959467573\") + {\n variants(first: 10) {\n edges {\n node + {\n title\n }\n }\n }\n }\n }\n"}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:50 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=139.999866 + - processing;dur=62, graphql;desc="admin/query/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=ca7d6d9e-f5b3-45b6-85a8-706fdd7ce56a' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=ca7d6d9e-f5b3-45b6-85a8-706fdd7ce56a + X-Envoy-Upstream-Service-Time: + - '64' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - ca7d6d9e-f5b3-45b6-85a8-706fdd7ce56a + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=S%2FXjCz15hmSKAiMzCd%2BKfeKdXtPhmL5O7cRlkWKvrf16fqcQJP%2FLGuLRK%2FN6cBD3SOjjbXGXsQ794cOG8KfxKWbbUFryCd1iMWr5XL1Ho2K5zBj%2BoPgzL%2FNsS3PIAlblB7gkk7rMQgyr"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c83ab19082f-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"product":{"variants":{"edges":[{"node":{"title":"Red"}}]}}},"extensions":{"cost":{"requestedQueryCost":7,"actualQueryCost":4,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1996,"restoreRate":100.0},"fields":[{"path":["product","variants","edges","node","title"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["product","variants","edges","node"],"definedCost":1,"requestedTotalCost":1,"requestedChildrenCost":0},{"path":["product","variants","edges"],"definedCost":0,"requestedTotalCost":1,"requestedChildrenCost":1},{"path":["product","variants"],"definedCost":null,"requestedTotalCost":6,"requestedChildrenCost":1},{"path":["product"],"definedCost":1,"requestedTotalCost":7,"requestedChildrenCost":6}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:43 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productDelete($input: ProductDeleteInput!) {\n productDelete(input: + $input) {\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"id":"gid://shopify/Product/7352959434805"}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:50 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=548.999786 + - processing;dur=491, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=7d7e6797-0695-49d2-8335-9c5744210fcb' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=7d7e6797-0695-49d2-8335-9c5744210fcb + X-Envoy-Upstream-Service-Time: + - '493' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - 7d7e6797-0695-49d2-8335-9c5744210fcb + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=kudIOL8oLbirfKfIadot6lcydQBkOTOKT%2BVnkCY5qZeHowqLy5fDjbi2FJTLwo9JkrHTCNfCLyrZCIRKJpqYlmzWcKQYBMYbRr%2B69RMyxWiO%2BXX4Qfb1XUv5C%2BlAZ9lmx1v13SLDr41M"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c850a395962-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productDelete":{"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productDelete","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productDelete"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:44 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productDelete($input: ProductDeleteInput!) {\n productDelete(input: + $input) {\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"id":"gid://shopify/Product/7352959467573"}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:51 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=437.000036 + - processing;dur=381, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=e4288301-9cd4-4cbd-bb65-c5906b490bcc' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=e4288301-9cd4-4cbd-bb65-c5906b490bcc + X-Envoy-Upstream-Service-Time: + - '383' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - e4288301-9cd4-4cbd-bb65-c5906b490bcc + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=QWXwOjvYjT2pmJE1a5tLrJVJ9EpkR%2FxJlBwJ4OwtQoiZS%2FVeys7c9%2B9NVCjZXAJcutiUZoeHobOzVzeHZJR51M8x6UigVytZ%2B5fWDyQzq40LHm03HXg1RPSLkRoKQnFwCM10dgVuJEYC"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c89683a822a-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productDelete":{"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productDelete","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productDelete"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:45 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/cassettes/Shopify_DefaultVariant/_match_/given_a_GraphQL_response_hash/given_a_variant_that_is_not_a_default/returns_false_when_its_variants_contain_a_default_variant_title_and_the_default_variant_s_selectedOptions.yml b/spec/cassettes/Shopify_DefaultVariant/_match_/given_a_GraphQL_response_hash/given_a_variant_that_is_not_a_default/returns_false_when_its_variants_contain_a_default_variant_title_and_the_default_variant_s_selectedOptions.yml new file mode 100644 index 0000000..ec54805 --- /dev/null +++ b/spec/cassettes/Shopify_DefaultVariant/_match_/given_a_GraphQL_response_hash/given_a_variant_that_is_not_a_default/returns_false_when_its_variants_contain_a_default_variant_title_and_the_default_variant_s_selectedOptions.yml @@ -0,0 +1,529 @@ +--- +http_interactions: +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productCreate($input: ProductInput!) {\n productCreate(input: + $input) {\n product {\n id\n }\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"title":"Shopify::DefaultVariant + Test Product Without Variants"}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:51 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=407.999754 + - processing;dur=349, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=2642535c-ac07-4e26-85be-a275aae717f4' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=2642535c-ac07-4e26-85be-a275aae717f4 + X-Envoy-Upstream-Service-Time: + - '352' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - 2642535c-ac07-4e26-85be-a275aae717f4 + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=ozhyUOV5PCEqFE9Hdlp2CYpQvMdYKxRJJGITI9%2BTG2ADJvhqaOpPVot%2Fo43t7wqCW6SieXT2%2BjgWyZVDgY%2FDr%2FabGW8Evitba6IzhgGeBrE%2BPZluHdxvl0P7NwMpWdofiv9VIwJlI6W%2B"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c8ca9857f9e-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productCreate":{"product":{"id":"gid://shopify/Product/7352959533109"},"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productCreate","product","id"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","product"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:45 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productCreate($input: ProductInput!) {\n productCreate(input: + $input) {\n product {\n id\n }\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"title":"Shopify::DefaultVariant + Test Product With Variants","options":["Color"],"variants":[{"title":"Variant + 1","options":["Red"]}]}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:52 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + X-Shopify-Api-Deprecated-Reason: + - https://shopify.dev/api/usage/versioning#deprecation-practices + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=502.999783 + - processing;dur=438, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=635ef39a-0ea1-4584-b6aa-3db54ed17b59' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=635ef39a-0ea1-4584-b6aa-3db54ed17b59 + X-Envoy-Upstream-Service-Time: + - '440' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - 635ef39a-0ea1-4584-b6aa-3db54ed17b59 + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=lyIGYMeOpronnhdCes0drAxYNazItQ%2FM5Mu4Z1fOInmJBdV%2B6nUgnt%2FdMUociFbkWN8vu3E6hp%2F4w634CG1tyrOZIJZkjGfZDt%2BfD4Jjopd%2B9Ffikavkdd7PG4YFflllMTdI3ILk1afW"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c8fcafd82c2-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productCreate":{"product":{"id":"gid://shopify/Product/7352959565877"},"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productCreate","product","id"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","product"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productCreate","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productCreate"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:46 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" query {\n product(id: \"gid://shopify/Product/7352959565877\") + {\n variants(first: 10) {\n edges {\n node + {\n title\n selectedOptions {\n name\n value\n }\n }\n }\n }\n }\n }\n"}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:52 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=108.999968 + - processing;dur=65, graphql;desc="admin/query/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=a34fb488-90dc-44e6-a54a-9c5d5d5f6367' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=a34fb488-90dc-44e6-a54a-9c5d5d5f6367 + X-Envoy-Upstream-Service-Time: + - '67' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - a34fb488-90dc-44e6-a54a-9c5d5d5f6367 + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=ADlrXeys%2BWNZ9fWEvyvS9ncoKFjp5Q9ACiNMbi5b%2BBbTtTyu4vYFi5n4aW5iOsJlGvBhBf%2Bd0F0%2BkKSt%2BbvlDv4sMZ4dF0saaoa8oekksRqM2mwC8cdmelsZFmOBkJYtckSAOrrFglQb"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c933a943b8f-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"product":{"variants":{"edges":[{"node":{"title":"Red","selectedOptions":[{"name":"Color","value":"Red"}]}}]}}},"extensions":{"cost":{"requestedQueryCost":11,"actualQueryCost":5,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1995,"restoreRate":100.0},"fields":[{"path":["product","variants","edges","node","title"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["product","variants","edges","node","selectedOptions","name"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["product","variants","edges","node","selectedOptions","value"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["product","variants","edges","node","selectedOptions"],"definedCost":1,"requestedTotalCost":1,"requestedChildrenCost":0},{"path":["product","variants","edges","node"],"definedCost":1,"requestedTotalCost":2,"requestedChildrenCost":1},{"path":["product","variants","edges"],"definedCost":0,"requestedTotalCost":2,"requestedChildrenCost":2},{"path":["product","variants"],"definedCost":null,"requestedTotalCost":10,"requestedChildrenCost":2},{"path":["product"],"definedCost":1,"requestedTotalCost":11,"requestedChildrenCost":10}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:46 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productDelete($input: ProductDeleteInput!) {\n productDelete(input: + $input) {\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"id":"gid://shopify/Product/7352959533109"}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:53 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=470.000029 + - processing;dur=416, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=f66a2011-3c6d-451c-be48-abe7e01e2719' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=f66a2011-3c6d-451c-be48-abe7e01e2719 + X-Envoy-Upstream-Service-Time: + - '418' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - f66a2011-3c6d-451c-be48-abe7e01e2719 + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=zqjf%2BW8e60AMCx5T4aR1APx37MQjlpNKxaqgLjkXoUWMEkvwcM36ZuTgDxpEWS9WHLWA2jSgKPon1ldU%2FmX%2BlgbWTFbn9eG6w1jzi8%2FRqeedERla0U8Po2lB9pLRcvT%2B3307bKbYEL%2BU"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c944a185a45-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productDelete":{"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productDelete","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productDelete"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:46 GMT +- request: + method: post + uri: https:///admin/api/graphql.json + body: + encoding: UTF-8 + string: '{"query":" mutation productDelete($input: ProductDeleteInput!) {\n productDelete(input: + $input) {\n userErrors {\n field\n message\n }\n }\n }\n","variables":{"input":{"id":"gid://shopify/Product/7352959565877"}}}' + headers: + Accept-Encoding: + - gzip;q=1.0,deflate;q=0.6,identity;q=0.3 + Accept: + - "*/*" + User-Agent: + - ShopifyAPI::GraphQL::Tiny v0.1.1 (Ruby v3.1.3) + Content-Type: + - application/json + X-Shopify-Access-Token: + - "" + X-Graphql-Cost-Include-Fields: + - 'true' + response: + status: + code: 200 + message: OK + headers: + Date: + - Sat, 03 Feb 2024 21:01:53 GMT + Content-Type: + - application/json; charset=utf-8 + Transfer-Encoding: + - chunked + Connection: + - keep-alive + X-Sorting-Hat-Podid: + - '52' + X-Sorting-Hat-Shopid: + - '10671028' + Vary: + - Accept-Encoding + Referrer-Policy: + - origin-when-cross-origin + X-Frame-Options: + - DENY + X-Shopid: + - '10671028' + X-Shardid: + - '52' + X-Stats-Userid: + - '' + X-Stats-Apiclientid: + - '68005003265' + X-Stats-Apipermissionid: + - '395760533557' + X-Shopify-Api-Version: + - 2023-04 + Content-Language: + - en + Strict-Transport-Security: + - max-age=7889238 + Server-Timing: + - cfRequestDuration;dur=529.999971 + - processing;dur=486, graphql;desc="admin/mutation/other" + X-Shopify-Stage: + - production + Content-Security-Policy: + - 'default-src ''self'' data: blob: ''unsafe-inline'' ''unsafe-eval'' https://* + shopify-pos://*; block-all-mixed-content; child-src ''self'' https://* shopify-pos://*; + connect-src ''self'' wss://* https://*; frame-ancestors ''none''; img-src + ''self'' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net + https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com + https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com + https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com + https://v.shopify.com ''self'' ''unsafe-inline'' ''unsafe-eval''; upgrade-insecure-requests; + report-uri /csp-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=b595ccc6-9a76-43d3-93dd-9ac3bcdb7b18' + X-Content-Type-Options: + - nosniff + X-Download-Options: + - noopen + X-Permitted-Cross-Domain-Policies: + - none + X-Xss-Protection: + - 1; mode=block; report=/xss-report?source%5Baction%5D=query&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fgraphql&source%5Bsection%5D=admin_api&source%5Buuid%5D=b595ccc6-9a76-43d3-93dd-9ac3bcdb7b18 + X-Envoy-Upstream-Service-Time: + - '488' + X-Dc: + - gcp-us-east4,gcp-us-central1 + X-Request-Id: + - b595ccc6-9a76-43d3-93dd-9ac3bcdb7b18 + Cf-Cache-Status: + - DYNAMIC + Report-To: + - '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=EARetsvBn70n9pDQyvXx7Y1mg5ghcm2nCGg8KJQohlJQ5DQO5X90IBFQj5%2BGMNT3rHxLx5xyse0o2oKU%2FbbtHcjRarKuiXFlkUgMY4OHIDlb%2FppP90C690o2fynkg7wcKd%2BtwLndyaW%2F"}],"group":"cf-nel","max_age":604800}' + Nel: + - '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}' + Server: + - cloudflare + Cf-Ray: + - 84fd9c97786820b1-IAD + Alt-Svc: + - h3=":443"; ma=86400 + body: + encoding: ASCII-8BIT + string: '{"data":{"productDelete":{"userErrors":[]}},"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0},"fields":[{"path":["productDelete","userErrors","field"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors","message"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":null},{"path":["productDelete","userErrors"],"definedCost":0,"requestedTotalCost":0,"requestedChildrenCost":0},{"path":["productDelete"],"definedCost":10,"requestedTotalCost":10,"requestedChildrenCost":0}]}}}' + recorded_at: Sat, 03 Feb 2024 21:02:47 GMT +recorded_with: VCR 6.2.0 diff --git a/spec/shopify/default_variant_spec.rb b/spec/shopify/default_variant_spec.rb new file mode 100644 index 0000000..4133745 --- /dev/null +++ b/spec/shopify/default_variant_spec.rb @@ -0,0 +1,605 @@ +# frozen_string_literal: true + +require "spec_helper" + +Product = Struct.new(:variants) +Variant = Struct.new(:title, :option1, :option2) + +GQL_CREATE=<<-GQL + mutation productCreate($input: ProductInput!) { + productCreate(input: $input) { + product { + id + } + userErrors { + field + message + } + } + } +GQL + +GQL_DELETE=<<-GQL + mutation productDelete($input: ProductDeleteInput!) { + productDelete(input: $input) { + userErrors { + field + message + } + } + } +GQL + +RSpec.describe Shopify::DefaultVariant do + describe ".match?" do + context "given a product PORO" do + it "returns false when it does not respond_to?(:variants)" do + no_variants = Struct.new(:whatever).new("Foo") + expect(described_class.match?(no_variants)).to be false + end + + it "returns true when it has a 1 variant with a title matching the default title" do + product = Product.new([ Variant.new("Foo") ]) + expect(described_class.match?(product)).to be false + + product.variants[0].title = "Default Title" + expect(described_class.match?(product)).to be true + end + + it "returns false when it has a variant method that is not an Array of Hashes" do + product = Product.new("VVVV") + expect(described_class.match?(product)).to be false + + product.variants = [ 123 ] + expect(described_class.match?(hash)).to be false + end + + it "returns true when it has 1 variant with a title matching the default title and options matching the default options" do + product = Product.new([ Variant.new("Default Title", "Foo") ]) + expect(described_class.match?(product)).to be false + + product.variants[0].option1 = "Default Title" + expect(described_class.match?(product)).to be true + + product.variants[0].option2 = "Some Thangz" + expect(described_class.match?(product)).to be false + + product.variants[0].option2 = nil + expect(described_class.match?(product)).to be true + end + + it "returns true when it has 1 variant with a title matching the default title and options matching the default options but contains more than 1 variant" do + product = Product.new([ + Variant.new("Default Title", "Default Title"), + Variant.new("Some Other Title") + ]) + + expect(described_class.match?(product)).to be false + end + + it "returns false when it only has a variant with a title matching the default title but also contains other variants" do + product = Product.new([ + Variant.new("Default Title"), + Variant.new("Some Other Title") + ]) + + expect(described_class.match?(product)).to be false + end + end + + context "given a variant PORO" do + it "returns false if it does not respond to title" do + no_title = Struct.new(:whatever).new("Foo") + expect(described_class.match?(no_title)).to be false + end + + it "returns true when it only has a title matching the default title" do + variant = Variant.new("Foo") + expect(described_class.match?(variant)).to be false + + variant.title = "Default Title" + expect(described_class.match?(variant)).to be true + end + + it "returns true when it only has a title matching the default title and does not respond_to?(:option1)" do + no_option = Struct.new(:title).new("Foo") + expect(described_class.match?(no_option)).to be false + + no_option.title = "Default Title" + expect(described_class.match?(no_option)).to be true + end + + it "returns true when it has a title matching the default title and options matching the default options" do + variant = Variant.new("Default Title", "Foo") + expect(described_class.match?(variant)).to be false + + variant.option1 = "Default Title" + expect(described_class.match?(variant)).to be true + + variant.option2 = "Some Thangz" + expect(described_class.match?(variant)).to be false + + variant.option2 = nil + expect(described_class.match?(variant)).to be true + end + end + + context "given a product Hash" do + context "with Symbol keys" do + it "returns true when it has a 1 variant with a title key matching the default title" do + hash = { :variants => [ :title => "Foo" ] } + expect(described_class.match?(hash)).to be false + + hash[:variants][0][:title] = "Default Title" + expect(described_class.match?(hash)).to be true + end + + it "returns false when it has a variant key that is not an Array of Hashes" do + hash = { :variants => "VVVV" } + expect(described_class.match?(hash)).to be false + + hash[:variants] = [ 123 ] + expect(described_class.match?(hash)).to be false + end + + it "returns true when it has 1 variant with a title key matching the default title and option keys matching the default options" do + hash = { :variants => [ :title => "Default Title", :option1 => "Foo" ] } + expect(described_class.match?(hash)).to be false + + hash[:variants][0][:option1] = "Default Title" + expect(described_class.match?(hash)).to be true + + hash[:variants][0][:option2] = "Some Thangz" + expect(described_class.match?(hash)).to be false + + hash[:variants][0][:option2] = nil + expect(described_class.match?(hash)).to be true + + hash[:variants][0][:option2] = [] + expect(described_class.match?(hash)).to be false + end + + it "returns true when it has 1 variant with a title key matching the default title and option keys matching the default options but contains more than 1 variant" do + hash = { + :variants => [ + { :title => "Default Title", :option1 => "Default Title", :option2 => nil }, + { :title => "Some Other Title" } + ] + } + + expect(described_class.match?(hash)).to be false + end + + it "returns false when it has a 1 variant with a title key matching the default title but also contains other variants" do + hash = { + :variants => [ + { :title => "Default Title" }, + { :title => "Some Other Title" } + ] + } + + expect(described_class.match?(hash)).to be false + end + end + + context "with String keys" do + it "returns true when it has a 1 variant with a title key matching the default title" do + hash = { "variants" => [ "title" => "Foo" ] } + expect(described_class.match?(hash)).to be false + + hash["variants"][0]["title"] = "Default Title" + expect(described_class.match?(hash)).to be true + end + + it "returns false when it has a variant key that is not an Array of Hashes" do + hash = { "variants" => "VVVV" } + expect(described_class.match?(hash)).to be false + + hash["variants"] = [ 123 ] + expect(described_class.match?(hash)).to be false + end + + it "returns true when it has 1 variant with a title key matching the default title and option keys matching the default options" do + hash = { "variants" => [ :title => "Default Title", "option1" => "Foo" ] } + expect(described_class.match?(hash)).to be false + + hash["variants"][0]["option1"] = "Default Title" + expect(described_class.match?(hash)).to be true + + hash["variants"][0]["option2"] = "Some Thangz" + expect(described_class.match?(hash)).to be false + + hash["variants"][0]["option2"] = nil + expect(described_class.match?(hash)).to be true + end + + it "returns true when it has 1 variant with a title key matching the default title and option keys matching the default options but contains more than 1 variant" do + hash = { + "variants" => [ + { "title" => "Default Title", "option1" => "Default Title", "option2" => nil }, + { "title" => "Some Other Title" } + ] + } + + hash = { "variants" => [ "title" => "Default Title", "option1" => "Foo" ] } + expect(described_class.match?(hash)).to be false + + hash["variants"][0]["option1"] = "Default Title" + expect(described_class.match?(hash)).to be true + + hash["variants"][0]["option2"] = "Some Thangz" + expect(described_class.match?(hash)).to be false + + hash["variants"][0]["option2"] = nil + expect(described_class.match?(hash)).to be true + end + + it "returns false when it has a 1 variant with a title key matching the default title but also contains other variants" do + hash = { + "variants" => [ + { "title" => "Default Title" }, + { "title" => "Some Other Title" } + ] + } + + expect(described_class.match?(hash)).to be false + end + end + end + + context "given a variant Hash" do + context "with Symbol keys" do + it "returns true when it only has a title key matching the default title" do + hash = { :title => "Foo", :whatever => "Bar" } + expect(described_class.match?(hash)).to be false + + hash[:title] = "Default Title" + expect(described_class.match?(hash)).to be true + end + + it "returns true when it has a title key matching the default title and option keys matching the default options" do + hash = { :title => "Default Title", :option1 => "Foo" } + expect(described_class.match?(hash)).to be false + + hash[:option1] = "Default Title" + expect(described_class.match?(hash)).to be true + + hash[:option2] = "Some Thangz" + expect(described_class.match?(hash)).to be false + + hash[:option2] = nil + expect(described_class.match?(hash)).to be true + end + end + + context "with String keys" do + it "returns true when it only has a symbol title key matching the default title" do + hash = { "title" => "Foo", "whatever" => "Bar" } + expect(described_class.match?(hash)).to be false + + hash["title"] = "Default Title" + expect(described_class.match?(hash)).to be true + end + + it "returns true when it has a title key matching the default title and option keys matching the default options" do + hash = { "title" => "Default Title", "option1" => "Foo" } + expect(described_class.match?(hash)).to be false + + hash["option1"] = "Default Title" + expect(described_class.match?(hash)).to be true + + hash["option2"] = "Some Thangz" + expect(described_class.match?(hash)).to be false + + hash["option2"] = nil + expect(described_class.match?(hash)).to be true + + hash["option2"] = "Other" + expect(described_class.match?(hash)).to be false + end + end + end + + context "given a GraphQL response hash", :vcr do + before do + @gql = ShopifyAPI::GraphQL::Tiny.new( + ENV.fetch("SHOPIFY_DOMAIN"), + ENV.fetch("SHOPIFY_TOKEN") + ) + + result = @gql.execute( + GQL_CREATE, + :input => { + :title => "Shopify::DefaultVariant Test Product Without Variants", + } + ) + + # FIXME: we want to do this once and use the same for each test. May have to wrap with VCR.use_cassette + @without_variants = result.dig("data", "productCreate", "product", "id") + raise result.inspect unless @without_variants + + result = @gql.execute( + GQL_CREATE, + :input => { + :title => "Shopify::DefaultVariant Test Product With Variants", + :options => %w[Color], + :variants => [ + :title => "Variant 1", + :options => %w[Red] + ] + } + ) + + @with_variants = result.dig("data", "productCreate", "product", "id") + raise result.inspect unless @with_variants + end + + after do + @gql.execute( + GQL_DELETE, + :input => { :id => @without_variants } + ) + + @gql.execute( + GQL_DELETE, + :input => { :id => @with_variants } + ) + end + + context "given a product with a default variant" do + it "returns true when hasOnlyDefaultVariant is true" do + result = @gql.execute(<<-GQL) + query { + product(id: "#@without_variants") { + hasOnlyDefaultVariant + } + } + GQL + + expect(described_class.match?(result.dig("data", "product"))).to be true + end + + it "returns true when its variants only contain the default variant's selectedOptions" do + result = @gql.execute(<<-GQL) + query { + product(id: "#@without_variants") { + variants(first: 10) { + edges { + node { + selectedOptions { + name + value + } + } + } + } + } + } + GQL + + expect(described_class.match?(result.dig("data", "product"))).to be true + end + + it "returns true when its variants only contain the default variant's title" do + result = @gql.execute(<<-GQL) + query { + product(id: "#@without_variants") { + variants(first: 10) { + edges { + node { + title + } + } + } + } + } + GQL + + expect(described_class.match?(result.dig("data", "product"))).to be true + end + + it "returns true when its variants only contain the default variant's title and selectedOptions" do + result = @gql.execute(<<-GQL) + query { + product(id: "#@without_variants") { + variants(first: 10) { + edges { + node { + title + selectedOptions { + name + value + } + } + } + } + } + } + GQL + + expect(described_class.match?(result.dig("data", "product"))).to be true + end + + it "returns true when it contains the variant count and its variants only contain a default variant" do + result = @gql.execute(<<-GQL) + query { + product(id: "#@without_variants") { + totalVariants + variants(first: 10) { + edges { + node { + title + } + } + } + } + } + GQL + + expect(described_class.match?(result.dig("data", "product"))).to be true + end + end + + context "given a product without a default variant" do + it "returns false when hasOnlyDefaultVariant is false" do + result = @gql.execute(<<-GQL) + query { + product(id: "#@with_variants") { + hasOnlyDefaultVariant + } + } + GQL + + expect(described_class.match?(result.dig("data", "product"))).to be false + end + + it "returns false when its variants only contain the variant's selectedOptions" do + result = @gql.execute(<<-GQL) + query { + product(id: "#@with_variants") { + variants(first: 10) { + edges { + node { + selectedOptions { + name + value + } + } + } + } + } + } + GQL + + expect(described_class.match?(result.dig("data", "product"))).to be false + end + + it "returns false when its variants do not contain a default variant title" do + result = @gql.execute(<<-GQL) + query { + product(id: "#@with_variants") { + variants(first: 10) { + edges { + node { + title + } + } + } + } + } + GQL + + expect(described_class.match?(result.dig("data", "product"))).to be false + end + + it "returns false when it contains the variant count and its variants do not contain a default variant" do + result = @gql.execute(<<-GQL) + query { + product(id: "#@with_variants") { + totalVariants + variants(first: 10) { + edges { + node { + title + } + } + } + } + } + GQL + + expect(described_class.match?(result.dig("data", "product"))).to be false + end + end + + context "given a default variant" do + # TODO: more tests here + it "returns true when its variants contain a default variant title" do + result = @gql.execute(<<-GQL) + query { + product(id: "#@without_variants") { + variants(first: 10) { + edges { + node { + title + } + } + } + } + } + GQL + + variant = result.dig("data", "product", "variants", "edges", 0, "node") + expect(described_class.match?(variant)).to be true + end + + it "returns true when its variants contain a default variant title and the default variant's selectedOptions" do + result = @gql.execute(<<-GQL) + query { + product(id: "#@without_variants") { + variants(first: 10) { + edges { + node { + title + selectedOptions { + name + value + } + } + } + } + } + } + GQL + + variant = result.dig("data", "product", "variants", "edges", 0, "node") + expect(described_class.match?(variant)).to be true + end + end + + context "given a variant that is not a default" do + it "returns false when its variants contain a default variant title" do + result = @gql.execute(<<-GQL) + query { + product(id: "#@with_variants") { + variants(first: 10) { + edges { + node { + title + } + } + } + } + } + GQL + + variant = result.dig("data", "product", "variants", "edges", 0, "node") + expect(described_class.match?(variant)).to be false + end + + it "returns false when its variants contain a default variant title and the default variant's selectedOptions" do + result = @gql.execute(<<-GQL) + query { + product(id: "#@with_variants") { + variants(first: 10) { + edges { + node { + title + selectedOptions { + name + value + } + } + } + } + } + } + GQL + + variant = result.dig("data", "product", "variants", "edges", 0, "node") + expect(described_class.match?(variant)).to be false + end + end + end + end +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..24647dc --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +require "shopify/default_variant" +require "shopify_api/graphql/tiny" +require "vcr" + +require "dotenv/load" unless ENV["CI"] + +RSpec.configure do |config| + # Enable flags like --only-failures and --next-failure + config.example_status_persistence_file_path = ".rspec_status" + + # Disable RSpec exposing methods globally on `Module` and `main` + config.disable_monkey_patching! + + config.expect_with :rspec do |c| + c.syntax = :expect + end +end + +VCR.configure do |c| + c.cassette_library_dir = "spec/cassettes" + c.hook_into :webmock + c.configure_rspec_metadata! + + # We're using this for GraphQL + c.default_cassette_options[:match_requests_on] = [:body] + c.filter_sensitive_data("") { ENV.fetch("SHOPIFY_TOKEN") } + c.filter_sensitive_data("") { ENV.fetch("SHOPIFY_DOMAIN") } +end