Skip to content

Commit 6f1f640

Browse files
committed
fix tests
1 parent 4669734 commit 6f1f640

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ export interface FGraphQLHookOptions {
237237
schema: string;
238238
resolvers: FGraphQLResolverMap | FGraphQLResolverMapFactory;
239239
query: Query | SyncContextFunction<Query>;
240-
options: FGraphQLOptions;
240+
options?: FGraphQLOptions;
241241
runTime: any;
242242
parse: typeof parse;
243243
}

types/tests.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ import {
6363
validate,
6464
validateSchema,
6565
when,
66-
FGraphqlOptions,
66+
FGraphQLHookOptions,
6767
} from 'feathers-hooks-common';
6868
import ajv = require('ajv');
6969
import { parse } from 'graphql';
@@ -219,7 +219,7 @@ fastJoin(ctx => postResolvers);
219219
fastJoin(postResolvers);
220220

221221
// used from https://github.com/feathers-plus/hooks-graphql-example
222-
const fgraphqlOptions: FGraphqlOptions = {
222+
const fgraphqlOptions: FGraphQLHookOptions = {
223223
parse,
224224
runTime: null,
225225
schema: ``,
@@ -242,7 +242,7 @@ const fgraphqlOptions: FGraphqlOptions = {
242242
// $ExpectType Hook
243243
fgraphql(fgraphqlOptions);
244244

245-
const fgraphqlOptions2: FGraphqlOptions = {
245+
const fgraphqlOptions2: FGraphQLHookOptions = {
246246
...fgraphqlOptions,
247247
query: (context: HookContext) => ({
248248
posts: {},
@@ -257,6 +257,14 @@ const fgraphqlOptions2: FGraphqlOptions = {
257257
likes: () => ({}),
258258
},
259259
Query: {}
260+
},
261+
options: {
262+
extraAuthProps: ['asdf' ],
263+
inclAllFields: false,
264+
inclJoinedNames: false,
265+
inclAllFieldsClient: true,
266+
inclAllFieldsServer: true,
267+
skipHookWhen: (context) => { context.data; return false}
260268
}
261269
};
262270
// $ExpectType Hook

0 commit comments

Comments
 (0)