Hi all, with prisma client, how to return the enti...
# orm-help
d
Hi all, with prisma client, how to return the entire SubscriptionPayload by example
Copy code
type PostSubscriptionPayload {
  mutation: MutationType!
  node: Post
  updatedFields: [String!]
  previousValues: PostPreviousValues
}
from one subscription like
Copy code
type Subscription {
  posts: PostSubscriptionPayload
}
? I tried this:
Copy code
posts: {
    subscribe: async (parent, args, ctx) => {
      return ctx.prisma.$<http://subscribe.post|subscribe.post>()
    },
    resolve: payload => {
      console.log(payload)
      return payload
    }
  }
But in the resolve function I receive only the mutation Type, all others fields are null, whatever is the mutation type.
n
how does your subscription query look like?
d
Copy code
subscription {
  posts {
    mutation
    node {
      title
    }
    updatedFields
    previousValues {
      title
    }
  }
}
@nilan so have you an idea ?
n
no ๐Ÿ™‚
d
arf ok ๐Ÿคจ