Apollo-client-devtools: Uncaught TypeError: Cannot read property 'queryStore' of undefined

Created on 23 Oct 2018  路  4Comments  路  Source: apollographql/apollo-client-devtools

When I open the "Apollo" chrome extension, I get an error - Uncaught TypeError: Cannot read property 'queryStore' of undefined.

const cache   = new InMemoryCache();
    const options = {
        link          : ApolloLink.from([
            setContext(getContext),
            withClientState({ cache, defaults: { theme: 'dark' } }),
            new BatchHttpLink({ uri: '/gql', credentials: 'same-origin' })
        ]),
        cache,
        defaultOptions: {
            query: {
                fetchPolicy: 'no-cache'
            }
        },
        clientState   : {
            defaults: {
                applicationurls: {}
            }
        }
    };

    return new ApolloClient(options);

Anand

Most helpful comment

Looks like the QueryManager is getting initialized lazily when the first query or mutation performed. Calling initQuerymanager() after creating the client seems to have solved the problem.

Is this is known issue?

All 4 comments

Looks like the QueryManager is getting initialized lazily when the first query or mutation performed. Calling initQuerymanager() after creating the client seems to have solved the problem.

Is this is known issue?

Same for me, as suggested by @nanandn solved by adding client.initQueryManager() after client creation. (with M uppercase ;).

@nanandn THANK YOU SO MUCH, FINALLY! I have had this issue for months now!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

richburdon picture richburdon  路  4Comments

bbrinx picture bbrinx  路  6Comments

mvestergaard picture mvestergaard  路  6Comments

wildpow picture wildpow  路  6Comments

ryannealmes picture ryannealmes  路  5Comments