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

World-class Type Safety for Storefront query/mutate #568

Closed
mw10013 opened this issue Feb 22, 2023 · 2 comments · Fixed by #707
Closed

World-class Type Safety for Storefront query/mutate #568

mw10013 opened this issue Feb 22, 2023 · 2 comments · Fixed by #707
Assignees
Labels

Comments

@mw10013
Copy link

mw10013 commented Feb 22, 2023

What is the location of your example repository?

No response

What version of Hydrogen are you using?

@shopify/[email protected]

What version of Remix are you using?

No response

Steps to Reproduce

Call query from a loader. Eg.

export const loader = (async ({context}: LoaderArgs) => {
  const data = await context.storefront.query<any>(query);
  return data;
}) satisfies LoaderFunction;

Expected Behavior

Expected a way to make a query using something like a TypedDocumentNode for low maintenance return types and typed query variables.

Actual Behavior

Need to maintain the return type by hand or use any.

@frehner
Copy link
Contributor

frehner commented Feb 23, 2023

This is being explored in #297 and #271 👍

@blittle
Copy link
Contributor

blittle commented Mar 20, 2023

Hi @mw10013! Checkout this PoC implementation here: #707

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

Successfully merging a pull request may close this issue.

5 participants