apollo-cache
Advanced tools
Changelog
Apollo Utilities (1.1.1)
The flattenSelections
helper function is no longer exported from
apollo-utilities
, since getDirectiveNames
has been reimplemented
without using flattenSelections
, and flattenSelections
has no clear
purpose now. If you need the old functionality, use a visitor:
import { visit } from "graphql/language/visitor";
function flattenSelections(selection: SelectionNode) {
const selections: SelectionNode[] = [];
visit(selection, {
SelectionSet(ss) {
selections.push(...ss.selections);
},
});
return selections;
}