code: function visitFragment(fragment, fragments, fragmentsHash) {
    if (fragment.marked) {
      throw Error('Fragments cannot contain a cycle');
    }
    if (!fragment.visited) {
      fragment.marked = true;
      // Visit every spread in this fragment definition
      visit(fragment, {
        FragmentSpread(node) {
          // Visit the corresponding fragment definition
          visitFragment(fragmentsHash[node.name.value], fragments, fragmentsHash);
        }
      });
      fragment.visited = true;
      fragment.marked = false;
      fragments.push(fragment);
    }
  }
docs: Recursive helper function for sortDefinitions