Skip to content

feat: JWTExtendContextFields should receive generics #301

Closed
@jjangga0214

Description

@jjangga0214

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions