-
Notifications
You must be signed in to change notification settings - Fork 371
Closed
Description
Below is the class I want to create.
@GraphQLIgnore
interface SimpleUserDetails : org.springframework.security.core.userdetails.UserDetails {
@GraphQLIgnore
override fun isAccountNonExpired(): Boolean = true
@GraphQLIgnore
override fun isAccountNonLocked(): Boolean = true
@GraphQLIgnore
override fun isCredentialsNonExpired(): Boolean = true
@GraphQLIgnore
override fun isEnabled(): Boolean = true
}
@Table("users")
data class User(
@Id override val id: ID = ID.Empty,
val email: String,
val name: String?,
val hashSalt: String,
val roles: List<String>,
) : Node, SimpleUserDetails {
fun posts(
@GraphQLIgnore @Autowired postRepository: PostRepository,
env: DataFetchingEnvironment
): CompletableFuture<List<Post>> {
return postRepository.findAllByAuthorId(id, env)
}
@GraphQLIgnore
override fun getUsername(): String = email
@GraphQLIgnore
override fun getPassword(): String = hashSalt
@GraphQLIgnore
override fun getAuthorities(): Collection<GrantedAuthority> = roles.map { SimpleGrantedAuthority(it) }
}Caused by: graphql.schema.validation.InvalidSchemaException: invalid schema:
object type 'User' does not implement interface 'UserDetails' because field 'isEnabled' is missing
object type 'User' does not implement interface 'UserDetails' because field 'getAuthorities' is missing
object type 'User' does not implement interface 'UserDetails' because field 'getPassword' is missing
object type 'User' does not implement interface 'UserDetails' because field 'getUsername' is missing
object type 'User' does not implement interface 'UserDetails' because field 'isAccountNonExpired' is missing
object type 'User' does not implement interface 'UserDetails' because field 'isAccountNonLocked' is missing
object type 'User' does not implement interface 'UserDetails' because field 'isCredentialsNonExpired' is missingMetadata
Metadata
Assignees
Labels
No labels