Closed
Description
As documented here and added to this library here, when creating a driver you can pass in a custom resolver:
import neo4j from 'neo4j-driver';
const driver = neo4j.driver(
'my-uri',
neo4j.auth.basic('username', 'password'),
{
resolver: address => ['my', 'array', 'of', 'addresses'],
},
);
With the current types, this doesn't work. You are told that resolver
isn't a known property on Config
.
This seems fair enough, because we can see that this is the case in the type definition here:
neo4j-javascript-driver/types/v1/driver.d.ts
Lines 50 to 66 in c8d2ad9
This resolver
function isn't used immediately anywhere, it happens quite far away from the constructor. I'm guessing that the resolver referenced here is the one we're looking for:
If so, the definition should be something like this, allowing either an array of strings or a promise resolving to an array of strings:
declare interface Config {
...
resolver?: (address: string) => Promise<string[]> | string[]
}
Hope that's useful!
Metadata
Metadata
Assignees
Labels
No labels