You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My luck that this is not maintained anymore.... :/
If anyone would be able to assist it would be great:
//subscribing to this endpoint:
subscription Subscription {
organizationsChanged {
id
}
}
results in organizationsChanged to be null:
// Response received at 23:24:00
{
"data": {
"organizationsChanged": null
}
}
// Response received at 23:23:59
{
"data": {
"organizationsChanged": null
}
}
// Response received at 23:23:58
{
"data": {
"organizationsChanged": null
}
}
Project setup is as follows:
//schema.ts
type Subscription {
organizationsChanged: testObject
}
type testObject {
id: String
}
//resolver
Subscription: {
// get all tracks, will be used to populate the homepage grid of our web client
organizationsChanged: {
subscribe: () => pubsub.asyncIterator(["ORGANISATION_CHANGED2"]),
},
},
//init
import { GooglePubSub } from '@axelspringer/graphql-google-pubsub';
// SETUP subscriptions
function commonMessageHandler (payload:any) {
console.log(payload.id); /// get the correct data from publish here - whohoo!
return {
id: payload.id
}
}
const pubsub = new GooglePubSub({
projectId: 'PROJECT_ID',
credentials:{
client_email: 'SERV_ACC_EMAIL,
private_key: "THE_KEY"
}
}, topicName => `ORGANISATION_CHANGED2`, commonMessageHandler)
}
Life changing.. After 3 days of scratching my head and trying all possible tricks to figure out why "null" was returned.. This was the answer and now it is working as expected.
Hi there,
My luck that this is not maintained anymore.... :/
If anyone would be able to assist it would be great:
results in organizationsChanged to be null:
Project setup is as follows:
The text was updated successfully, but these errors were encountered: