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
import { PubSub, PubSubEngine, Query, Resolver, Root, Subscription } from 'type-graphql';
import { provide } from 'src/app/ioc/container';
@provide(UserQuery)
@Resolver()
export class UserQuery {
` @Subscription({
topics: 'NEW_USER_RECKONING'
})
public currentDate(@Root() payload: any): Date {
console.log('in currentDate');
return new Date();
}
@Query(returns => Boolean, {nullable: true})
public userNewInfo(
@PubSub() pubSub: PubSubEngine): boolean {
console.log('in userNewInfo');
pubSub.publish('NEW_USER_RECKONING', {});
return true;
}
When a subscribe to currentDate in graphiql or in my react native app (using useSubscription of "@apollo/client"), only 'in newUserInfo" is logged and not 'in currentDate'. The clients data are never received after the userNewInfo is queried.
What did I do wrong? Thanks Are you able to make a PR that fix this?
No
Additional context
Version of type-graphql : 1.1.1
I used the package inversify
The server is working inside a docker container
This discussion was converted from issue #1279 on May 13, 2022 13:38.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Describe the issue
Subscription not working .
When a subscribe to currentDate in graphiql or in my react native app (using useSubscription of "@apollo/client"), only 'in newUserInfo" is logged and not 'in currentDate'. The clients data are never received after the userNewInfo is queried.
What did I do wrong? Thanks
Are you able to make a PR that fix this?
No
Additional context
Version of type-graphql : 1.1.1
I used the package inversify
The server is working inside a docker container
Beta Was this translation helpful? Give feedback.
All reactions