diff --git a/gql_test.go b/gql_test.go index fff7759..d3d9f35 100644 --- a/gql_test.go +++ b/gql_test.go @@ -242,7 +242,7 @@ func TestGQLServer(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") err := ctx.RegisterNodeType(TestUserNodeType, []ExtType{}) diff --git a/serialize.go b/serialize.go index d144a55..58280e9 100644 --- a/serialize.go +++ b/serialize.go @@ -297,6 +297,15 @@ func DeserializeStruct(info StructInfo)func(*Context, reflect.Type, []byte)(refl 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 } }