> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinetica.com/llms.txt
> Use this file to discover all available pages before exploring further.

# query_graph

<div className="kinetica-typedoc">
  <div className="section tsd-panel tsd-member">
    <h3 className="tsd-anchor-link" id="query_graph"><span>query\_graph</span></h3>

    <ul className="tsd-signatures">
      <li className="">
        <div className="tsd-signature tsd-anchor-link" id="query_graph-1"><span className="tsd-kind-call-signature">query\_graph</span><span className="tsd-signature-symbol">(</span><br /> <span className="tsd-kind-parameter">graph\_name</span><span className="tsd-signature-symbol">:</span> <span className="tsd-signature-type">string</span><span className="tsd-signature-symbol">,</span><br /> <span className="tsd-kind-parameter">queries</span><span className="tsd-signature-symbol">:</span> <span className="tsd-signature-type">string</span><span className="tsd-signature-symbol">\[]</span><span className="tsd-signature-symbol">,</span><br /> <span className="tsd-kind-parameter">restrictions</span><span className="tsd-signature-symbol">?:</span> <span className="tsd-signature-type">string</span><span className="tsd-signature-symbol">\[]</span><span className="tsd-signature-symbol">,</span><br /> <span className="tsd-kind-parameter">adjacency\_table</span><span className="tsd-signature-symbol">?:</span> <span className="tsd-signature-type">string</span><span className="tsd-signature-symbol">,</span><br /> <span className="tsd-kind-parameter">rings</span><span className="tsd-signature-symbol">?:</span> <span className="tsd-signature-type">number</span><span className="tsd-signature-symbol">,</span><br /> <span className="tsd-kind-parameter">options</span><span className="tsd-signature-symbol">?:</span> <span className="tsd-signature-type">Record</span><span className="tsd-signature-symbol">\<</span><span className="tsd-signature-type">string</span><span className="tsd-signature-symbol">,</span> <span className="tsd-signature-type">string</span><span className="tsd-signature-symbol">></span><span className="tsd-signature-symbol">,</span><br /> <span className="tsd-kind-parameter">callback</span><span className="tsd-signature-symbol">?:</span> <a href="/content/api/typescript/types/GPUdbCallback" className="tsd-signature-type tsd-kind-type-alias">GPUdbCallback</a><span className="tsd-signature-symbol">,</span><br /><span className="tsd-signature-symbol">)</span><span className="tsd-signature-symbol">:</span> <span className="tsd-signature-type">Promise</span><span className="tsd-signature-symbol">\<</span><a href="/content/api/typescript/interfaces/QueryGraphResponse" className="tsd-signature-type tsd-kind-interface">QueryGraphResponse</a><span className="tsd-signature-symbol">></span></div>

        <div className="tsd-description">
          <div className="tsd-comment tsd-typography">
            <p>Employs a topological query on a graph generated a-priori by <code>create\_graph</code> and returns a list of adjacent edge(s) or node(s), also known as an adjacency list, depending on what's been provided to the endpoint; providing edges will return nodes and providing nodes will return edges.</p>
            <p>To determine the node(s) or edge(s) adjacent to a value from a given column, provide a list of values to <code>queries</code>. This field can be populated with column values from any table as long as the type is supported by the given identifier. See Query Identifiers for more information.</p>
            <p>To return the adjacency list in the response, leave <code>adjacency\_table</code> empty.</p>
            <p>IMPORTANT: It's highly recommended that you review the Graphs and Solvers concepts documentation, the Graph REST Tutorial, and/or some /match/graph examples before using this endpoint.</p>
          </div>

          <div className="tsd-parameters">
            <h4 className="tsd-parameters-title">Parameters</h4>

            <ul className="tsd-parameter-list">
              <li>
                <span><span className="tsd-kind-parameter">graph\_name</span>: <span className="tsd-signature-type">string</span></span>

                <div className="tsd-comment tsd-typography">
                  <p>Name of the graph resource to query.</p>
                </div>
              </li>

              <li>
                <span><span className="tsd-kind-parameter">queries</span>: <span className="tsd-signature-type">string</span><span className="tsd-signature-symbol">\[]</span></span>

                <div className="tsd-comment tsd-typography">
                  <p>Nodes or edges to be queried specified using query identifiers. Identifiers can be used with existing column names, e.g., 'table.column AS QUERY\_NODE\_ID', raw values, e.g., '{"{"}0, 2{"}"} AS QUERY\_NODE\_ID', or expressions, e.g., 'ST\_MAKEPOINT(table.x, table.y) AS QUERY\_NODE\_WKTPOINT'. Multiple values can be provided as long as the same identifier is used for all values. If using raw values in an identifier combination, the number of values specified must match across the combination.</p>
                </div>
              </li>

              <li>
                <span><code className="tsd-tag">Optional</code><span className="tsd-kind-parameter">restrictions</span>: <span className="tsd-signature-type">string</span><span className="tsd-signature-symbol">\[]</span></span>

                <div className="tsd-comment tsd-typography">
                  <p>Additional restrictions to apply to the nodes/edges of an existing graph. Restrictions must be specified using identifiers; identifiers are grouped as combinations. Identifiers can be used with existing column names, e.g., 'table.column AS RESTRICTIONS\_EDGE\_ID', expressions, e.g., 'column/2 AS RESTRICTIONS\_VALUECOMPARED', or raw values, e.g., '{"{"}0, 0, 0, 1{"}"} AS RESTRICTIONS\_ONOFFCOMPARED'. If using raw values in an identifier combination, the number of values specified must match across the combination.</p>
                </div>
              </li>

              <li>
                <span><code className="tsd-tag">Optional</code><span className="tsd-kind-parameter">adjacency\_table</span>: <span className="tsd-signature-type">string</span></span>

                <div className="tsd-comment tsd-typography">
                  <p>Name of the table to store the resulting adjacencies, in \[schema\_name.]table\_name format, using standard name resolution rules and meeting table naming criteria. If left blank, the query results are instead returned in the response. If the 'QUERY\_TARGET\_NODE\_LABEL' query identifier is used in <code>queries</code>, then two additional columns will be available: 'PATH\_ID' and 'RING\_ID'. See Using Labels for more information.</p>
                </div>
              </li>

              <li>
                <span><code className="tsd-tag">Optional</code><span className="tsd-kind-parameter">rings</span>: <span className="tsd-signature-type">number</span></span>

                <div className="tsd-comment tsd-typography">
                  <p>Sets the number of rings around the node to query for adjacency, with '1' being the edges directly attached to the queried node. Also known as number of hops. For example, if it is set to '2', the edge(s) directly attached to the queried node(s) will be returned; in addition, the edge(s) attached to the node(s) attached to the initial ring of edge(s) surrounding the queried node(s) will be returned. If the value is set to '0', any nodes that meet the criteria in <code>queries</code> and <code>restrictions</code> will be returned. This parameter is only applicable when querying nodes.</p>
                </div>
              </li>

              <li>
                <span><code className="tsd-tag">Optional</code><span className="tsd-kind-parameter">options</span>: <span className="tsd-signature-type">Record</span><span className="tsd-signature-symbol">\<</span><span className="tsd-signature-type">string</span><span className="tsd-signature-symbol">,</span> <span className="tsd-signature-type">string</span><span className="tsd-signature-symbol">></span></span>

                <div className="tsd-comment tsd-typography">
                  <p>Additional parameters.</p>
                </div>
              </li>

              <li>
                <span><code className="tsd-tag">Optional</code><span className="tsd-kind-parameter">callback</span>: <a href="/content/api/typescript/types/GPUdbCallback" className="tsd-signature-type tsd-kind-type-alias">GPUdbCallback</a></span>

                <div className="tsd-comment tsd-typography">
                  <p>Optional callback function</p>
                </div>
              </li>
            </ul>
          </div>

          <h4 className="tsd-returns-title">Returns <span className="tsd-signature-type">Promise</span><span className="tsd-signature-symbol">\<</span><a href="/content/api/typescript/interfaces/QueryGraphResponse" className="tsd-signature-type tsd-kind-interface">QueryGraphResponse</a><span className="tsd-signature-symbol">></span></h4>
          <p>Promise\<Types.QueryGraphResponse> - Promise resolving to the response</p>

          <div className="aside tsd-sources">
            <ul>
              <li>Defined in <a href="https://github.com/kineticadb/kinetica-api-typescript/blob/master/src/GPUdb.ts#L12147">src/GPUdb.ts:12147</a></li>
            </ul>
          </div>
        </div>
      </li>
    </ul>
  </div>

  <div className="section tsd-panel tsd-member">
    <h3 className="tsd-anchor-link" id="query_graph_request"><span>query\_graph\_request</span></h3>

    <ul className="tsd-signatures">
      <li className="">
        <div className="tsd-signature tsd-anchor-link" id="query_graph_request-1"><span className="tsd-kind-call-signature">query\_graph\_request</span><span className="tsd-signature-symbol">(</span><br /> <span className="tsd-kind-parameter">request</span><span className="tsd-signature-symbol">:</span> <a href="/content/api/typescript/interfaces/QueryGraphRequest" className="tsd-signature-type tsd-kind-interface">QueryGraphRequest</a><span className="tsd-signature-symbol">,</span><br /> <span className="tsd-kind-parameter">callback</span><span className="tsd-signature-symbol">?:</span> <a href="/content/api/typescript/types/GPUdbCallback" className="tsd-signature-type tsd-kind-type-alias">GPUdbCallback</a><span className="tsd-signature-symbol">,</span><br /><span className="tsd-signature-symbol">)</span><span className="tsd-signature-symbol">:</span> <span className="tsd-signature-type">Promise</span><span className="tsd-signature-symbol">\<</span><a href="/content/api/typescript/interfaces/QueryGraphResponse" className="tsd-signature-type tsd-kind-interface">QueryGraphResponse</a><span className="tsd-signature-symbol">></span></div>

        <div className="tsd-description">
          <div className="tsd-comment tsd-typography">
            <p>Employs a topological query on a graph generated a-priori by <code>create\_graph</code> and returns a list of adjacent edge(s) or node(s), also known as an adjacency list, depending on what's been provided to the endpoint; providing edges will return nodes and providing nodes will return edges.</p>
            <p>To determine the node(s) or edge(s) adjacent to a value from a given column, provide a list of values to <code>queries</code>. This field can be populated with column values from any table as long as the type is supported by the given identifier. See Query Identifiers for more information.</p>
            <p>To return the adjacency list in the response, leave <code>adjacency\_table</code> empty.</p>
            <p>IMPORTANT: It's highly recommended that you review the Graphs and Solvers concepts documentation, the Graph REST Tutorial, and/or some /match/graph examples before using this endpoint.</p>
          </div>

          <div className="tsd-parameters">
            <h4 className="tsd-parameters-title">Parameters</h4>

            <ul className="tsd-parameter-list">
              <li>
                <span><span className="tsd-kind-parameter">request</span>: <a href="/content/api/typescript/interfaces/QueryGraphRequest" className="tsd-signature-type tsd-kind-interface">QueryGraphRequest</a></span>

                <div className="tsd-comment tsd-typography">
                  <p>Request object containing the parameters for the operation</p>
                </div>
              </li>

              <li>
                <span><code className="tsd-tag">Optional</code><span className="tsd-kind-parameter">callback</span>: <a href="/content/api/typescript/types/GPUdbCallback" className="tsd-signature-type tsd-kind-type-alias">GPUdbCallback</a></span>

                <div className="tsd-comment tsd-typography">
                  <p>Optional callback function</p>
                </div>
              </li>
            </ul>
          </div>

          <h4 className="tsd-returns-title">Returns <span className="tsd-signature-type">Promise</span><span className="tsd-signature-symbol">\<</span><a href="/content/api/typescript/interfaces/QueryGraphResponse" className="tsd-signature-type tsd-kind-interface">QueryGraphResponse</a><span className="tsd-signature-symbol">></span></h4>
          <p>Promise\<Types.QueryGraphResponse> - Promise resolving to the response</p>

          <div className="aside tsd-sources">
            <ul>
              <li>Defined in <a href="https://github.com/kineticadb/kinetica-api-typescript/blob/master/src/GPUdb.ts#L12099">src/GPUdb.ts:12099</a></li>
            </ul>
          </div>
        </div>
      </li>
    </ul>
  </div>
</div>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.