Exposed gql context initialization
parent
c2d09a07e3
commit
b7a7d509e6
4
graph.go
4
graph.go
|
|
@ -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) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue