-
Notifications
You must be signed in to change notification settings - Fork 575
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
feat(@graphql-yoga/plugin-jwt): add generics to JWTExtendContextFields
#3529
base: main
Are you sure you want to change the base?
feat(@graphql-yoga/plugin-jwt): add generics to JWTExtendContextFields
#3529
Conversation
|
JWTExtendContextFields
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't making this Record<string, never>
a breaking change?
Because users from previous versions would get an error with regular objects, no?
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.
Yes exactly. This should be Record<string, any>
.
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; |
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.
type ExtendableJwtPayload<T extends Record<string, any> = Record<string, never>> = JwtPayload & T; | |
type ExtendableJwtPayload<T extends Record<string, any> = Record<string, any>> = JwtPayload & T; |
https://github.com/dotansimha/graphql-yoga/pull/3529/files#r1875898366
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 comment
The reason will be displayed to describe this comment to others. Learn more.
export type JWTExtendContextFields<T extends Record<string, any> = Record<string, never>> = { | |
export type JWTExtendContextFields<T extends Record<string, any> = Record<string, any>> = { |
https://github.com/dotansimha/graphql-yoga/pull/3529/files#r1875898366
Refer to graphql-hive/gateway#302