import type Accessor from "../../core/Accessor.js";

export interface GraphQueryProperties extends Partial<Pick<GraphQuery, "openCypherQuery">> {}

/**
 * Defines the query operation performed on a knowledge graph service's
 * [graph](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-KnowledgeGraph.html) resource.
 * The {@link rest/knowledgeGraph/Entities} and {@link rest/knowledgeGraph/Relationships}
 * in the graph are queried by sending an Esri implementation of [openCypher](https://opencypher.org/) query.
 *
 * > [!WARNING]
 * >
 * > **Notes**
 * >
 * > ArcGIS Knowledge does not support write capabilities of the openCypher query language. All openCypher queries must be read-only.
 *
 * @since 4.25
 * @see [Sample - Query an knowledge graph](https://developers.arcgis.com/javascript/latest/sample-code/knowledgegraph-query/)
 * @see [executeQuery()](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraphService.html#executeQuery)
 * @see [executeQueryStreaming()](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraphService.html#executeQueryStreaming)
 * @example
 * //typical use case
 * KnowledgeGraphModule.executeQuery(
 *  knowledgeGraph, //graph
 *  { //queryArguments
 *    openCypherQuery: "MATCH (n) RETURN n LIMIT 1", //query
 *   }).then((queryResult) => {
 *     //do something with the result
 * });
 */
export default class GraphQuery extends Accessor {
  constructor(properties?: GraphQueryProperties);
  /**
   * The Esri implementation of [openCypher](https://opencypher.org/) query to be executed against the knowledge graph.
   *
   * > [!WARNING]
   * >
   * > **Required**
   * >
   * > [executeQuery()](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraphService.html#executeQuery) will fail if not provided.
   *
   * @default ""
   */
  accessor openCypherQuery: string;
}