You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
``I don't think is the best title to explain this.
But suppose that you have 5 queries named A, B, C, D, E.
And the 5 queries returns the same response X.
The thing is that when I am doing the Data Fetcher tests I need to repeat every time the same projection over and over because I don't have any way to make that in a generic way, the only thing that shares whole projections are that extends for BaseProjectionNode, but nothing else.
Here is an example:
query{
findById: MyObject
findByUserName: MyObject
}
type MyObject{
x: String,
y: String
}
Now in DataFetcher I must repeat the same projections in every test:
FindByIdProjectionRoot().x().y()
FindByUserNameProjectionRoot().x().y()
Now imagine that with a big object with a lot of attributes that took like 100 lines of code?
And now imagine that I have 10+ queries returning the same object.
Is a bit painful to do that in all datafetchers and don't have a way to have a super class in there, because the projection is always the same...
I don't know if this is a bug or a new feature, but different projections with same return types must share a super class with all the attributes.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
``I don't think is the best title to explain this.
But suppose that you have 5 queries named A, B, C, D, E.
And the 5 queries returns the same response X.
The thing is that when I am doing the Data Fetcher tests I need to repeat every time the same projection over and over because I don't have any way to make that in a generic way, the only thing that shares whole projections are that extends for BaseProjectionNode, but nothing else.
Here is an example:
Now imagine that with a big object with a lot of attributes that took like 100 lines of code?
And now imagine that I have 10+ queries returning the same object.
Is a bit painful to do that in all datafetchers and don't have a way to have a super class in there, because the projection is always the same...
I don't know if this is a bug or a new feature, but different projections with same return types must share a super class with all the attributes.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions