code: public function getFragment($name)
      {
          $fragments = $this->fragments;
          if (! $fragments) {
              $fragments = [];
              foreach ($this->getDocument()->definitions as $statement) {
                  if ($statement->kind !== NodeKind::FRAGMENT_DEFINITION) {
                      continue;
                  }
  
                  $fragments[$statement->name->value] = $statement;
              }
              $this->fragments = $fragments;
          }
  
          return $fragments[$name] ?? null;
      }
docs: @param string $name
  
  @return FragmentDefinitionNode|null