https://kotlinlang.org logo
#apollo-kotlin
Title
# apollo-kotlin
m

Marco Pierucci

11/09/2023, 11:03 AM
👋 Hello hello, very quick one regarding normalised cache. If Im defining fragments on my query do I set the key (@typePolicy) To the fragment or still to the main object?
m

mbonnin

11/09/2023, 11:04 AM
@typePolicy
is only for extending your schema, you can't have it in executable documents like fragments or queries
m

Marco Pierucci

11/09/2023, 11:10 AM
Yeah my question is more is I define
extend type X @typePolicy(keyFields: "id")
On the Object type or on the defined fragment?
(If that makes sense?)
m

mbonnin

11/09/2023, 11:11 AM
fragments do not exist in the schema so you can only extend object types
m

Marco Pierucci

11/09/2023, 11:11 AM
excellent, cristal clear
thanks!
m

mbonnin

11/09/2023, 11:11 AM
sure thing!
2 Views