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