bulksearch | Lightweight and read-write optimized full text search | Search Engine library
kandi X-RAY | bulksearch Summary
kandi X-RAY | bulksearch Summary
Lightweight and read-write optimized full text search library.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of bulksearch
bulksearch Key Features
bulksearch Examples and Code Snippets
Community Discussions
Trending Discussions on bulksearch
QUESTION
I am working on project with Apollo on client side. I am using react-apollo-hooks on my client side. And I have a problem with useApolloClient.
When i fire query with my client I got in useApolloClient I don't get back all data I need. FetchMore is missing. If I use regular query (useQuery) I get that. But problem is I need to fire that query on click and i need to use one provided with apollo client.
I have this function for fetching data on click:
...ANSWER
Answered 2019-Jul-18 at 19:01According to the apollo-client
docs, ApolloClient.query returns a Promise that resolves to an ApolloQueryResult, which is a simpler object that has only data
, errors
, loading
, networkStatus
, and stale
as properties.
On the other hand, the render prop argument of react-apollo
's Query
component gets fed a much richer object, with fetchMore
being one of its additional properties. If you want to do something similar using the raw ApolloClient object, you would have to use ApolloClient.watchQuery, which returns an ObservableQuery that you can subscribe to consume results. The benefit of this is that you have access to more methods, such as ObservableQuery.fetchMore.
Note this approach is fundamentally different than using ApolloClient.query
, since that function requests one query and returns the result as a Promise, while ApolloClient.watchQuery
consistently monitors your cache and pushes updated results to your subscribe method when the cache store changes, so it's a more complicated lifecycle. In general, if you're already using react-apollo
or one of the @apollo/react-X
packages, you probably want to stay away from ApolloClient.watchQuery
, since the functionality from those libraries builds directly on top of it and is designed to be easier to consume.
Hope this helps!
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install bulksearch
Limited content
Index updates continously
Fastest possible search
Rare updates on index
Low memory capabilities
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page