-
Notifications
You must be signed in to change notification settings - Fork 575
feat(@graphql-yoga/plugin-jwt): add generics to JWTExtendContextFields
#3529
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -6,8 +6,12 @@ import '@whatwg-node/server-plugin-cookies'; | |||||
import { GraphQLError } from 'graphql'; | ||||||
import { badRequestError, unauthorizedError } from './utils.js'; | ||||||
|
||||||
export type JWTExtendContextFields = { | ||||||
payload: JwtPayload; | ||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||||||
type ExtendableJwtPayload<T extends Record<string, any> = Record<string, never>> = JwtPayload & T; | ||||||
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||||||
export type JWTExtendContextFields<T extends Record<string, any> = Record<string, never>> = { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Isn't making this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes exactly. This should be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
https://github.com/dotansimha/graphql-yoga/pull/3529/files#r1875898366 |
||||||
payload: ExtendableJwtPayload<T>; | ||||||
token: { | ||||||
value: string; | ||||||
prefix?: string; | ||||||
|
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.
https://github.com/dotansimha/graphql-yoga/pull/3529/files#r1875898366