shopify-api-js icon indicating copy to clipboard operation
shopify-api-js copied to clipboard

Changing API version of Clients

Open jerameel opened this issue 3 years ago • 7 comments

Issue summary

Write a short description of the issue here ↓ Changing API version of Clients (Admin GraphQL, Storefront) without relying on context.

Expected behavior

What do you think should happen? Should be able to override/change api version used on clients using additional parameter

Actual behavior

What actually happens? Cannot change api version without initializing shopify context

Tip: include an error message (in a <details></details> tag) if your issue is related to an error

Steps to reproduce the problem

  1. Use api client without context, apiversion defaults to unstable

Reduced test case

The best way to get your bug fixed is to provide a reduced test case.


Checklist

  • [x] I have described this issue in a way that is actionable (if possible)

jerameel avatar Mar 24 '22 08:03 jerameel

I don't think the default API version on this SDK should be set to unstable. Or at least it should be stated somewhere. That seems really dangerous if you didn't explicitly defined it with a Context.

Grsmto avatar Mar 30 '22 17:03 Grsmto

Yes would really love to see this functionality to set a specific version on the client (or as a param when initialising it).

shopsideau avatar Jun 03 '22 03:06 shopsideau

Is it possible to get this looked at/added soon? Crucial feature for us, would love to see it implemented.

JayAdra avatar Jun 21 '22 05:06 JayAdra

I really need this too. If I simply want to call an API, I don't think Context is necessary. Or, it would be nice to be able to specify only API_VERSION in Context.initialize.

jessicazu avatar Jun 30 '22 01:06 jessicazu

A workaround I found that seems to be working so far is just manually specifying the version after the import, i.e.

Shopify.Context.API_VERSION = '2022-04';

This is without using Context.initialize anywhere too. An official solution would be preferred, but hopefully this helps for now.

shopsideau avatar Jun 30 '22 01:06 shopsideau

@shopsideau Great! It is a simple solution and works. Thank you very much.

jessicazu avatar Jun 30 '22 01:06 jessicazu

I don't think the default API version on this SDK should be set to unstable. Or at least it should be stated somewhere. That seems really dangerous if you didn't explicitly defined it with a Context.

I only just discovered that the clients are using unstable by default this morning! Broke our app due to the introduction of Protected customer data on 2022-10. https://shopify.dev/apps/store/data-protection/protected-customer-data

benjamindoe avatar Jul 05 '22 09:07 benjamindoe

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

github-actions[bot] avatar Oct 06 '22 02:10 github-actions[bot]

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!

github-actions[bot] avatar Oct 20 '22 02:10 github-actions[bot]