Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit cb16cb5

Browse files
committed
Move createComplexityRule out of index file #65
1 parent a66211a commit cb16cb5

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

‎src/createComplexityRule.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { ValidationContext } from 'graphql';
2+
import QueryComplexity from './QueryComplexity.js';
3+
import { QueryComplexityOptions } from './QueryComplexity.js';
4+
5+
export function createComplexityRule(
6+
options: QueryComplexityOptions
7+
): (context: ValidationContext) => QueryComplexity {
8+
return (context: ValidationContext): QueryComplexity => {
9+
return new QueryComplexity(context, options);
10+
};
11+
}

‎src/index.ts

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
11
/**
22
* Created by Ivo Meißner on 28.07.17.
3-
*
4-
* @flow
53
*/
6-
import { ValidationContext } from 'graphql';
7-
import QueryComplexity from './QueryComplexity.js';
8-
import { QueryComplexityOptions } from './QueryComplexity.js';
94

105
export * from './estimators/index.js';
116
export * from './QueryComplexity.js';
7+
import { createComplexityRule as createComplexityRuleFn } from './createComplexityRule.js';
128

13-
export function createComplexityRule(
14-
options: QueryComplexityOptions
15-
): (context: ValidationContext) => QueryComplexity {
16-
return (context: ValidationContext): QueryComplexity => {
17-
return new QueryComplexity(context, options);
18-
};
19-
}
20-
9+
export const createComplexityRule = createComplexityRuleFn;
2110
export default createComplexityRule;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /