rescript-apollo-client icon indicating copy to clipboard operation
rescript-apollo-client copied to clipboard

Add toReference to fieldPolicies

Open jfrolich opened this issue 4 years ago • 2 comments

This works, but you might have ideas how to implement this, don't know if this fits well in the architecture?

jfrolich avatar Jun 03 '21 06:06 jfrolich

Awesome. The typescript type is StoreObject | string | Reference. Is { __typename, id } that you're using here the StoreObject? It has this definition:

export interface StoreObject {
    __typename?: string;
    [storeFieldName: string]: StoreValue;
}

I guess I'd just want to account for the other options as I have no idea when they are relevant. Is id definitely always present?

jeddeloh avatar Jun 05 '21 17:06 jeddeloh

Hmm yes. Let me look into this to make the types more correct!

jfrolich avatar Jun 07 '21 02:06 jfrolich