Added call to PostDeserialize that I removed by accident

gql_cataclysm
noah metz 2023-10-29 18:43:43 -06:00
parent 84aee24a21
commit 0e8590e22a
2 changed files with 10 additions and 1 deletions

@ -242,7 +242,7 @@ func TestGQLServer(t *testing.T) {
} }
func TestGQLDB(t *testing.T) { func TestGQLDB(t *testing.T) {
ctx := logTestContext(t, []string{"test", "node"}) ctx := logTestContext(t, []string{"test", "serialize", "serialize_types", "deserialize_types", "node"})
TestUserNodeType := NewNodeType("TEST_USER") TestUserNodeType := NewNodeType("TEST_USER")
err := ctx.RegisterNodeType(TestUserNodeType, []ExtType{}) err := ctx.RegisterNodeType(TestUserNodeType, []ExtType{})

@ -297,6 +297,15 @@ func DeserializeStruct(info StructInfo)func(*Context, reflect.Type, []byte)(refl
field_reflect.Set(field_value) field_reflect.Set(field_value)
} }
if info.PostDeserialize == true {
post_deserialize_method := struct_value.Addr().Method(info.PostDeserializeIdx)
results := post_deserialize_method.Call([]reflect.Value{reflect.ValueOf(ctx)})
err_if := results[0].Interface()
if err_if != nil {
return reflect.Value{}, nil, err_if.(error)
}
}
return struct_value, data, nil return struct_value, data, nil
} }
} }