Skip to content

Commit 4669734

Browse files
committed
update names and fix the options property
1 parent b4d2cf3 commit 4669734

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

types/index.d.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,9 @@ export interface ResolverMap<T> {
212212
*/
213213
export function fastJoin(resolvers: ResolverMap<any> | SyncContextFunction<ResolverMap<any>>, query?: Query | SyncContextFunction<Query>): Hook;
214214

215-
export type ResolversFunction = (app: Application, runtime: any) => ResolversObject;
215+
export type FGraphQLResolverMapFactory = (app: Application, runtime: any) => FGraphQLResolverMap;
216216

217-
export interface ResolversObject {
217+
export interface FGraphQLResolverMap {
218218
[i: string]: {
219219
[i: string]: (parent: any, args: any, content: any, ast: any) => any;
220220
};
@@ -223,17 +223,21 @@ export interface ResolversObject {
223223
};
224224
}
225225

226-
export interface FGraphqlOptions {
227-
recordType: string;
228-
schema: string;
229-
resolvers: ResolversObject | ResolversFunction;
230-
query: Query | SyncContextFunction<Query>;
226+
export interface FGraphQLOptions {
231227
skipHookWhen?: SyncContextFunction<boolean>;
232228
inclAllFieldsServer?: boolean;
233229
inclAllFieldsClient?: boolean;
234230
inclAllFields?: boolean;
235231
inclJoinedNames?: boolean;
236232
extraAuthProps?: string[];
233+
}
234+
235+
export interface FGraphQLHookOptions {
236+
recordType: string;
237+
schema: string;
238+
resolvers: FGraphQLResolverMap | FGraphQLResolverMapFactory;
239+
query: Query | SyncContextFunction<Query>;
240+
options: FGraphQLOptions;
237241
runTime: any;
238242
parse: typeof parse;
239243
}
@@ -242,7 +246,7 @@ export interface FGraphqlOptions {
242246
* Generate Graphql Resolvers for services
243247
* {@link https://medium.com/@eddyystop/38faee75dd1}
244248
*/
245-
export function fgraphql(options?: FGraphqlOptions): Hook;
249+
export function fgraphql(options?: FGraphQLHookOptions): Hook;
246250

247251
/**
248252
* Return a property value from an object using dot notation, e.g. address.city. (Utility function.)

0 commit comments

Comments
 (0)