Skip to content

Commit 5d0c2f3

Browse files
committed
Revert DirectiveArgument
1 parent 13ef6fe commit 5d0c2f3

File tree

6 files changed

+9
-42
lines changed

6 files changed

+9
-42
lines changed

src/index.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,6 @@ export {
146146
GraphQLSchemaExtensions,
147147
GraphQLDirectiveConfig,
148148
GraphQLDirectiveExtensions,
149-
GraphQLDirectiveArgument,
150-
GraphQLDirectiveArgumentConfig,
151149
GraphQLArgument,
152150
GraphQLArgumentConfig,
153151
GraphQLArgumentExtensions,

src/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,6 @@ export type {
145145
GraphQLDirectiveConfig,
146146
GraphQLArgument,
147147
GraphQLArgumentConfig,
148-
GraphQLDirectiveArgument,
149-
GraphQLDirectiveArgumentConfig,
150148
GraphQLInputValue,
151149
GraphQLInputValueConfig,
152150
GraphQLEnumTypeConfig,

src/type/directives.d.ts

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { ObjMap } from '../jsutils/ObjMap';
77
import { DirectiveDefinitionNode } from '../language/ast';
88
import { DirectiveLocationEnum } from '../language/directiveLocation';
99

10-
import { GraphQLInputValue, GraphQLInputValueConfig } from './definition';
10+
import { GraphQLArgument, GraphQLArgumentConfig } from './definition';
1111

1212
/**
1313
* Test if the given value is a GraphQL directive.
@@ -37,14 +37,14 @@ export class GraphQLDirective {
3737
description: Maybe<string>;
3838
locations: Array<DirectiveLocationEnum>;
3939
isRepeatable: boolean;
40-
args: Array<GraphQLDirectiveArgument>;
40+
args: Array<GraphQLArgument>;
4141
extensions: Maybe<Readonly<GraphQLDirectiveExtensions>>;
4242
astNode: Maybe<DirectiveDefinitionNode>;
4343

4444
constructor(config: Readonly<GraphQLDirectiveConfig>);
4545

4646
toConfig(): GraphQLDirectiveConfig & {
47-
args: ObjMap<GraphQLDirectiveArgumentConfig>;
47+
args: ObjMap<GraphQLArgumentConfig>;
4848
isRepeatable: boolean;
4949
extensions: Maybe<Readonly<GraphQLDirectiveExtensions>>;
5050
};
@@ -59,29 +59,12 @@ export interface GraphQLDirectiveConfig {
5959
name: string;
6060
description?: Maybe<string>;
6161
locations: Array<DirectiveLocationEnum>;
62-
args?: Maybe<ObjMap<GraphQLDirectiveArgumentConfig>>;
62+
args?: Maybe<ObjMap<GraphQLArgumentConfig>>;
6363
isRepeatable?: Maybe<boolean>;
6464
extensions?: Maybe<Readonly<GraphQLDirectiveExtensions>>;
6565
astNode?: Maybe<DirectiveDefinitionNode>;
6666
}
6767

68-
/**
69-
* Custom extensions
70-
*
71-
* @remarks
72-
* Use a unique identifier name for your extension, for example the name of
73-
* your library or project. Do not use a shortened identifier as this increases
74-
* the risk of conflicts. We recommend you add at most one extension field,
75-
* an object which can contain all the values you need.
76-
*/
77-
export interface GraphQLDirectiveArgumentExtensions {
78-
[attributeName: string]: unknown;
79-
}
80-
81-
export type GraphQLDirectiveArgument = GraphQLInputValue<GraphQLDirectiveArgumentExtensions>;
82-
83-
export type GraphQLDirectiveArgumentConfig = GraphQLInputValueConfig<GraphQLDirectiveArgumentExtensions>;
84-
8568
/**
8669
* Used to conditionally include fields or fragments.
8770
*/

src/type/directives.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import type { DirectiveDefinitionNode } from '../language/ast';
1414
import type { DirectiveLocationEnum } from '../language/directiveLocation';
1515
import { DirectiveLocation } from '../language/directiveLocation';
1616

17-
import type { GraphQLInputValue, GraphQLInputValueConfig } from './definition';
17+
import type { GraphQLArgument, GraphQLArgumentConfig } from './definition';
1818
import { GraphQLString, GraphQLBoolean } from './scalars';
1919
import {
2020
defineInputValue,
@@ -50,7 +50,7 @@ export class GraphQLDirective {
5050
name: string;
5151
description: ?string;
5252
locations: Array<DirectiveLocationEnum>;
53-
args: $ReadOnlyArray<GraphQLDirectiveArgument>;
53+
args: $ReadOnlyArray<GraphQLArgument>;
5454
isRepeatable: boolean;
5555
extensions: ?ReadOnlyObjMap<mixed>;
5656
astNode: ?DirectiveDefinitionNode;
@@ -106,29 +106,23 @@ export class GraphQLDirective {
106106
}
107107
}
108108

109-
export type GraphQLDirectiveArgument = GraphQLInputValue;
110-
111109
export type GraphQLDirectiveConfig = {|
112110
name: string,
113111
description?: ?string,
114112
locations: Array<DirectiveLocationEnum>,
115-
args?: ?GraphQLDirectiveConfigArgumentMap,
113+
args?: ?ObjMap<GraphQLArgumentConfig>,
116114
isRepeatable?: ?boolean,
117115
extensions?: ?ReadOnlyObjMapLike<mixed>,
118116
astNode?: ?DirectiveDefinitionNode,
119117
|};
120118

121119
type GraphQLDirectiveNormalizedConfig = {|
122120
...GraphQLDirectiveConfig,
123-
args: GraphQLDirectiveConfigArgumentMap,
121+
args: ObjMap<GraphQLArgumentConfig>,
124122
isRepeatable: boolean,
125123
extensions: ?ReadOnlyObjMap<mixed>,
126124
|};
127125

128-
type GraphQLDirectiveConfigArgumentMap = ObjMap<GraphQLDirectiveArgumentConfig>;
129-
130-
export type GraphQLDirectiveArgumentConfig = GraphQLInputValueConfig;
131-
132126
/**
133127
* Used to conditionally include fields or fragments.
134128
*/

src/type/index.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@ export {
126126
assertDirective,
127127
// Directives Definition
128128
GraphQLDirective,
129-
GraphQLDirectiveArgument,
130129
// Built-in Directives defined by the Spec
131130
isSpecifiedDirective,
132131
specifiedDirectives,
@@ -138,7 +137,6 @@ export {
138137
DEFAULT_DEPRECATION_REASON,
139138
// type
140139
GraphQLDirectiveConfig,
141-
GraphQLDirectiveArgumentConfig,
142140
GraphQLDirectiveExtensions,
143141
} from './directives';
144142

src/type/index.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ export {
7272
assertDirective,
7373
// Directives Definition
7474
GraphQLDirective,
75-
GraphQLDirectiveArgument,
7675
// Built-in Directives defined by the Spec
7776
isSpecifiedDirective,
7877
specifiedDirectives,
@@ -84,10 +83,7 @@ export {
8483
DEFAULT_DEPRECATION_REASON,
8584
} from './directives';
8685

87-
export type {
88-
GraphQLDirectiveConfig,
89-
GraphQLDirectiveArgumentConfig,
90-
} from './directives';
86+
export type { GraphQLDirectiveConfig } from './directives';
9187

9288
// Common built-in scalar instances.
9389
export {

0 commit comments

Comments
 (0)