fragmentsFromDocument function
Implementation
Map<String, FragmentDefinitionNode> fragmentsFromDocument(
DocumentNode document,
) {
final allFragments = document.definitions.whereType<FragmentDefinitionNode>();
return Map.fromEntries(
allFragments.map((e) => MapEntry(e.name.value, e)),
);
}