Giter Club home page Giter Club logo

Comments (4)

eric-burel avatar eric-burel commented on May 24, 2024

According to the code from your PR, this is a backend issue => the multi resolver is sending the same item twice, as if the limit was taken into account incorectly

from vulcan.

GraemeFulton avatar GraemeFulton commented on May 24, 2024

useMulti2 in meteor seems to work for me, but useMulti from vulcanjs/hooks is not getting the filter after loadmore.

I am filtering documents by userId (and a template type field), and I can see that in the first query (before loadmore), all filter and userId is present:

Screenshot 2021-06-17 at 13 08 35

After loadMore button clicked, the query no longer has the filter at all:

Screenshot 2021-06-17 at 13 05 53

So I'm just looking into that now 🤓

from vulcan.

GraemeFulton avatar GraemeFulton commented on May 24, 2024

I have tracked it down to here: https://github.com/VulcanJS/vulcan-npm/blob/98b23f1ea04b18c39b036faafb075951b4bd4549/packages/react-hooks/multi.ts#L182

in fetchMore, I don't see the filter, only the input with offset:

 return fetchMore({ 
     variables: { input: offsetInput },        
     updateQuery: fetchMoreUpdateQuery(resolverName),     
     });

Setting it up locally looks like there is a few steps and maybe a learning curve: https://github.com/VulcanJS/vulcan-next/blob/devel/src/content/docs/contributing.md. I haven't got time right now to dig further, so will come back to it next week and continue on other parts first

from vulcan.

eric-burel avatar eric-burel commented on May 24, 2024

@GraemeFulton will be fixed by https://github.com/VulcanJS/vulcan-npm/pull/56/files (edit: released just now in "0.2.1" of react-hooks)

@IBRAHIMDANS the issue is that variables are not correclty merged in the hook, so in the loadMore/loadMoreInc calls, it indeed loses the filter. Instead of using "uniq", the solution is to fix the variable merging pattern, you can take a look at the PR: https://github.com/VulcanJS/vulcan-npm/pull/56/files

To fix this:

  • I get current variables from the queryResult (when doing useQuery, Apollo returns the result but also the variables you used to get this result)
  • I merge the variables (previously, I was just merging the pagination inputs)

from vulcan.

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.