Exposed gql context initialization

graph-rework-2
noah metz 2023-07-01 13:41:38 -06:00
parent c2d09a07e3
commit b7a7d509e6
2 changed files with 4 additions and 4 deletions

@ -195,8 +195,8 @@ func LoadNodeRecurse(ctx * GraphContext, id NodeID, loaded_nodes map[NodeID]Grap
return node, nil return node, nil
} }
func NewGraphContext(db * badger.DB, log Logger) * GraphContext { func NewGraphContext(db * badger.DB, log Logger, types TypeList, type_map ObjTypeMap, queries FieldMap, subscriptions FieldMap, mutations FieldMap) * GraphContext {
gql, err := NewGQLContext(TypeList{}, ObjTypeMap{}, FieldMap{}, FieldMap{}, FieldMap{}) gql, err := NewGQLContext(types, type_map, queries, subscriptions, mutations)
if err != nil { if err != nil {
panic(err) panic(err)
} }

@ -58,7 +58,7 @@ func logTestContext(t * testing.T, components []string) * GraphContext {
t.Fatal(err) t.Fatal(err)
} }
return NewGraphContext(db, NewConsoleLogger(components)) return NewGraphContext(db, NewConsoleLogger(components), TypeList{}, ObjTypeMap{}, FieldMap{}, FieldMap{}, FieldMap{})
} }
func testContext(t * testing.T) * GraphContext { func testContext(t * testing.T) * GraphContext {
@ -67,7 +67,7 @@ func testContext(t * testing.T) * GraphContext {
t.Fatal(err) 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) { func fatalErr(t * testing.T, err error) {