fixed user TypeOf

graph-rework-2
noah metz 2023-07-21 18:09:13 -06:00
parent e51e823b19
commit e59b4f57fd
1 changed files with 2 additions and 13 deletions

@ -63,19 +63,8 @@ var GQLTypeUser = NewSingleton(func() *graphql.Object {
GQLInterfaceLockable.Type,
},
IsTypeOf: func(p graphql.IsTypeOfParams) bool {
ctx, ok := p.Context.Value("graph_context").(*Context)
if ok == false {
return false
}
lockable_type := ctx.GQL.LockableType
value_type := reflect.TypeOf(p.Value)
if value_type.Implements(lockable_type) {
return true
}
return false
_, ok := p.Value.(*User)
return ok
},
Fields: graphql.Fields{},
})