Skip to content

Commit 25d1c67

Browse files
committed
Add initial types for fgraphql
1 parent 08bcb91 commit 25d1c67

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
"@feathersjs/socketio": "^3.2.2",
7070
"@feathersjs/socketio-client": "^1.1.0",
7171
"@types/feathersjs__feathers": "^3.0.4",
72+
"@types/graphql": "^14.0.3",
7273
"chai": "^4.1.2",
7374
"clone": "^2.1.1",
7475
"coveralls": "^3.0.0",

types/index.d.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import { Hook, HookContext, Params, Query, Paginated } from '@feathersjs/feathers';
44
import * as ajv from 'ajv';
5+
import { GraphQLSchema } from 'graphql';
56

67
export type HookType = 'before' | 'after' | 'error';
78
export type MethodName = 'find' | 'create' | 'get' | 'update' | 'patch' | 'remove';
@@ -198,6 +199,42 @@ export interface ResolverMap<T> {
198199
*/
199200
export function fastJoin(resolvers: ResolverMap<any> | SyncContextFunction<ResolverMap<any>>, query?: Query | SyncContextFunction<Query>): Hook;
200201

202+
interface IFGraphqlOptions {
203+
parse: (schema: any /* GraphqlSchema */) => any;
204+
recordType: string;
205+
resolvers: (app: any /* App */, runtime: any) => ResolverMap<any>;
206+
schema: GraphQLSchema;
207+
query: any /* Query? */;
208+
runTime: any;
209+
skipHookWhen?: Hook,
210+
/**
211+
* @default true
212+
*/
213+
inclAllFieldsServer?: boolean,
214+
/**
215+
* @default true
216+
*/
217+
inclAllFieldsClient?: boolean,
218+
219+
/**
220+
* @default null
221+
*/
222+
inclAllFields?: Hook,
223+
/**
224+
* @default true
225+
*/
226+
inclJoinedNames?: boolean,
227+
/**
228+
* @default []
229+
*/
230+
extraAuthProps?: string[]
231+
}
232+
233+
/**
234+
* fgraphql hook
235+
*/
236+
export function fgraphql(options: IFGraphqlOptions): Hook;
237+
201238
/**
202239
* Return a property value from an object using dot notation, e.g. address.city. (Utility function.)
203240
* {@link https://feathers-plus.github.io/v1/feathers-hooks-common/index.html#GetByDot}

0 commit comments

Comments
 (0)