menu
Apollo

# Local State

Conversations regarding Apollo Client local state.

Posts
Members
Search

Query re-fetched before onResetStore callback is run

I've got this minimal example showcasing the issue here I've got an onResetStore callback function that resets the default values to the apollo local state (i.e. the cache). It seems, however, that when I call client.resetStore() the Query that reads the local state fires (and…

thumbsup
0
message-simple
0

Wrapping my head around local state

So I've created an Apollo server backend and hooked it up to a front end vue app and I'm able to run mutations/queries and all that good stuff. Also was able to access the cache as well and manage local resolvers for local state management when it doesn't need to interact with…

thumbsup
0
message-simple
8

Store arbitrary objects in the local state store

I was using the local state store to store information on url query parameters as filters and other UI options were chosen (the keys were dynamic and would automagically work as the app was expanded). The code looks like this: This worked fine in apollo-client 2.3.5, but on…

thumbsup
0
message-simple
1

Local state and Apollo Client Developer Tools

I have a simple app that uses a GraphQL API and local state: https://codesandbox.io/s/github/454de6e/ip-country-lookup The local state is just one field ip. …

thumbsup
1
message-simple
3

Having trouble testing local state management

Howdy! Great work to everyone on the team for releasing 2.5, it's rad. I'm having issues finding any material on testing local state with <MockedProvider /> and <Query />. I've tried a few things from this commit, but with no <Query /> implementation I feel like I'm doing…

thumbsup
0
message-simple
1

Logging client-link-state queries and mutations after migration to 2.5

I recently migrated from client-link-state to ApolloClient's built-in local state management (following this migration guide) I have a logging link that logs all queries/mutations (client + server) while developing. Since the client state is no longer in this chain I'm not…

thumbsup
1
message-simple
0

How to setup apollo link state for your next project

https://hackernoon.com/setting-up-apollo-link-state-for-multiple-stores-4cf54fdb1e00

thumbsup
2
message-simple
4

Heuristic fragment matcher warning

While writing the cache in a client-side resolver, I get this warning which is unnecessary since I'm not using unions or interfaces. Here is the code in the client app that throws the warning: I don't even think using fragmentMatcher on the cache will solve this since it's a…

thumbsup
0
message-simple
1

Apollo-link-state vs Redux vs React Hooks+Context

What are the pros and cons of using apollo-link-state vs managing client state separate from the GraphQL schema? What is the currently generally accepted best practice?

thumbsup
12
message-simple
16

Can't get mutation to work with 2.5 core local state

I was using apollo-link-state to store some local settings using a simple getSettings / updateSettings query / mutation pair. After migrating, the query still works, but the mutation always fails GraphQL validation: Validation error of type UnknownDirective: Unknown directive…

thumbsup
0
message-simple
0