200 OK! Error Handling in GraphQL - Sasha Solomon @ GraphQL Conf 2019

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ก.พ. 2025

ความคิดเห็น • 11

  • @benjaminrood1648
    @benjaminrood1648 5 ปีที่แล้ว +9

    Really important topic that isn't often discussed. Nice use of unions, too!

  • @BrechtGijbels
    @BrechtGijbels 4 ปีที่แล้ว

    Love it! Thank you for the clear explanation.

  • @william-4830
    @william-4830 5 ปีที่แล้ว +6

    Neat. How does this scale? Schema stitching and having a single, unified, data graph is becoming the de facto best practice nowadays. Conceptually this approach have some parallels with the exception hell problem in large Java codebases.

    • @william-4830
      @william-4830 5 ปีที่แล้ว

      And a follow up question: I guess the approach for error handling in mutations is the same?

  • @ТоббиМагиев
    @ТоббиМагиев 2 ปีที่แล้ว

    Brings error handling to this logic level is not a good option. In this case I need to check for an error within `onSuccess` callback, for example with `react-query`, but I just need to get all errors with `onError` callback. And if you need distinguish one error from another just use `code` field in error object, with values e.g. BAD_REQUEST, NOT_FOUND, USER_BLOCKED etc.

  • @yongtaihuang5097
    @yongtaihuang5097 4 ปีที่แล้ว

    Union types, great!

  • @ihateuserids
    @ihateuserids ปีที่แล้ว

    I'm not really sure that we can say that errors are things that we didn't expect, I'd say that's more like the exceptions (like we'd see in a 500). The errors like a record not found, or a validation error, should be considered as expected states. It so happens that we tend to call these errors, which maybe gives the wrong message, but in a strange way, it's still kinda the best fit. If the front end doesn't know what to do with it and it's available in the schema as a known possible response, then they need to improve their dev process :)

  • @pablobello0
    @pablobello0 5 ปีที่แล้ว

    Nice talk, thanks

  • @AdrianDucao
    @AdrianDucao 5 ปีที่แล้ว +3

    I've been watching a lot of her lately, idk why...

    • @adoelrachman9882
      @adoelrachman9882 4 ปีที่แล้ว

      Cause she is Wonderfull Girl, is'nt she ?

  • @alexpapilov2150
    @alexpapilov2150 5 ปีที่แล้ว

    wow