{"id":21942172,"url":"https://github.com/screenstaring/shopify-default_variant","last_synced_at":"2026-02-12T16:30:50.539Z","repository":{"id":220723372,"uuid":"752440386","full_name":"ScreenStaring/shopify-default_variant","owner":"ScreenStaring","description":"Determine if the given Shopify product only has a default variant, or if the given variant is the default variant.","archived":false,"fork":false,"pushed_at":"2024-10-10T23:56:24.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-09T22:01:07.413Z","etag":null,"topics":["default-variant","shopify","shopify-api","shopify-default-variant","shopify-graphql-api","shopify-products"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ScreenStaring.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-03T21:08:10.000Z","updated_at":"2024-10-10T23:56:29.000Z","dependencies_parsed_at":"2025-01-27T15:42:23.498Z","dependency_job_id":"99680155-728c-452d-af25-f330ec21b28c","html_url":"https://github.com/ScreenStaring/shopify-default_variant","commit_stats":null,"previous_names":["screenstaring/shopify-default_variant"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ScreenStaring/shopify-default_variant","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScreenStaring%2Fshopify-default_variant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScreenStaring%2Fshopify-default_variant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScreenStaring%2Fshopify-default_variant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScreenStaring%2Fshopify-default_variant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ScreenStaring","download_url":"https://codeload.github.com/ScreenStaring/shopify-default_variant/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScreenStaring%2Fshopify-default_variant/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29372182,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T08:51:36.827Z","status":"ssl_error","status_checked_at":"2026-02-12T08:51:26.849Z","response_time":55,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["default-variant","shopify","shopify-api","shopify-default-variant","shopify-graphql-api","shopify-products"],"created_at":"2024-11-29T03:16:49.391Z","updated_at":"2026-02-12T16:30:50.523Z","avatar_url":"https://github.com/ScreenStaring.png","language":"Ruby","readme":"# Shopify::DefaultVariant\n\n[![CI](https://github.com/ScreenStaring/shopify-default_variant/actions/workflows/ci.yml/badge.svg)](https://github.com/ScreenStaring/shopify-default_variant/actions/workflows/ci.yml)\n\nDetermine if the given Shopify product only has a default variant, or if the given variant is the default variant.\n\nWorks with a variety of objects:\n\n- ShopifyAPI gem response objects\n- GraphQL response `Hash` with `String` or `Symbol` keys\n- Plain Ol' Ruby Object (PORO)\n- Plain `Hash` with `String` or `Symbol` keys\n\n## Installation\n\nAdd this line to your application's `Gemfile`:\n\n```ruby\ngem \"shopify-default_variant\"\n```\n\nAnd then execute:\n\n```sh\nbundle\n```\n\nOr install it yourself as:\n\n```sh\ngem install shopify-default_variant\n```\n\n## Usage\n\n```rb\nShopify::DefaultVariant.match?(object)\n```\n\nWhere `object` can be a product or a variant in any of the aforementioned forms.\n\nMore examples:\n\n```rb\nrequire \"shopify-default_variant\"\nrequire \"shopify_api\"  # Just an example, *not* a recommendation 😉\n\nproduct = ShopifyAPI::Product.find(id: id)\nShopify::DefaultVariant.match?(product)\nShopify::DefaultVariant.match?(product.variants)\nShopify::DefaultVariant.match?(product.variants.sample)\n\nrequire \"shopify_api-graphql-tiny\"\n\ngql = ShopifyAPI::GraphQL::Tiny.new(\"shop\", \"token\")\ndata = gql.execute(YOUR_QUERY)\n# Be sure to remove the data key and query's name key (whatever it may be) from the response hash\nShopify::DefaultVariant.match?(data.dig(\"data\", \"queryName\"))\n\n# Or use a Object or Hash that resembles one of the well-known forms\nShopify::DefaultVariant.match?(my_custom_object)\n```\n\n## Testing\n\nThe GraphQL tests require a Shopify store and access token. You can set this by\ncopying `.env.template` to `.env.test` and adding the appropriate values.\nVCR is used to record these requests.\n\n---\n\nMade by [ScreenStaring](http://screenstaring.com)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscreenstaring%2Fshopify-default_variant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscreenstaring%2Fshopify-default_variant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscreenstaring%2Fshopify-default_variant/lists"}