-
Notifications
You must be signed in to change notification settings - Fork 27k
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
Example with-graphql-hooks broken request #20474
Comments
This issue was maybe solved by changing request URL. |
If anyone still needs this, they can check my branch #20929. It works at least with the same example API as the Apollo example. I think the upvoting feature feels sluggish could do with some optimistic updates that the graphql-hooks does not provide by default, but as the original example did not implement it I did not either. |
Fixes #20474 * Switch API url to working URL used in apollo example * Update deps * Move styled jsx out of the way to avoid demonstrating too many unfamiliar concepts at once dev, build and start work now.
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Bug report
Describe the bug
Two issues:
Issue 1 - On creating example app, initial load is broken with error.
Error serializing .initialGraphQLState["6gftu9"].data returned from getStaticProps in "/". Reason: undefined cannot be serialized as JSON. Please use null or omit this value.
This is from theundefined
value in the return not being JSON parsable (see https://dev.to/ryyppy/reason-records-nextjs-undefined-and-getstaticprops-5d46). The request during this initial load of the example is returning a502
.Issue 2 - Broken request to existing api using code in example. When utilizing the logic in the example into an existing minimal next.js boilerplate,
400 bad request
is continually returned throughout troubleshooting attempts.The api url is an existing app api that I can confirm the function in graphiql. Testing query is a minimal test example that is proven valid in the graphiql.
Here are the request inputs:
Here is the query (if it helps):
All of the files used are as they are in the example repo.
When watching my api logs, no requests are hitting the api
To Reproduce
Issue 1 - Broken initial code in example
Issue 2 - Broken request to existing api using code in example
Expected behavior
Expect example to return valid values and render example ui
Expect data to be present in api return for valid queries
System information
Merry Christmas! 🎅
The text was updated successfully, but these errors were encountered: