private boolean isEndpointConfigurationValid()

in src/main/com/intellij/lang/jsgraphql/ide/introspection/GraphQLIntrospectionService.java [112:161]


  private boolean isEndpointConfigurationValid(GraphQLConfigEndpoint endpoint) {
    GraphQLProjectConfig projectConfig = endpoint.getConfig();
    VirtualFile configFile = projectConfig != null ? projectConfig.getFile() : null;
    if (projectConfig == null || configFile == null) {
      showInvalidConfigurationNotification(
        GraphQLBundle.message("graphql.notification.introspection.endpoint.config.not.found"),
        endpoint.getFile(),
        myProject
      );
      return false;
    }

    if (StringUtil.isEmptyOrSpaces(endpoint.getUrl())) {
      showInvalidConfigurationNotification(
        GraphQLBundle.message("graphql.notification.introspection.empty.endpoint.url"),
        endpoint.getFile(),
        myProject
      );
      return false;
    }

    GraphQLSchemaPointer pointer = endpoint.getSchemaPointer();
    String schemaPath = pointer != null ? pointer.getOutputPath() : null;

    if (StringUtil.isEmptyOrSpaces(schemaPath)) {
      if (pointer == null || !pointer.isRemote()) {
        showInvalidConfigurationNotification(
          GraphQLBundle.message(
            "graphql.notification.introspection.empty.schema.path",
            pointer != null ? GraphQLBundle.message(
              "graphql.notification.introspection.empty.schema.path.provided",
              pointer.getPattern()
            ) : ""
          ),
          endpoint.getFile(),
          myProject
        );
      }
      else {
        showInvalidConfigurationNotification(
          GraphQLBundle.message("graphql.notification.introspection.unable.to.build.path"),
          endpoint.getFile(),
          myProject
        );
      }
      return false;
    }

    return true;
  }