Skip to content

Instantly share code, notes, and snippets.

@tomitrescak
Created July 25, 2018 20:39
Show Gist options
  • Save tomitrescak/2a5a7b1cc5c9bbfa5c57be4ae5ac44b6 to your computer and use it in GitHub Desktop.
Save tomitrescak/2a5a7b1cc5c9bbfa5c57be4ae5ac44b6 to your computer and use it in GitHub Desktop.
import * as Types from './types';
export type Resolver<T> = {
 [U in keyof Partial<typeof Types>]: {
 [P in keyof Partial<T>]: (parent: T, args: any, ctx: Context, info: GraphQLResolveInfo) => any
 }
};
// file: types.ts
import * as Api from './generated/api';
// export one variable of each type
export const Notifications: Api.Notifications;
export const User: Api.User;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment