Giter VIP home page Giter VIP logo

Comments (4)

j0nd0n7 avatar j0nd0n7 commented on May 4, 2024 2

2016, 2017, 2019 and near 2020 and counting...

Today I've been reading how to improve the error handling of an existing API especially for user/expected errors.

First, it was important to me the opinion of @leebyron about the default "error system" that it is intended for unexpected errors. Check it here

The most recurrent flavors I read (besides using the default one) are:
"Shopify Flavor": For Mutations/Subscriptions use a custom payload type and include a field like userErrors field.
Shopify's GraphqlQL API Design best practices

"Medium/Sasha Solomon Flavor": Valid also for queries, use a UNION with the normal result plus new types that represents all the possible expected errors like "UserDeleted".
Sasha Solomon - Tech Talks

In this article both method are considered.
I Thought of a Better Way to Handle Errors

IMO with the experience collected from all the community so far in late 2019, the handling of "user/expected errors" should be standardized in the GRAPHQL spec (with op-in for current apis) instead of modeled with the current artifacts and applying different approaches.

from graphql.github.io.

tspecht avatar tspecht commented on May 4, 2024

Any recommendations on this?

from graphql.github.io.

anthonator avatar anthonator commented on May 4, 2024

How would you determine that the GraphQL response had errors? Would something like a boolean success field need to be introduced?

from graphql.github.io.

felippenardi avatar felippenardi commented on May 4, 2024

2016, 2017 and now 2018. Have we solved that already?

from graphql.github.io.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.