From b7a7d509e64cb893322d45e7c944840b4624bbf7 Mon Sep 17 00:00:00 2001 From: Noah Metz Date: Sat, 1 Jul 2023 13:41:38 -0600 Subject: [PATCH] Exposed gql context initialization --- graph.go | 4 ++-- graph_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/graph.go b/graph.go index f4319ba..7619fc1 100644 --- a/graph.go +++ b/graph.go @@ -195,8 +195,8 @@ func LoadNodeRecurse(ctx * GraphContext, id NodeID, loaded_nodes map[NodeID]Grap return node, nil } -func NewGraphContext(db * badger.DB, log Logger) * GraphContext { - gql, err := NewGQLContext(TypeList{}, ObjTypeMap{}, FieldMap{}, FieldMap{}, FieldMap{}) +func NewGraphContext(db * badger.DB, log Logger, types TypeList, type_map ObjTypeMap, queries FieldMap, subscriptions FieldMap, mutations FieldMap) * GraphContext { + gql, err := NewGQLContext(types, type_map, queries, subscriptions, mutations) if err != nil { panic(err) } diff --git a/graph_test.go b/graph_test.go index 844c85a..9673995 100644 --- a/graph_test.go +++ b/graph_test.go @@ -58,7 +58,7 @@ func logTestContext(t * testing.T, components []string) * GraphContext { t.Fatal(err) } - return NewGraphContext(db, NewConsoleLogger(components)) + return NewGraphContext(db, NewConsoleLogger(components), TypeList{}, ObjTypeMap{}, FieldMap{}, FieldMap{}, FieldMap{}) } func testContext(t * testing.T) * GraphContext { @@ -67,7 +67,7 @@ func testContext(t * testing.T) * GraphContext { t.Fatal(err) } - return NewGraphContext(db, NewConsoleLogger([]string{})) + return NewGraphContext(db, NewConsoleLogger([]string{}), TypeList{}, ObjTypeMap{}, FieldMap{}, FieldMap{}, FieldMap{}) } func fatalErr(t * testing.T, err error) {