question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

handling server side graphql errors without suspense

See original GitHub issue

with getDataFromTree you could wrap the call in a try-catch block to prevent graphql errors from crashing app, since you could still render the html markup

but since getDataFromMarkup combines fetching data and rendering html, how should server side graphql errros be handled if you’re not yet using suspense?

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
trojanowskicommented, Feb 22, 2019

Yes, good catch. It seems our implementation of getMarkupFromTree is incompatible with the one in react-apollo: https://github.com/apollographql/react-apollo/blob/6a02550db2b14881582ede2c4e1a3e1ef51f0b7a/test/client/getDataFromTree.test.tsx#L1572. We should change this behavior.

0reactions
aleedmanathcommented, Mar 9, 2019

so would it be OK to remove this snippet here? https://github.com/trojanowski/react-apollo-hooks/blob/master/src/getMarkupFromTree.tsx#L32-L34

and let end user decide how they want to handle non-suspense errors

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handling operation errors - Apollo GraphQL Docs
Apollo Client can encounter a variety of errors when executing operations on your GraphQL server. Apollo Client helps you handle these errors according...
Read more >
Error Handling in GraphQL -- newline - Fullstack.io
GraphQL servers are able to handle errors by default, both for syntax and validations errors. You've probably already seen this when using ...
Read more >
How to handle GraphQL errors with React-Apollo?
I'm trying to move from Rest API to GraphQL using Express + Mongoose on server and React + Apollo on ...
Read more >
GraphQL made simple with React Suspense and Hooks
Using Suspense and hooks, we can write clean and functional code to manage state and handle errors while fetching GraphQL data.
Read more >
Server-side Rendering | urql Documentation
However, Suspense is not supported by React during server-side rendering. Using the react-ssr-prepass ... npm install --save next-urql react-is urql graphql.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found