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
In case A, resolver does not depend on REST API directly.
It is very simple, requiring only a minimal exchange of arguments.
However, as the number of requests from the resolver increases, other methods will be created one after another, and the integration with the resolver will become more complex.
In the case of B, it reflects the specification of the REST API as it is, so it is very versatile and consistent, and resolver is almost guaranteed to use this method.
However, the resolver may have to generate parameters and validate the response separately to use it.
I think A is the recommended one, but I thought it is worth considering to transfer certain processes to each resolver as much as possible for long-term maintenance.
I would like to hear your recommendation as Apollo framework and your personal opinion as well.
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
-
The data source documentation clearly states that it is a layer for encapsulation.
My question is whether the resources interface (e.g. REST API I/O) should be confined in the datasource layer or requested to the resolver layer.
In case A, resolver does not depend on REST API directly.
It is very simple, requiring only a minimal exchange of arguments.
However, as the number of requests from the resolver increases, other methods will be created one after another, and the integration with the resolver will become more complex.
In the case of B, it reflects the specification of the REST API as it is, so it is very versatile and consistent, and resolver is almost guaranteed to use this method.
However, the resolver may have to generate parameters and validate the response separately to use it.
I think A is the recommended one, but I thought it is worth considering to transfer certain processes to each resolver as much as possible for long-term maintenance.
I would like to hear your recommendation as Apollo framework and your personal opinion as well.
Beta Was this translation helpful? Give feedback.
All reactions