Open awd opened 2 months ago
@awd, thank you for this detailed bug report. A fix has been deployed. Please let us know if you continue experiencing the same issue.
Hey @billfienberg
Thanks for the quick turn around on this one! Looks like it's back to using the latest version as hoped.
Is this now scoped to the app toml file? I can open a feature request if not, as hard-coding api versions in all the direct access network calls is a pain to maintain, and the default of latest
is a moving target - this could break apps in the future as inputs / mutations / queries change.
Would love for there to be:
[access.admin]
api_version = "2024-07"
direct_api_mode = "online"
embedded_app_direct_api_access = true
Is there any chance to set some specific version? I'd like to use the 2023-10 version not the latest one.
@BusyginArtem Then you just use a url like this fetch('shopify:admin/api/2023-10/graphql.json')
Is this now scoped to the app toml file?
Good news: We've created a ticket to implement that. Bad news: My prior PR needs to be reverted because it created a deviation from how Shopify versioned APIs are supposed to behave.
If your request doesn't include a version, then the API also defaults to the oldest supported stable version. - https://shopify.dev/docs/api/usage/versioning
Takeaway: Embedded apps using Direct API that want to use the latest stable API version will have to use the workaround until we implement the app toml scoping.
Workaround: Add the desired API version in the request URL:
fetch(‘shopify:admin/api/graphql.json’)
fetch(‘shopify:admin/api/${API_VERSION}/graphql.json’)
fetch(‘shopify:admin/api/2024-07/graphql.json’)
Describe the bug
When using Resource Fetching, the API version is incorrectly returning
2023-10
instead oflatest
as specified.To Reproduce
Steps to reproduce the behaviour:
fetch(‘shopify:admin/api/graphql.json’)
X-Shopify-Api-Version: 2023-10
Expected behaviour
fetch(‘shopify:admin/api/graphql.json’)
should use the latest stable api version (currently:2024-07
)Contextual information
Workaround can be used to hard-code the api version into the path:
fetch(‘shopify:admin/api/2024-07/graphql.json’)
Packages and versions
App Bridge SDK loading from CDN:
https://cdn.shopify.com/shopifycloud/app-bridge.js
Additional context
API versions are now defined in the app TOML, app bridge should either respect that API version or when version is omitted from the
fetch
path - actuallatest
should be used.