question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Validation error of type SubSelectionRequired: Sub selection required for type Timestamp of field

See original GitHub issue

I 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:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
codelizrdcommented, May 2, 2019

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).

0reactions
kaqqaocommented, May 21, 2019

I’ll close this one since there’s no feedback and it seems sufficiently addressed. If you have further questions, feel free to reopen.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sub selection required for type null of field - Stack Overflow
I am working on a graphql issue where I am getting following error for the request { customer(id ...
Read more >
graphql.validation.rules.ScalarLeafs.getValidationContext ...
public void checkField(Field field) { GraphQLOutputType type ... String message = String.format("Sub selection required for type %s of field %s", type.
Read more >
validation error of type fieldundefined graphql
When requesting a field that resolves to an object type (or a list of an object type), you have to specify the fields...
Read more >
Field x of type y must have a sub selection - Questions
Hi guys, I'm new to GraphQL and Prisma and I'm trying to understand this error: I'm executing this code in my application server...
Read more >
腾讯云开发者社区-腾讯云
... lastName carsInterested } } "message": "Validation error of type SubSelectionRequired: Sub selection required for type null of field ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found