-
Notifications
You must be signed in to change notification settings - Fork 787
Check if queryManager is set before accessing it #2165
Conversation
Thanks @danilobuerger! |
This fix was published on |
I'm still seeing this |
It wasn't released in 2.1.9 |
Added Changelog for: * apollographql#2151 * apollographql#2165
When is this being released? |
Was released in 2.1.11 |
I am getting the error around same scenario in react-apollo/test-utils.js
This is happening because of cleanup in Do you think this should be raised as a new issue OR is there anything I am doing wrong in my setup. My dependencies : {
"graphql": "0.13.0",
"graphql-tag": "^2.10.1",
"react": "^16.8.4",
"react-apollo": "^2.5.2",
"react-dom": "^16.8.4",
"react-router-dom": "^5.0.0",
"react-scripts": "2.1.8"
}, I have tried different versions of react-apollo : Below is the error :
Below is my code block : import React from 'react';
import { Query } from 'react-apollo';
import { render } from 'react-testing-library';
import 'react-testing-library/cleanup-after-each';
import { MockedProvider } from 'react-apollo/test-utils';
import wait from 'waait';
import queryGethAllApps from 'graphql/queries/get-all-apps';
function FeatureList({ refetch }) {
return (
<Query
query={queryGethAllApps}
fetchPolicy={refetch ? 'cache-and-network' : 'cache-first'}
>
{({ loading, data: { listFtApplications } }) => {
if (loading) return <span>loading....</span>;
return <span>feature lists</span>;
}}
</Query>
);
}
test('It renders feature list component', async () => {
const mocks = [
{
request: {
query: queryGethAllApps
},
result: {
data: {
listFtApplications: {
items: [{ id: '123', name: 'mock test' }]
}
}
}
}
];
const { getByText, asFragment } = render(
<MockedProvider mocks={mocks} addTypename={false}>
<FeatureList />
</MockedProvider>
);
await wait(0);
expect(asFragment()).toMatchSnapshot();
expect(getByText('feature lists')).toBeInTheDocument();
}); |
I am getting this exact same error with |
Hello @ashoksudani, can you open an issue with your error, please? |
Fixes #2164 . Sorry for breaking the release :(.