code: private function getEnumValueNodes(EnumType $enum, $valueName)
      {
          if ($enum->astNode && $enum->astNode->values) {
              return array_filter(
                  iterator_to_array($enum->astNode->values),
                  static function (EnumValueDefinitionNode $value) use ($valueName) {
                      return $value->name->value === $valueName;
                  }
              );
          }
  
          return $enum->astNode ?
              $enum->astNode->values : null;
      }
docs: @param string $valueName
  
  @return EnumValueDefinitionNode[]