Skip to content

Commit 1d3ca9e

Browse files
committed
convert$ReadOnly (flow) to Readonly (TS)
1 parent bd46482 commit 1d3ca9e

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

src/type/definition.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ export class GraphQLScalarType {
532532
astNode: Maybe<ScalarTypeDefinitionNode>;
533533
extensionASTNodes: Maybe<ReadonlyArray<ScalarTypeExtensionNode>>;
534534

535-
constructor(config: $ReadOnly<GraphQLScalarTypeConfig<unknown, unknown>>) {
535+
constructor(config: Readonly<GraphQLScalarTypeConfig<unknown, unknown>>) {
536536
const parseValue = config.parseValue ?? identityFunc;
537537
this.name = config.name;
538538
this.description = config.description;
@@ -679,7 +679,7 @@ export class GraphQLObjectType {
679679
_fields: Thunk<GraphQLFieldMap<any, any>>;
680680
_interfaces: Thunk<Array<GraphQLInterfaceType>>;
681681

682-
constructor(config: $ReadOnly<GraphQLObjectTypeConfig<any, any>>) {
682+
constructor(config: Readonly<GraphQLObjectTypeConfig<any, any>>) {
683683
this.name = config.name;
684684
this.description = config.description;
685685
this.isTypeOf = config.isTypeOf;
@@ -744,9 +744,9 @@ export class GraphQLObjectType {
744744
}
745745

746746
function defineInterfaces(
747-
config: $ReadOnly<
747+
config: Readonly<
748748
| GraphQLObjectTypeConfig<unknown, unknown>
749-
| GraphQLInterfaceTypeConfig<unknown, unknown>,
749+
| GraphQLInterfaceTypeConfig<unknown, unknown>
750750
>,
751751
): Array<GraphQLInterfaceType> {
752752
const interfaces = resolveThunk(config.interfaces) ?? [];
@@ -758,9 +758,9 @@ function defineInterfaces(
758758
}
759759

760760
function defineFieldMap<TSource, TContext>(
761-
config: $ReadOnly<
761+
config: Readonly<
762762
| GraphQLObjectTypeConfig<TSource, TContext>
763-
| GraphQLInterfaceTypeConfig<TSource, TContext>,
763+
| GraphQLInterfaceTypeConfig<TSource, TContext>
764764
>,
765765
): GraphQLFieldMap<TSource, TContext> {
766766
const fieldMap = resolveThunk(config.fields);
@@ -993,7 +993,7 @@ export class GraphQLInterfaceType {
993993
_fields: Thunk<GraphQLFieldMap<any, any>>;
994994
_interfaces: Thunk<Array<GraphQLInterfaceType>>;
995995

996-
constructor(config: $ReadOnly<GraphQLInterfaceTypeConfig<any, any>>) {
996+
constructor(config: Readonly<GraphQLInterfaceTypeConfig<any, any>>) {
997997
this.name = config.name;
998998
this.description = config.description;
999999
this.resolveType = config.resolveType;
@@ -1106,7 +1106,7 @@ export class GraphQLUnionType {
11061106

11071107
_types: Thunk<Array<GraphQLObjectType>>;
11081108

1109-
constructor(config: $ReadOnly<GraphQLUnionTypeConfig<any, any>>) {
1109+
constructor(config: Readonly<GraphQLUnionTypeConfig<any, any>>) {
11101110
this.name = config.name;
11111111
this.description = config.description;
11121112
this.resolveType = config.resolveType;
@@ -1161,7 +1161,7 @@ export class GraphQLUnionType {
11611161
}
11621162

11631163
function defineTypes(
1164-
config: $ReadOnly<GraphQLUnionTypeConfig<unknown, unknown>>,
1164+
config: Readonly<GraphQLUnionTypeConfig<unknown, unknown>>,
11651165
): Array<GraphQLObjectType> {
11661166
const types = resolveThunk(config.types);
11671167
devAssert(
@@ -1218,7 +1218,7 @@ export class GraphQLEnumType /* <T> */ {
12181218
_valueLookup: Map<any /* T */, GraphQLEnumValue>;
12191219
_nameLookup: ObjMap<GraphQLEnumValue>;
12201220

1221-
constructor(config: $ReadOnly<GraphQLEnumTypeConfig /* <T> */>) {
1221+
constructor(config: Readonly<GraphQLEnumTypeConfig /* <T> */>) {
12221222
this.name = config.name;
12231223
this.description = config.description;
12241224
this.extensions = config.extensions && toObjMap(config.extensions);
@@ -1426,7 +1426,7 @@ export class GraphQLInputObjectType {
14261426

14271427
_fields: Thunk<GraphQLInputFieldMap>;
14281428

1429-
constructor(config: $ReadOnly<GraphQLInputObjectTypeConfig>) {
1429+
constructor(config: Readonly<GraphQLInputObjectTypeConfig>) {
14301430
this.name = config.name;
14311431
this.description = config.description;
14321432
this.extensions = config.extensions && toObjMap(config.extensions);
@@ -1482,7 +1482,7 @@ export class GraphQLInputObjectType {
14821482
}
14831483

14841484
function defineInputFieldMap(
1485-
config: $ReadOnly<GraphQLInputObjectTypeConfig>,
1485+
config: Readonly<GraphQLInputObjectTypeConfig>,
14861486
): GraphQLInputFieldMap {
14871487
const fieldMap = resolveThunk(config.fields);
14881488
devAssert(

src/type/directives.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export class GraphQLDirective {
4848
extensions: Maybe<ReadOnlyObjMap<unknown>>;
4949
astNode: Maybe<DirectiveDefinitionNode>;
5050

51-
constructor(config: $ReadOnly<GraphQLDirectiveConfig>) {
51+
constructor(config: Readonly<GraphQLDirectiveConfig>) {
5252
this.name = config.name;
5353
this.description = config.description;
5454
this.locations = config.locations;

src/type/schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export class GraphQLSchema {
137137
// Used as a cache for validateSchema().
138138
__validationErrors: Maybe<ReadonlyArray<GraphQLError>>;
139139

140-
constructor(config: $ReadOnly<GraphQLSchemaConfig>) {
140+
constructor(config: Readonly<GraphQLSchemaConfig>) {
141141
// If this schema was built from a source known to be valid, then it may be
142142
// marked with assumeValid to avoid an additional type system validation.
143143
this.__validationErrors = config.assumeValid === true ? [] : undefined;

0 commit comments

Comments
 (0)