feat(@graphql-yoga/plugin-jwt): add generics to JWTExtendContextFields#3529
feat(@graphql-yoga/plugin-jwt): add generics to JWTExtendContextFields#3529jjangga0214 wants to merge 2 commits into
JWTExtendContextFields#3529Conversation
|
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.
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.
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.
| 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.
| 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
Ref GW-29
Refer to graphql-hive/gateway#302