Skip to content
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: JWTExtendContextFields should receive generics #301

Closed
jjangga0214 opened this issue Dec 9, 2024 · 1 comment
Closed

feat: JWTExtendContextFields should receive generics #301

jjangga0214 opened this issue Dec 9, 2024 · 1 comment

Comments

@jjangga0214
Copy link

Hi!

I have a yoga subgraph.
I decode JWT payload from the gateway, and the subgraph consumes it as context.

import { YogaInitialContext } from 'graphql-yoga'
import { JWTExtendContextFields } from '@graphql-hive/gateway'

export interface GraphQLContext extends YogaInitialContext {
  jwt: JWTExtendContextFields
}

And JWTExtendContextFields is declared like this.

export type JWTExtendContextFields = {
  payload: JwtPayload;
  token: {
      value: string;
      prefix?: string;
  };
};

The problem is JwtPayload is fixed.

@jjangga0214
Copy link
Author

jjangga0214 commented Dec 10, 2024

Close as duplicated.
(Go to #302)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant