graphql

donaldball 2019-06-13T21:07:38.009300Z

Iā€™m working to express the results of joins across multiple data sources in my graphql schema and was idly wondering if there were any useful ways folk have found to express the temporary unavailability of parts of the data graph? We would like graphql to abstract over disparate backend databases and also be able to provide partial responses when possible, but it seems like there should be a good way to inform clients of the distinction between the absence of and the unavailability of data.

3Jane 2019-06-13T21:15:43.009800Z

Yeah, we do exactly that (abstracting over disparate backends which are sometimes flakey)

3Jane 2019-06-13T21:17:03.011Z

In terms of graphql response, you can return an error and a partially filled response, with a null for the object where the flakey data would normally go

3Jane 2019-06-13T21:18:54.011900Z

The other thing you can use is the extensions field in response

šŸ˜Ž 1
osi 2019-06-13T22:54:01.012600Z

You can also model errors as types, https://graphqlme.com/2018/03/17/i-thought-of-a-better-way-to-handle-errors/

šŸ‘ 1
osi 2019-06-13T22:54:45.013400Z

the UI engineers I work with prefer that over crawling through other parts of the response structure