Comments (4)
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.
Any recommendations on this?
from graphql.github.io.
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.
2016, 2017 and now 2018. Have we solved that already?
from graphql.github.io.
Related Issues (20)
- Display GraphQLConf Media or Community Partner logos
- Typos on the GraphQLConf banners HOT 1
- Buttons on the partners page of the conf website aren't responsive
- Adding "Brangr" client/browser to the Code page? HOT 4
- Edit this page button takes to github.com and to this repo HOT 3
- Support for Dark theme ? HOT 1
- `StarWarsSchema` type descriptions are `null` in Introspection docs
- "Edit this page" link on FAQ page goes to `github.com/faq` HOT 2
- Clarification on "Schemas and Types" documentation
- Remove the "GraphQL Conf 2023" registration banner
- Feature request for GitHub GraphQL? HOT 1
- npm and GitHub stars/downloads show as 0 for all tools HOT 1
- Add link to store.graphql.org HOT 4
- Updated docs to reflect express-graphql deprecation HOT 3
- Query editors don't have visible scrollbars
- /swapi-graphql is broken again HOT 6
- [Discussion] Getting Started experience on graphql.org HOT 3
- Explain a bit more what Ruru is? HOT 1
- [Improvement request]: Segregate GraphGL standard implementation features from GraphGL extensions
- Landscape iframe busted on https://graphql.org/users/ HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphql.github.io.