Skip to content

Graphql Validation Errors for Customer Account Queries #2789

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

Open
michael-convertdigital opened this issue Mar 8, 2025 · 3 comments
Open

Comments

@michael-convertdigital
Copy link

What is the location of your example repository?

No response

Which package or tool is having this issue?

Hydrogen

What version of that package or tool are you using?

2025.1.2

What version of Remix are you using?

2.15.3

Steps to Reproduce

  • Initialise a new Hydrogen with the command npm create @shopify/hydrogen@latest
  • Install all dependencies
  • Open any file inside of ./app/graphql
  • Each query will contain type/graphql validation errors
  • codegen doesn't resolve this
Image Image

Expected Behavior

All Graphql queries should be validated without throwing errors

Actual Behavior

All queries show Graphql validation errors

@mnfwebmaster
Copy link

I don't know if this helps, I also ran into the same issue, I just commented out the queries and functions for the time being because in the documentation. The storefront Api and customer Api are separated, in doing so, they also request you have the OTP account settings selected in your admin console for customers. This means if you were using the legacy style, it doesn't work (at least out of the box).

Here's the link to documentation on customer api: https://shopify.dev/docs/api/customer

@tomtuv
Copy link

tomtuv commented Mar 17, 2025

For me, it works if I change the GraphQL config to this:

    default: {
      schema: getSchema("storefront"),
      documents: [
-       "./*.{ts,tsx,js,jsx}",
-       "./app/**/*.{ts,tsx,js,jsx}",
-       "!./app/graphql/**/*.{ts,tsx,js,jsx}",
+       "./app/lib/**/*.{ts,tsx,js,jsx}",
+       "./app/root.tsx",
+       "./app/routes/*.{ts,tsx,js,jsx}",
      ],
    },

@blittle
Copy link
Contributor

blittle commented Mar 26, 2025

@michael-convertdigital is this still a problem?

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

4 participants