Fix missing available extension info in navbar
fixes #1076
With apollo v4 "refetchQueries" excludes queries with "cache-only" policy
Regression c6343e24a5
This commit is contained in:
@@ -1446,7 +1446,32 @@ export class RequestManager {
|
|||||||
GQLMethod.USE_MUTATION,
|
GQLMethod.USE_MUTATION,
|
||||||
GET_EXTENSIONS_FETCH,
|
GET_EXTENSIONS_FETCH,
|
||||||
{},
|
{},
|
||||||
{ refetchQueries: [GET_EXTENSIONS], ...options },
|
{
|
||||||
|
...options,
|
||||||
|
update(cache, { data: mutationData }) {
|
||||||
|
if (!mutationData?.fetchExtensions?.extensions) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
cache.writeQuery({
|
||||||
|
query: GET_EXTENSIONS,
|
||||||
|
data: {
|
||||||
|
extensions: {
|
||||||
|
__typename: 'ExtensionNodeList',
|
||||||
|
nodes: mutationData.fetchExtensions.extensions,
|
||||||
|
pageInfo: {
|
||||||
|
__typename: 'PageInfo',
|
||||||
|
hasNextPage: false,
|
||||||
|
hasPreviousPage: false,
|
||||||
|
startCursor: null,
|
||||||
|
endCursor: null,
|
||||||
|
},
|
||||||
|
totalCount: mutationData.fetchExtensions.extensions.length,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
);
|
);
|
||||||
const [, setUpdatedCache] = useState({});
|
const [, setUpdatedCache] = useState({});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user