I've encountered in issue with subscriptions and fragments... If my subscription query relies on a fragment, it doesn't get fired:
const MESSAGES_SUBSCRIPTION = gql`
subscription message($classroomId: ID!) {
message(classroomId: $classroomId) {
node {
id
text
createdAt
sender {
id
name
username
}
# ...ChatMessageMessage
}
}
}
`
// ${ChatMessage.fragments.message}
That same fragment is used successfully on my initial query for all messages.
Thanks for reporting this! I talked to @tfiwm recently who stumbled over a similar situation, but in the end both of us were not able to reproduce it again.
I would typically start by testing "raw" subscriptions against the Prisma endpoint directly, using a script like this. No matter if we can reproduce it at this step or not, we learn a lot for further investigations.
Please share more information about the components you are using, so we can start locating the issue. These are (some) of the potentially involved components:
subscription-transport-ws
, I assume?)Note that a potential work around for now is to avoid using fragments in subscription queries.
Yes, using all of the components above. I will try to test it on the Prisma endpoint directly when I get the chance – for now I am working around it.
Thanks @hoodsy! I'm closing this due to inactivity, and because https://github.com/graphcool/prisma/issues/2026 seemingly provides a reproduction.
Most helpful comment
Yes, using all of the components above. I will try to test it on the Prisma endpoint directly when I get the chance – for now I am working around it.