You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently you can not easily get the RestResource types for the specified API version.
Importing import type { RestResources } from '@shopify/shopify-api/rest/admin/2024-07'; gives you access to RestResource[''] but as these are typeof <Resource> values you only get access to the class static information.
Using the official types would be super handy when dealing with code that is reacting to events from webhooks as we want to be sure we're using what is specified by the set API version rather than relying on writing our own types and having to manually upgrade our types when we upgrade the version.
The text was updated successfully, but these errors were encountered:
wedgybo
changed the title
Expose RestResource types for Typescript
Expose RestResources types for Typescript
Sep 5, 2024
Overview/summary
Currently you can not easily get the RestResource types for the specified API version.
Importing
import type { RestResources } from '@shopify/shopify-api/rest/admin/2024-07';
gives you access to RestResource[''] but as these aretypeof <Resource>
values you only get access to the class static information.Using the official types would be super handy when dealing with code that is reacting to events from webhooks as we want to be sure we're using what is specified by the set API version rather than relying on writing our own types and having to manually upgrade our types when we upgrade the version.
The text was updated successfully, but these errors were encountered: