Thanks for releasing this awesome library. I am looking for a way to generate graphql response payload from raw data.
What am doing is to take raw data from database and publish this data to subscribers via graphql subscription websocket. I have a schema like:
type Message {
msg: String!
id: ID!
topic: String!
}
type Mutation {
sendChat(topic: String!, message: String!): ID!
}
type Query {
getChat(id: ID!): String!
}
type Subscription {
# Subscribe to events on the given topic.
event(
# Name of the topic to subscribe to.
on: String!
): Message!
}
when there is a need to publish Message data to subscribers, I will need to convert the raw data: { event: { msg: 'hello', topic: 'xxxx' } } to a payload the Apollo client expects.
Is there a way I can do that by using this library? The payload needs to include the __typename as well.
Thanks for releasing this awesome library. I am looking for a way to generate graphql response payload from raw data. What am doing is to take raw data from database and publish this data to subscribers via graphql subscription websocket. I have a schema like:
when there is a need to publish
Message
data to subscribers, I will need to convert the raw data:{ event: { msg: 'hello', topic: 'xxxx' } }
to a payload the Apollo client expects.Is there a way I can do that by using this library? The payload needs to include the
__typename
as well.