Skip to content

Commit

Permalink
feat(@gabliam/graphql): add GraphQLMapFieldResolver interface
Browse files Browse the repository at this point in the history
  • Loading branch information
eyolas committed Oct 18, 2017
1 parent d59fdab commit 3b4f267
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/graphql/src/controllers/photoController.ts
Expand Up @@ -2,6 +2,7 @@ import {
GraphqlController,
QueryResolver,
GraphQLFieldResolver,
interfaces,
MutationResolver,
Resolver
} from '@gabliam/graphql';
Expand All @@ -25,7 +26,7 @@ export class PhotoController {
@Resolver({
path: 'Photo'
})
photoResolver() {
photoResolver(): interfaces.GraphQLMapFieldResolver {
return {
id(value: any, args: any, context: any) {
console.log('id here', value);
Expand Down
5 changes: 5 additions & 0 deletions packages/graphql/src/interfaces/interfaces.ts
@@ -1,5 +1,6 @@
import { inversifyInterfaces } from '@gabliam/core';
import * as GraphiQL from 'graphql-server-module-graphiql';
import { GraphQLFieldResolver } from 'graphql';

export type listControllers = inversifyInterfaces.ServiceIdentifier<any>[];

Expand All @@ -25,3 +26,7 @@ export interface GraphqlConfig {

graphiqlEnabled: boolean;
}

export interface GraphQLMapFieldResolver<TSource = any, TContext = any> {
[FieldName: string]: GraphQLFieldResolver<TSource, TContext>;
}

0 comments on commit 3b4f267

Please sign in to comment.