ExplicitGraphQLContext
Type Alias: ExplicitGraphQLContext
ExplicitGraphQLContext =
object
Defined in: src/graphql/context.ts:41
Type of the transport protocol agnostic explicit context object that is merged with the implcit mercurius context object and passed to the graphql resolvers each time they resolve a graphql operation at runtime.
Properties
cookie?
optionalcookie:object
Defined in: src/graphql/context.ts:62
Cookie helper for setting HTTP-Only authentication cookies. Only available for HTTP requests (not WebSocket subscriptions).
clearAuthCookies()
clearAuthCookies: () =>
void
Clears both authentication cookies (for logout).
Returns
void
getRefreshToken()
getRefreshToken: () =>
string|undefined
Gets the refresh token from cookies if present.
Returns
string | undefined
setAuthCookies()
setAuthCookies: (
accessToken,refreshToken) =>void
Sets both access token and refresh token as HTTP-Only cookies.
Parameters
accessToken
string
The JWT access token
refreshToken
string
The refresh token
Returns
void
currentClient
currentClient:
CurrentClient
Defined in: src/graphql/context.ts:42
drizzleClient
drizzleClient:
FastifyInstance["drizzleClient"]
Defined in: src/graphql/context.ts:43
envConfig
envConfig:
Pick<FastifyInstance["envConfig"],"API_ACCOUNT_LOCKOUT_DURATION_MS"|"API_ACCOUNT_LOCKOUT_THRESHOLD"|"API_BASE_URL"|"API_REFRESH_TOKEN_EXPIRES_IN"|"API_COOKIE_DOMAIN"|"API_IS_SECURE_COOKIES"|"API_JWT_EXPIRES_IN"|"FRONTEND_URL">
Defined in: src/graphql/context.ts:44
jwt
jwt:
object
Defined in: src/graphql/context.ts:55
sign()
sign: (
payload) =>string
Parameters
payload
ExplicitAuthenticationTokenPayload
Returns
string
log
log:
FastifyInstance["log"]
Defined in: src/graphql/context.ts:78
minio
minio:
FastifyInstance["minio"]
Defined in: src/graphql/context.ts:79
notification?
optionalnotification:object
Defined in: src/graphql/context.ts:84
Per-request notification helper. Implementations may enqueue notifications for delivery and support flush() to perform delivery after transaction commit.
emitEventCreatedImmediate()?
optionalemitEventCreatedImmediate: (payload,ctx) =>Promise<void>
Parameters
payload
creatorName
string
eventId
string
eventName
string
organizationId
string
organizationName
string
startDate
string
ctx
Returns
Promise<void>
enqueueEventCreated()
enqueueEventCreated: (
payload) =>void
Parameters
payload
creatorName
string
eventId
string
eventName
string
organizationId
string
organizationName
string
startDate
string
Returns
void
enqueueSendEventInvite()
enqueueSendEventInvite: (
payload) =>void
Parameters
payload
eventId?
string
eventName?
string
invitationToken
string
invitationUrl
string
inviteeEmail
string
inviteeName?
string
inviterId
string
organizationId
string
Returns
void
flush()
flush: (
ctx) =>Promise<void>
Parameters
ctx
Returns
Promise<void>