Bug: Cannot import temporal types from 4.3
wheresrhys opened this issue · 1 comments
As documented this should work
import {DateTime} from 'neo4j-driver/lib/temporal-types.js'
Although in my codebase I'm using require
this should also work (and always has done)
Since 4.3 it's stopped working.
From looking at the source code I guess these should now be imported directly from the main export of the library, but the documentation has not been updated. Either way, it is still a breaking change within a minor release which isn't great
@wheresrhys, just for your information, in order to access temporal types in the GraphQL Library (which is compatible with version 4.1, 4.2 and 4.3 of the driver), we do the following:
import neo4j from "neo4j-driver";
const DateTime = neo4j.types.DateTime;
Personally, whenever I use a library export from a nested directory, I assume that it could break at any time. I only assume that root-level exports won't break outside of a major release. That's just my opinion anyway! 🙂