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

Graphql error on the template #826

Closed
felpsio opened this issue Apr 27, 2023 · 2 comments · Fixed by #833
Closed

Graphql error on the template #826

felpsio opened this issue Apr 27, 2023 · 2 comments · Fixed by #833

Comments

@felpsio
Copy link

felpsio commented Apr 27, 2023

What is the location of your example repository?

template repo

Which package or tool is having this issue?

Hydrogen

What version of that package or tool are you using?

1.0.5

What version of Remix are you using?

1.15.0

Steps to Reproduce

In the template created open app/routes/($lang).products._index.tsx, on the line 157, in const ALL_PRODUCTS_QUERY you're going to find a warning: Syntax Error: Unexpected <EOF>.GraphQL: Syntax.

This error is present on basically all queries that concatenate strings from other variables.

Screenshot 2023-04-27 at 14 55 58

Expected Behavior

No warning or error is show

Actual Behavior

Shows ``Syntax Error: Unexpected .GraphQL: Syntax.

@frehner
Copy link
Contributor

frehner commented Apr 27, 2023

I haven't dug deeply into it, but it appears to be an issue with the GraphQL Plugin for our IDEs. The query still works, but the GraphQL plugin struggles with the syntax.

For example: graphql/graphiql#1842 (comment)

We could fix it by putting the fragment at the end of the query, instead of at the beginning.

@felpsio
Copy link
Author

felpsio commented Apr 28, 2023

Hm... good suggestion. Looks like putting the fragments at the end solves it for now: the query seems to still work normally and it removes the warning from the IDE :)

@frehner frehner mentioned this issue Apr 28, 2023
5 tasks
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

Successfully merging a pull request may close this issue.

2 participants