Skip to content

Pattern around fieldsWithResolvers #799

Answered by kobylynskyi
thisarattr asked this question in Q&A
Discussion options

You must be logged in to vote

@thisarattr thanks for your request.

So is there a way to keep Author object as it in Book or add authorId into book instead, both which can be used to get authorId from BookResolver?

The idea behind removing the field from the POJO (if it is present in fieldsWithResolvers) was that this field will be "resolved" by a separate Resolver method (in your case author method in BookResolver class), and not be taken from the POJO class.
At the first glance, I am ok with keeping the field in the POJO while generating a separate TypeResolver interface.
We need to think about consequences if we remove this filtering:

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
1 reply
@thisarattr
Comment options

Comment options

You must be logged in to vote
4 replies
@thisarattr
Comment options

@kobylynskyi
Comment options

@thisarattr
Comment options

@vlagorce
Comment options

Answer selected by thisarattr
Comment options

You must be logged in to vote
1 reply
@viacheslav-dobrynin
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants