GithubHelp home page GithubHelp logo

Comments (4)

vldslv-a avatar vldslv-a commented on July 22, 2024 2

Would it be more helpful if we instead printed a stringified request body in the message?

Yes, that would be nice! It would at least give us more information about unhandled requests, because sometimes they are hard to find.

from msw.

kettanaito avatar kettanaito commented on July 22, 2024 1

Hi, @vldslv-a. Thanks for letting us know.

We've removed the parsing of requests from the onUnhandledRequest logic because it's expensive and everybody was paying for it, even if they aren't using GraphQL (there's no way of knowing if a request is a GraphQL request until you attempt to parse it).

I am a bit hesitant to add the parsing back, even if behind an option (not a fan of configurations in general).

Would it be more helpful if we instead printed a stringified request body in the message?

[MSW] Error: intercepted a request without a matching request handler:

  • POST https://app/graphql
    {"query":"query GetUser { ... }","variales":{...}}

Reading the request body is not as expensive and will include the GraphQL request information to help you identify the unhandled request. Let me know!

from msw.

kettanaito avatar kettanaito commented on July 22, 2024

@vldslv-a, if you are interested, you can open a pull request with this change! I will help you review the code and merge it for everyone to use.

from msw.

samhoooo avatar samhoooo commented on July 22, 2024

Hi @kettanaito @vldslv-a. If no one is working on this, may I make a contribution?

from msw.

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.