Shopify / shopify-api-ruby

ShopifyAPI is a lightweight gem for accessing the Shopify admin REST and GraphQL web services.
MIT License
1.06k stars 473 forks source link

How to retrieve specific metafield #1144

Closed almeidaz closed 1 year ago

almeidaz commented 1 year ago

I have updated my old shopify_api 9 to 12.5

I used to retrieve metafield like this :

 @my_metafield = ShopifyAPI::Metafield.find(:first, params: {resource: "shop", namespace: "myname", key: "mykey"})

OR

@my_metafield = ShopifyAPI::Metafield.where(namespace: "myname", key: "mykey")

but now both not working. I try lot of stuff with :

@my_metafield = ShopifyAPI::Metafield.all(params: { namespace: "my_name", key: "my_key" })
@my_metafield = ShopifyAPI::Metafield.all(
      metafield: {"owner_resource" => "shop",
                  "namespace" => "my_name",
                  "key" => "my_key"
      },
    )

The only thing i can do is :

@my_metafield = ShopifyAPI::Metafield.all(namespace: "my_name")

which return metafield with namespace : "my_name".

But i need more filter like key , description, type.

How can i retrieve a metafield that match owner_resource: "shop", namespace: "myname", key: "mykey" ?

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 60 days with no activity. It will be closed if no further action occurs in 14 days.

github-actions[bot] commented 1 year ago

We are closing this issue because it has been inactive for a few months. This probably means that it is not reproducible or it has been fixed in a newer version. If it’s an enhancement and hasn’t been taken on since it was submitted, then it seems other issues have taken priority.

If you still encounter this issue with the latest stable version, please reopen using the issue template. You can also contribute directly by submitting a pull request– see the CONTRIBUTING.md file for guidelines

Thank you!