apollographql / apollo-feature-requests

🧑‍🚀 Apollo Client Feature Requests | (no 🐛 please).
Other
130 stars 7 forks source link

Add @client support on argument level #432

Open Sachanski opened 8 months ago

Sachanski commented 8 months ago

Hello and thank you for the great project!

I am opening this feature request as a result of this discussion.

What I was basically trying to achieve (and managed to thanks to some invaluable input from @jerelmiller) is to have custom arguments passed only to the type policies of the apollo client and not send them to the server.

After a bit of reading I came accross the @client directive provided by Apollo, however it is applicable only on a field level. What I was basically looking for was applying this directive on an argument.

The solution that @jerelmiller led me to implement works perfectly fine for me, but since he suggested opening a feature request I thought it might be a good idea to share it here as well (if the code snippet I posted helps in any way in the implementation of such a feature - all the better).

Best regards