Skip to content

HTTP Query API Support - #1319

Draft
robsdedude wants to merge 90 commits into
neo4j:6.xfrom
robsdedude:feat/query-api
Draft

HTTP Query API Support#1319
robsdedude wants to merge 90 commits into
neo4j:6.xfrom
robsdedude:feat/query-api

Conversation

@robsdedude

@robsdedude robsdedude commented Jul 7, 2026

Copy link
Copy Markdown
Member

Neo4j servers recently introduced a new HTTP API for querying the database (called Query API): https://neo4j.com/docs/query-api/current/

This PR add support for configuring the driver with a HTTP URL (e.g. https://neo4j.example.com:7474/), which will make the driver run queries and transactions via the HTTP Query API instead of Bolt.

Notes

Please note that:

  • This feature is in preview (see below).
  • For the HTTP support 3rd party libraries (currently urllib3 for sync and aiohttp for async) are required. Install pip install neo4j[http] instead of pip install neo4j.
  • Some features are not supported and likely won't be in the future:
    • home database resolution (i.e., user code must always provide an explicit database name for each session created)
    • the only supported authentication scheme is basic
  • Some features are not yet supported:
    • Transaction metadata and timeouts are being ignored.
    • Some details in the summary (such as neo4j.ResultSummary.server.protocol_info) might be missing or inaccurate.
    • Vector types, the UnsupportedType type, and UUIDs cannot be exchanged with the DBMS.
    • Notifications and errors have fallback GQL status codes and status information.
    • fetch_size has not effect, there is no backpressure mechanism.
    • Notification filters (notifications_min_severity, notifications_disabled_categories, notifications_disabled_classifications) have no effect.

Preview

This feature is in preview. This means that it does not follow semver. It might be changed (or in rare cases be removed) at any time without following the normal deprecation cycle.


Depends on:

Closes: DRIVERS-118

 * Server agent string cache bound to driver instance, not interpreter state
 * Fix using deprecated config of aiohttp
 * Enable TestKit testing
 * Docs: mentions that server agent string is computed & cacahed
The HTTP Query API will send `null` for notifications without a position. To
make the experience the same between using bolt and HTTP, the driver drops
`null` positions via HTTP to make them absent, just like they are via bolt.
Comment thread testkit/testkit.json
{
"testkit": {
"uri": "https://github.com/neo4j-drivers/testkit.git",
"ref": "6.x"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: revert once TestKit PR has been merged:

Comment thread src/neo4j/_async/driver.py Outdated
Comment thread src/neo4j/_async/io/_http/_http2.py Outdated
Comment thread src/neo4j/_async_compat/concurrency.py
Comment thread src/neo4j/_async/io/_http/_base.py Outdated
Comment thread src/neo4j/_io.py
@dataclasses.dataclass(slots=True, frozen=True, kw_only=True)
class HTTPServerInfo:
neo4j_version: str
parsed_neo4j_version: tuple[int, int] | None = dataclasses.field(

@StephenCathcart StephenCathcart Aug 6, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i've got a half-memory of a call about parsing the server version and rejecting the older ones that send values as a flat list rather than a list of records, so users get a clear message instead of a parse error. parsed_neo4j_version is computed here but i couldn't find anything reading it, so i may have the wrong end of this.

a stub advertising 5.19.0 with the flat shape gives:

QueryApiHttpError: protocol error: expected list, got: 1

and that class's docstring points people at filing a driver bug. can't recall if I'm remembering this correctly, and whether it still needs changed?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember we discussed something along those lines

  1. during refinement 2026-04-28 we decided to fail hard if the discovery endpoint does not exist or if the server version can't be parsed.
  2. However, I don't think we made a call on which server versions we wouldn't want to support/reject (only that we'd draw the line somewhere™ TBD).
  3. Neither do I remember that we made a decision on whether older servers should fail hard (i.e., driver perform the check you propose here) or fail soft (i.e., the moment they misbehave, anything may happen including protocol violation errors).

Can you find notes or similar to remind me if anything regarding 2. or 3. was decided?

Comment thread docs/source/async_api.rst
Comment thread src/neo4j/_async/driver.py
Comment thread src/neo4j/_async/io/_connection.py Outdated
Comment thread docs/source/api.rst Outdated
Comment thread src/neo4j/_async/io/_http/_base.py Outdated
Comment thread src/neo4j/_async_compat/network/_http_query_api.py Outdated
Comment thread docs/source/api.rst Outdated

@StephenCathcart StephenCathcart left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than open questions looks good to me 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants