Giter VIP home page Giter VIP logo

Comments (2)

wilkerlucio avatar wilkerlucio commented on August 23, 2024

Thanks for this report, I have made some changes around this behavior with batches.

Code for the changes is at 721d142

First I like to talk about the problem. The problem of seqs (or sets), is that they are data structures that don't support indexed update (can't assoc-in or update-in some specific element of the collection). This is a problem for batching, because batch runs kind of "outside" the entity, and then it has to be merged back in. This merge back in is the step in which I need the indexed update. Vectors can do this just fine, but seqs and sets can't.

The error on stack is related to the attempt of doing assoc-in on a seq (or set).

Now I change the behavior, and if you run this same again, you should see the correct response, and some warnings about batch disabled. Now, when I start processing something that's not batch compatible, I mark the env, and if you try to do batch in one location like this, it won't try to batch, it will use the batch resolver as a non batch one (send a list with one element, pick the first result). This way it will work as if you don't have batch, but works. And if this happens you get a warning message to let you know your batch is not happening.

I also updated the docs on batching to reflect this new knowledge, you can it at: https://pathom3.wsscode.com/docs/resolvers/#unsupported-batch

from pathom3.

jmayaalv avatar jmayaalv commented on August 23, 2024

Thanks a lot for this Wilker. Very happy with your solution 👍

from pathom3.

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.