Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/graphql / src / typings.ts
Size: Mime:
import { Request as ExpressRequest, Response as ExpressResponse } from 'express'
import { config, Request as OneRequest } from '@skava/request'
import * as endpoints from './endpoints'
import { DataSources } from 'apollo-server-core/dist/graphqlOptions'
import { DataSource } from 'apollo-datasource'
import { EMPTY_OBJ } from 'exotic'

export interface ExpressRequest extends ExpressRequest {
  isSafe: boolean
}
export interface ExpressResponse extends ExpressResponse {

}

export interface ResolverObj {
  self: any
}
export interface ResolverArgs<Args = any> {
  // @todo remove @any...
  [key: string]: string | number | boolean | ResolverArgs<Args> | Array<ResolverArgs> | undefined | any
}
// meta
export interface ResolverInfo {
  cacheControl: any
  directives: any
}
export type Context = typeof endpoints & {
  req: ExpressRequest
  res: ExpressResponse
  // @note this was in the fork, but this is done in the .prototype hack above
  request: Request
  dataSources: DataSources<Context>
}
export interface ResolverFunction<Type = any> extends Function {
  (obj: ResolverObj, args: ResolverArgs, context: Context, info: ResolverInfo): Promise<Type> | Type
}
export interface ResolverType<Type = any> {
  [key: string]: ResolverFunction
}
export interface ResolverExport<Type = any> {
  Query?: ResolverType<Type>
  Mutation?: ResolverType<Type>
}