Coder Social home page Coder Social logo

Dynamic messages about apollo-errors HOT 6 CLOSED

thebigredgeek avatar thebigredgeek commented on June 9, 2024
Dynamic messages

from apollo-errors.

Comments (6)

thebigredgeek avatar thebigredgeek commented on June 9, 2024 1

I'm closing this for now, since there doesn't seem to be any interest in moving forward

from apollo-errors.

thebigredgeek avatar thebigredgeek commented on June 9, 2024

You can already override the message when you throw the error, per the docs, with whatever string you want. Does that not handle your use case?

from apollo-errors.

lucasconstantino avatar lucasconstantino commented on June 9, 2024

No, not really. I wouldn't like to send the message always I throw the error, but I would like the message to contain some contextual information. If anyone else finds this useful after all, I can write the pull-request. Until then, I guess I'll keep using my wrapping helper.

from apollo-errors.

thebigredgeek avatar thebigredgeek commented on June 9, 2024

Interesting. I think we could definitely add this to the package, but I am wondering how we ought to make the API work without breaking changes. Any thoughts @lucasconstantino ?

from apollo-errors.

scf4 avatar scf4 commented on June 9, 2024

IMO this is more of a UI detail, to be implemented in a client rather than at the API level.

from apollo-errors.

thebigredgeek avatar thebigredgeek commented on June 9, 2024

@scf4 I mostly agree, but I also don't feel overly pained about adding this if enough people want it. I personally render the messages directly in the client, because my current app doesn't have to worry about i18n etc. That said, there is nothing stopping anyone from using a factory function to return errors with dynamic messages without baking any new functionality into the lib.

from apollo-errors.

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.