Stylianos Gakis
05/16/2024, 4:47 PMwatch
of one query to be hit if the response from that other query comes in and updates the cache?Stylianos Gakis
05/16/2024, 4:47 PMtype Query {
chat(until: Instant): Chat!
}
type Chat {
id: ID!
messages: [ChatMessage!]!
}
interface ChatMessage {
id: ID!
sender: ChatMessageSender!
}
enum ChatMessageSender {
ONE
TWO
}
And an extra.graphql
like
extend type Chat @typePolicy(keyFields: "id")
extend type ChatMessage @typePolicy(keyFields: "id")
If I got a query like
query NumberOfChatMessages {
chat(until: null) {
messages {
id
sender
}
}
}
And one like
query ChatMessages($until: Instant) {
chat(until: $until) {
id
messages {
...MessageFragment
}
... more here
}
}
fragment MessageFragment on ChatMessage {
id
sender
... more here
}
Stylianos Gakis
05/16/2024, 4:48 PMNumberOfChatMessages
and I was hoping to properly get notified for new information in the cache since I am in some other place polling on ChatMessages(null)
and in turn populating the cache.
But it does not seem to be the case, and I wonder what I am doing wrong. Does anything stand out here on first sight?Stylianos Gakis
05/16/2024, 4:52 PMextend interface ChatMessage @typePolicy(keyFields: "id")
instead of
extend type ChatMessage @typePolicy(keyFields: "id")
I just realized this is looking wrong since I am doing the wrong extend
here? ๐bod
05/16/2024, 4:52 PMbod
05/16/2024, 4:53 PMShould I be doing
extend interface ChatMessage @typePolicy(keyFields: "id")wow definitely
bod
05/16/2024, 4:54 PMextend type
on something that's not a type should probably raise an errorStylianos Gakis
05/16/2024, 4:54 PMStylianos Gakis
05/16/2024, 4:54 PMextra
file is picked up properly in the first place?Stylianos Gakis
05/16/2024, 4:55 PMYeah good idea ๐on something that's not a type should probably raise an errorextend type
bod
05/16/2024, 4:55 PMbod
05/16/2024, 4:55 PMStylianos Gakis
05/16/2024, 4:58 PMStylianos Gakis
05/16/2024, 5:01 PMschemaFiles.setFrom(...
and pass the schema and the extra.graphql directories.
I really don't remember if I had this some time and I accidentally removed it?
Was this always required? I am having an existential crisis here ๐
Stylianos Gakis
05/16/2024, 5:01 PMmbonnin
05/16/2024, 5:03 PM.graphqls
files in src/main/graphql
mbonnin
05/16/2024, 5:04 PM.srcDir()
it should โjustโ workStylianos Gakis
05/16/2024, 5:06 PMStylianos Gakis
05/16/2024, 5:07 PMmbonnin
05/16/2024, 5:08 PMStylianos Gakis
05/17/2024, 6:01 PM