GithubHelp home page GithubHelp logo

Comments (4)

Jogalso avatar Jogalso commented on June 1, 2024 1

I'm sorry I went on too long, I should have been more specific.

True, when I imported I didn't use ".mjs", I didn't really use it in useLoading() or useCache() because I imported it wrong automatically.

Anyway you are right that I didn't need to extract all the loading from the context. In the end, useLoadingEntry() was enough for me.
Certainly the type of loadingCacheValues is not boolean but it is either the action or it is undefined. Therefore it is easily adaptable to boolean.

Thanks a lot!

from graphql-react.

Jogalso avatar Jogalso commented on June 1, 2024

Hello again!

It certainly feels good to talk to you because like last time, I see new things that I didn't see, even before you answer me.

I have managed to make a series of queries with limit and skip.

On the one hand I have managed to use useLoading(), although with some problems. I can't get those queries to be saved with different keys.
(My intention was to save them separately, query 1, query 2, query 3...) But if I save it in the same key, I check that it doesn't do many simultaneous queries because it saturates the network. And with a little modification of my schemas I get how many elements I have to load, and when I get to the last one I stop performing queries.

But the problem that has nothing to do with this, is that it doesn't let me import useLoading() and useCache() directly from "graphql-react". The error tells me to check the package.json of the "graphql-react" library to check the exports. I have reviewed it and they are included.
To get out of trouble I have copied them in my hooks and that is how they work.
I don't know if I'm the only one with this error. But I have node and all the libraries updated to the maximum.

from graphql-react.

jaydenseric avatar jaydenseric commented on June 1, 2024

Hi :)

These comments are a little tricky to answer because there seems to be quite a few questions going on. But perhaps your main problem about not being able to import the hooks is the easiest to start with. What exactly is the import code you are trying to use?

Imports need to be like this:

import useLoadingEntry from "graphql-react/useLoadingEntry.mjs";

You must use deep imports, and you must use the .mjs in the path.

You probably don't need to use the useLoading hook that gets the whole store of all loading from context; most likely you are interested in useLoadingEntry to get the loading status of a particular cache key.

from graphql-react.

jaydenseric avatar jaydenseric commented on June 1, 2024

Glad you were able to progress 🙌

from graphql-react.

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.