Skip to content

Commit 101172e

Browse files
committed
move type to types
1 parent 14563b2 commit 101172e

File tree

2 files changed

+25
-23
lines changed

2 files changed

+25
-23
lines changed

packages/utils/src/prune.ts

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ import {
1414
isInputObjectType,
1515
} from 'graphql';
1616

17+
import { PruneSchemaOptions } from './types';
18+
1719
import { mapSchema } from './mapSchema';
1820
import { MapperKind } from './Interfaces';
1921

@@ -31,29 +33,6 @@ interface PruningContext {
3133
implementations: Record<string, Record<string, boolean>>;
3234
}
3335

34-
/**
35-
* Options for removing unused types from the schema
36-
*/
37-
export interface PruneSchemaOptions {
38-
/**
39-
* Set to `true` to skip pruning object types or interfaces with no no fields
40-
*/
41-
skipEmptyCompositeTypePruning?: boolean;
42-
/**
43-
* Set to `true` to skip pruning interfaces that are not implemented by any
44-
* other types
45-
*/
46-
skipUnimplementedInterfacesPruning?: boolean;
47-
/**
48-
* Set to `true` to skip pruning empty unions
49-
*/
50-
skipEmptyUnionPruning?: boolean;
51-
/**
52-
* Set to `true` to skip pruning unused types
53-
*/
54-
skipUnusedTypesPruning?: boolean;
55-
}
56-
5736
/**
5837
* Prunes the provided schema, removing unused and empty types
5938
* @param schema The schema to prune

packages/utils/src/types.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,26 @@ export interface SchemaPrintOptions {
1313
export type Maybe<T> = null | undefined | T;
1414

1515
export type Constructor<T> = new (...args: any[]) => T;
16+
17+
/**
18+
* Options for removing unused types from the schema
19+
*/
20+
export interface PruneSchemaOptions {
21+
/**
22+
* Set to `true` to skip pruning object types or interfaces with no no fields
23+
*/
24+
skipEmptyCompositeTypePruning?: boolean;
25+
/**
26+
* Set to `true` to skip pruning interfaces that are not implemented by any
27+
* other types
28+
*/
29+
skipUnimplementedInterfacesPruning?: boolean;
30+
/**
31+
* Set to `true` to skip pruning empty unions
32+
*/
33+
skipEmptyUnionPruning?: boolean;
34+
/**
35+
* Set to `true` to skip pruning unused types
36+
*/
37+
skipUnusedTypesPruning?: boolean;
38+
}

0 commit comments

Comments
 (0)