Validation error of type SubSelectionRequired: Sub selection required for type Timestamp of field
See original GitHub issueI use GraphQL-SPQR Library The problem is “Validation error of type SubSelectionRequired: Sub selection required for type Timestamp” Maybe there is expression in query for timestamp or format in Entity
`{“query”: “{findUserPointByUserId(userId:73){rowNum userAccountPointUserId totalPoint pointTypeDescription point userAccountCreatedDate} findUserAccountImgByUserId(userId:73){imageId,userId,presentImgNum}}”
}`
Error
{ "errors": [ { "message": "Validation error of type SubSelectionRequired: Sub selection required for type Timestamp of field userAccountCreatedDate", "locations": [ { "line": 1, "column": 103 } ] } ] }
Entity
`public class ViewUserAccountPoint { @Id @Basic @GraphQLQuery(name = “rowNum”) @Column(name = “row_num”, nullable = true) private Long rowNum;
@Basic
@Column(name = "user_account_point_userid", nullable = true)
@GraphQLQuery(name = "userAccountPointUserId")
private Integer userAccountPointUserId;
@Basic
@Column(name = "subject_id", nullable = true)
@GraphQLQuery(name = "subjectId")
private Integer subjectId;
@Basic
@Column(name = "point", nullable = true)
@GraphQLQuery(name = "point")
private Integer point;
@Basic
@Column(name = "user_account_point_typeid", nullable = true)
@GraphQLQuery(name = "userAccountPointTypeId")
private Integer userAccountPointTypeId;
@Basic
@Column(name = "date_created", nullable = true)
@GraphQLQuery(name = "userAccountCreatedDate")
private Timestamp userAccountCreatedDate;`
I use @GraphQLQuery is there annotation for timestamp format??
Service
public List<ViewUserAccountPoint> findUserPointByUserId(@GraphQLArgument(name = "userId") Integer userId){ return viewUserAccountPointRepository.findByUserAccountPointUserIdOrderByUserAccountCreatedDateDesc(userId); }
I search through all query timestamp format However, i couldn’t find hope to hear the solution. thank you
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (4 by maintainers)
The timestamp object is treated as an object/entity and it does not have any (exposed) members; that’s why.
You either need to expose members within the Timestamp object, or create and register a custom TypeMapper that convert between your Timestamp types and a scalar like an integer (so in your schema the ViewUserAccountPoint entity has an userAccountCreatedDate which is an integer).
I’ll close this one since there’s no feedback and it seems sufficiently addressed. If you have further questions, feel free to reopen.