extractFragmentInfo = ({ fragment, fragmentName }, collectionName) => {
  if (!(fragment || fragmentName || collectionName))
    throw new Error('Please specify either fragment or fragmentName, or pass a collectionName');
  if (fragment) {
    return {
      fragment,
      fragmentName: fragmentName || getFragmentName(fragment)
    };
  } else {
    const _fragmentName = fragmentName || `${collectionName}DefaultFragment`;
    return {
      fragment: getFragment(_fragmentName),
      fragmentName: _fragmentName
    };
  }
}
Extract fragmentName from fragment
or fragment from fragmentName