Prisma1: Subscription query fragments

Created on 2 Feb 2018  Â·  3Comments  Â·  Source: prisma/prisma1

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.

bu2-confirmed statupr-welcome bu0-needs-info

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.

All 3 comments

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:

  • Prisma API
  • Subscription Client (subscription-transport-ws, I assume?)
  • Prisma Binding
  • GraphQL Yoga

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sorenbs picture sorenbs  Â·  43Comments

marticrespi picture marticrespi  Â·  34Comments

wereHamster picture wereHamster  Â·  37Comments

marktani picture marktani  Â·  34Comments

pantharshit00 picture pantharshit00  Â·  49Comments