Shopify/shopify-app-template-node

Conflict between importing from LATEST_API_VERSION and 2023-04

its-anas opened this issue · 1 comments

I believe restResources import should be dynamic just like the first import that uses LATEST_API_VERSION, otherwise it may cause a conflict one day.

import { BillingInterval, LATEST_API_VERSION } from "@shopify/shopify-api";
import { shopifyApp } from "@shopify/shopify-app-express";
import { SQLiteSessionStorage } from "@shopify/shopify-app-session-storage-sqlite";
import { restResources } from "@shopify/shopify-api/rest/admin/2023-04";

That's a fair point, but if we make this a dynamic import we will lose intellisense on e.g. VSCode, which makes it a lot more difficult to use the resources.

If they ever fall out of sync, that won't break anything - it will just log a message reminding the developer that they should update their import statement, but it will continue to use 2023-04 for the resources so the code will continue to work the same way until the app is ready to be migrated.

Since this is working as intended, I'll close the issue. Please do report to us if this ever causes any problems while developing!