Comments (4)
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.
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.
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.
Glad you were able to progress 🙌
from graphql-react.
Related Issues (20)
- hello can you convert for native js? HOT 6
- Document the `load` function HOT 3
- Support automatic persisted queries HOT 2
- How should you implement auth using this library? HOT 8
- Possibly missing files within package HOT 2
- Add ability to load on mount only if no cache HOT 2
- How to move gql query to useGraphQL operation query HOT 1
- Publish the GraphQL client in a separate package HOT 5
- Wrong type calculation on useGraphQL HOT 1
- How to use useGraphQL hooks when handleLoadMore functions trigger? HOT 1
- Allow React component displayName and propTypes to be removed in production builds HOT 3
- Pagination possible? HOT 4
- New composable React hooks HOT 2
- Add a license file HOT 3
- Add ability to clear not currently subscribed cache
- Switch to user defined cache keys
- Publish SSR functionality in a separate package
- error - unhandledRejection: TypeError: Head.rewind is not a function -> can't get the official example to work HOT 3
- Clear code
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graphql-react.