Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose RestResources types for Typescript #1460

Open
wedgybo opened this issue Sep 5, 2024 · 1 comment
Open

Expose RestResources types for Typescript #1460

wedgybo opened this issue Sep 5, 2024 · 1 comment

Comments

@wedgybo
Copy link

wedgybo commented 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 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.

@wedgybo wedgybo changed the title Expose RestResource types for Typescript Expose RestResources types for Typescript Sep 5, 2024
@lizkenyon
Copy link
Contributor

Thanks for flaging this!

I am going to move this to our teams backlog, to look into in the near future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants