apollo-client: Cannot read property 'queries'
Im getting a weird error after updating from 0.4.12 to 0.4.16
Log:
action @ 10:19:13.762 APOLLO_QUERY_INIT
action @ 10:19:13.777 APOLLO_QUERY_INIT
action @ 10:19:13.869 APOLLO_QUERY_RESULT
action @ 10:19:13.874 APOLLO_QUERY_ERROR
action @ 10:19:13.878 APOLLO_QUERY_RESULT
action @ 10:19:13.881 APOLLO_QUERY_ERROR
Error:
{
type: "APOLLO_QUERY_ERROR",
error: TypeError: Cannot read property 'queries' of undefined at next (http://localhost:3000/packages/m…, queryId: "2", requestId: 3
}
My queries server side and testing them from /graphiql
works great
at first i thought it was something to do with my reducer… this is my client, but seems to work fine for other versions:
const client= new ApolloClient({ networkInterface });
const rootReducer = combineReducers({
gestorFiltros,
apollo: client.reducer()
});
//client.middleware(), createLogger() en caso de debugeo
const store = createStore(
rootReducer, {},
applyMiddleware(client.middleware(), createLogger()),
window.devToolsExtension ? window.devToolsExtension() : f => f
);
Meteor.startup(() => {
localStorage.debug = null
ReactDOM.render(
<ApolloProvider store={store} client={client}>
<Rutas />
</ApolloProvider>,
document.getElementById('app')
);
});
EDIT
i just added the reduxRootKey
const client = new ApolloClient({
networkInterface,
reduxRootKey: 'apollo',
});
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 16 (10 by maintainers)
Should be fixed in 0.4.19, can you confirm @tim-field?
@cristiandley this should be fixed in 0.4.18 (which contains all the changes from 0.4.16, and fixes for this issue and another one)
We just published a 0.4.17 which is identical to 0.4.15. Use that while we fix the issues.