1717 * limitations under the License.
1818 */
1919
20- import * as neo4j from "neo4j-driver" ;
2120import { Neo4jGraphQL } from "@neo4j/graphql" ;
21+ import * as neo4j from "neo4j-driver" ;
2222import { toGraphQLTypeDefs } from "../../../src/index" ;
2323import createDriver from "../neo4j" ;
2424
@@ -34,7 +34,7 @@ describe("GraphQL - Infer Schema nodes basic tests", () => {
3434 driver = await createDriver ( ) ;
3535 const cSession = driver . session ( { defaultAccessMode : neo4j . session . WRITE } ) ;
3636 try {
37- await cSession . writeTransaction ( ( tx ) => tx . run ( `CREATE DATABASE ${ dbName } WAIT` ) ) ;
37+ await cSession . executeWrite ( ( tx ) => tx . run ( `CREATE DATABASE ${ dbName } WAIT` ) ) ;
3838 } catch ( e ) {
3939 if ( e instanceof Error ) {
4040 if (
@@ -53,7 +53,7 @@ describe("GraphQL - Infer Schema nodes basic tests", () => {
5353 const waitSession = driver . session ( {
5454 defaultAccessMode : neo4j . session . READ ,
5555 database : dbName ,
56- bookmarks : cSession . lastBookmark ( ) ,
56+ bookmarks : cSession . lastBookmarks ( ) ,
5757 } ) ;
5858 await cSession . close ( ) ;
5959 await waitSession . close ( ) ;
@@ -69,7 +69,7 @@ describe("GraphQL - Infer Schema nodes basic tests", () => {
6969 if ( MULTIDB_SUPPORT ) {
7070 const cSession = driver . session ( { defaultAccessMode : neo4j . session . WRITE } ) ;
7171 try {
72- await cSession . writeTransaction ( ( tx ) => tx . run ( `DROP DATABASE ${ dbName } ` ) ) ;
72+ await cSession . executeWrite ( ( tx ) => tx . run ( `DROP DATABASE ${ dbName } ` ) ) ;
7373 } catch ( e ) {
7474 // ignore
7575 }
@@ -85,10 +85,10 @@ describe("GraphQL - Infer Schema nodes basic tests", () => {
8585
8686 const nodeProperty = "testString" ;
8787 const wSession = driver . session ( { defaultAccessMode : neo4j . session . WRITE , database : dbName } ) ;
88- await wSession . writeTransaction ( ( tx ) =>
88+ await wSession . executeWrite ( ( tx ) =>
8989 tx . run ( "CREATE (:TestLabel {nodeProperty: $prop})" , { prop : nodeProperty } )
9090 ) ;
91- const bm = wSession . lastBookmark ( ) ;
91+ const bm = wSession . lastBookmarks ( ) ;
9292 await wSession . close ( ) ;
9393
9494 const typeDefs = await toGraphQLTypeDefs ( sessionFactory ( bm ) ) ;
@@ -112,13 +112,13 @@ describe("GraphQL - Infer Schema nodes basic tests", () => {
112112
113113 const nodeProperties = { str : "testString" , int : neo4j . int ( 42 ) , number : 80 , strArr : [ "Stella" , "Molly" ] } ;
114114 const wSession = driver . session ( { defaultAccessMode : neo4j . session . WRITE , database : dbName } ) ;
115- await wSession . writeTransaction ( ( tx ) =>
115+ await wSession . executeWrite ( ( tx ) =>
116116 tx . run (
117117 "CREATE (:TestLabel {strProp: $props.str, intProp: $props.int, numberProp: $props.number, strArrProp: $props.strArr})" ,
118118 { props : nodeProperties }
119119 )
120120 ) ;
121- const bm = wSession . lastBookmark ( ) ;
121+ const bm = wSession . lastBookmarks ( ) ;
122122 await wSession . close ( ) ;
123123
124124 const typeDefs = await toGraphQLTypeDefs ( sessionFactory ( bm ) ) ;
@@ -145,14 +145,14 @@ describe("GraphQL - Infer Schema nodes basic tests", () => {
145145
146146 const nodeProperties = { first : "testString" , second : neo4j . int ( 42 ) } ;
147147 const wSession = driver . session ( { defaultAccessMode : neo4j . session . WRITE , database : dbName } ) ;
148- await wSession . writeTransaction ( ( tx ) =>
148+ await wSession . executeWrite ( ( tx ) =>
149149 tx . run (
150150 `CREATE (:TestLabel {strProp: $props.first})
151151 CREATE (:TestLabel2 {singleProp: $props.second})` ,
152152 { props : nodeProperties }
153153 )
154154 ) ;
155- const bm = wSession . lastBookmark ( ) ;
155+ const bm = wSession . lastBookmarks ( ) ;
156156 await wSession . close ( ) ;
157157
158158 const typeDefs = await toGraphQLTypeDefs ( sessionFactory ( bm ) ) ;
@@ -180,14 +180,14 @@ describe("GraphQL - Infer Schema nodes basic tests", () => {
180180
181181 const nodeProperties = { first : "testString" , second : neo4j . int ( 42 ) } ;
182182 const wSession = driver . session ( { defaultAccessMode : neo4j . session . WRITE , database : dbName } ) ;
183- await wSession . writeTransaction ( ( tx ) =>
183+ await wSession . executeWrite ( ( tx ) =>
184184 tx . run (
185185 `CREATE (:TestLabel {strProp: $props.first})
186186 CREATE (:TestLabel2:TestLabel3 {singleProp: $props.second})` ,
187187 { props : nodeProperties }
188188 )
189189 ) ;
190- const bm = wSession . lastBookmark ( ) ;
190+ const bm = wSession . lastBookmarks ( ) ;
191191 await wSession . close ( ) ;
192192
193193 const typeDefs = await toGraphQLTypeDefs ( sessionFactory ( bm ) ) ;
@@ -215,13 +215,13 @@ describe("GraphQL - Infer Schema nodes basic tests", () => {
215215
216216 const nodeProperties = { first : "testString" , second : neo4j . int ( 42 ) } ;
217217 const wSession = driver . session ( { defaultAccessMode : neo4j . session . WRITE , database : dbName } ) ;
218- await wSession . writeTransaction ( ( tx ) =>
218+ await wSession . executeWrite ( ( tx ) =>
219219 tx . run (
220220 "CREATE (:`Test``Label` {strProp: $props.first}) CREATE (:`Test-Label` {singleProp: $props.second})" ,
221221 { props : nodeProperties }
222222 )
223223 ) ;
224- const bm = wSession . lastBookmark ( ) ;
224+ const bm = wSession . lastBookmarks ( ) ;
225225 await wSession . close ( ) ;
226226
227227 const typeDefs = await toGraphQLTypeDefs ( sessionFactory ( bm ) ) ;
@@ -249,8 +249,8 @@ describe("GraphQL - Infer Schema nodes basic tests", () => {
249249 }
250250
251251 const wSession = driver . session ( { defaultAccessMode : neo4j . session . WRITE , database : dbName } ) ;
252- await wSession . writeTransaction ( ( tx ) => tx . run ( "CREATE (:`2number` {prop: 1})" ) ) ;
253- const bm = wSession . lastBookmark ( ) ;
252+ await wSession . executeWrite ( ( tx ) => tx . run ( "CREATE (:`2number` {prop: 1})" ) ) ;
253+ const bm = wSession . lastBookmarks ( ) ;
254254 await wSession . close ( ) ;
255255
256256 const typeDefs = await toGraphQLTypeDefs ( sessionFactory ( bm ) ) ;
@@ -274,7 +274,7 @@ describe("GraphQL - Infer Schema nodes basic tests", () => {
274274
275275 const nodeProperties = { str : "testString" , int : neo4j . int ( 42 ) } ;
276276 const wSession = driver . session ( { defaultAccessMode : neo4j . session . WRITE , database : dbName } ) ;
277- await wSession . writeTransaction ( ( tx ) =>
277+ await wSession . executeWrite ( ( tx ) =>
278278 tx . run (
279279 `CREATE (:FullNode {amb: $props.str, str: $props.str})
280280 CREATE (:FullNode {amb: $props.int, str: $props.str})
@@ -284,7 +284,7 @@ describe("GraphQL - Infer Schema nodes basic tests", () => {
284284 { props : nodeProperties }
285285 )
286286 ) ;
287- const bm = wSession . lastBookmark ( ) ;
287+ const bm = wSession . lastBookmarks ( ) ;
288288 await wSession . close ( ) ;
289289
290290 const typeDefs = await toGraphQLTypeDefs ( sessionFactory ( bm ) ) ;
@@ -307,10 +307,10 @@ describe("GraphQL - Infer Schema nodes basic tests", () => {
307307 }
308308
309309 const wSession = driver . session ( { defaultAccessMode : neo4j . session . WRITE , database : dbName } ) ;
310- await wSession . writeTransaction ( ( tx ) =>
310+ await wSession . executeWrite ( ( tx ) =>
311311 tx . run ( "CREATE ({prop: 1}) CREATE ({prop: 2}) CREATE (:EmptyNode) CREATE (:FullNode {prop: 1})" )
312312 ) ;
313- const bm = wSession . lastBookmark ( ) ;
313+ const bm = wSession . lastBookmarks ( ) ;
314314 await wSession . close ( ) ;
315315
316316 const typeDefs = await toGraphQLTypeDefs ( sessionFactory ( bm ) ) ;
@@ -333,8 +333,8 @@ describe("GraphQL - Infer Schema nodes basic tests", () => {
333333 }
334334
335335 const wSession = driver . session ( { defaultAccessMode : neo4j . session . WRITE , database : dbName } ) ;
336- await wSession . writeTransaction ( ( tx ) => tx . run ( "CREATE (:EmptyNode)-[:RELATIONSHIP]->(:FullNode {prop: 1})" ) ) ;
337- const bm = wSession . lastBookmark ( ) ;
336+ await wSession . executeWrite ( ( tx ) => tx . run ( "CREATE (:EmptyNode)-[:RELATIONSHIP]->(:FullNode {prop: 1})" ) ) ;
337+ const bm = wSession . lastBookmarks ( ) ;
338338 await wSession . close ( ) ;
339339
340340 const typeDefs = await toGraphQLTypeDefs ( sessionFactory ( bm ) ) ;
@@ -363,14 +363,14 @@ describe("GraphQL - Infer Schema nodes basic tests", () => {
363363
364364 const nodeProperties = { first : "testString" , second : neo4j . int ( 42 ) } ;
365365 const wSession = driver . session ( { defaultAccessMode : neo4j . session . WRITE , database : dbName } ) ;
366- await wSession . writeTransaction ( ( tx ) =>
366+ await wSession . executeWrite ( ( tx ) =>
367367 tx . run (
368368 `CREATE (:TestLabel {strProp: $props.first})
369369 CREATE (:TestLabel2:TestLabel3 {singleProp: $props.second})` ,
370370 { props : nodeProperties }
371371 )
372372 ) ;
373- const bm = wSession . lastBookmark ( ) ;
373+ const bm = wSession . lastBookmarks ( ) ;
374374 await wSession . close ( ) ;
375375
376376 const typeDefs = await toGraphQLTypeDefs ( sessionFactory ( bm ) , true ) ;
0 commit comments