-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
メッセージの通知 subscription #200
base: main
Are you sure you want to change the base?
Conversation
…atching into feat/notification
orderBy: { | ||
createdAt: "asc", | ||
}, | ||
orderBy: { id: "asc" }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
createdAtが直感的かなと思ったのですが、変更した理由はなんです?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indexつけるのid
になるので、そっちの方が効率良いかと思いました!(ですよね?) auto incrementなので、これで順序変わることはないはずですし!
const validateOwnership = (profileId: number, post: Post) => { | ||
if (profileId != post.driverId && profileId != post.navigatorId) { | ||
throw new Error("no right to see messages"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good!
@@ -62,3 +62,36 @@ export const context = ({ req }: { req: Request }): Context => { | |||
}, | |||
}; | |||
}; | |||
|
|||
export const contextForWs = async (ctx: any, msg: any, args: any) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wsって何の略ですか?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
web socket ですかね。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ですです
目的
参考
Subscriptions in Apollo Server - Apollo GraphQL Docs