apollo icon indicating copy to clipboard operation
apollo copied to clipboard

How to use field policies / local only fields

Open rnenjoy opened this issue 1 year ago • 1 comments

Describe the bug Is it possible to use field policies / local only fields with vue-apollo?

https://www.apollographql.com/docs/react/local-state/managing-state-with-field-policies/

Versions vue: vue-apollo: @apollo/client:

Additional context Add any other context about the problem here.

rnenjoy avatar Aug 09 '24 18:08 rnenjoy

@rnenjoy it works exactly as in react, you add fields decorated as @client and resolve them on the client-side cache implementation.

However, I would recommend you keep the queries as-is and use vue's computed to calculate extra data as using @client doesn't allow for any type-generation. If you're not using typescript - it's fine.

nickmessing avatar Aug 27 '24 06:08 nickmessing