async function fetchSummary()

in packages/graph-explorer/src/connector/openCypher/openCypherExplorer.ts [109:140]


async function fetchSummary(
  serviceType: string,
  connection: ConnectionConfig,
  featureFlags: FeatureFlags,
  options?: RequestInit
) {
  try {
    const endpoint =
      serviceType === DEFAULT_SERVICE_TYPE
        ? `${connection.url}/pg/statistics/summary?mode=detailed`
        : `${connection.url}/summary?mode=detailed`;
    const response = await fetchDatabaseRequest(
      connection,
      featureFlags,
      endpoint,
      {
        method: "GET",
        ...options,
      }
    );

    return (
      (response.payload
        ? (response.payload.graphSummary as GraphSummary)
        : (response.graphSummary as GraphSummary)) || undefined
    );
  } catch (e) {
    if (env.DEV) {
      logger.error("[Summary API]", e);
    }
  }
}