Skip to content

Commit be26b2f

Browse files
committed
fix: make all symbol properties readonly
1 parent 3ec488e commit be26b2f

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

src/error/GraphQLError.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function isGraphQLError(error: unknown): error is GraphQLError {
4444
* GraphQL document and/or execution result that correspond to the Error.
4545
*/
4646
export class GraphQLError extends Error {
47-
[isGraphQLErrorSymbol]: true = true;
47+
readonly [isGraphQLErrorSymbol]: true = true;
4848
/**
4949
* An array of `{ line, column }` locations within the source GraphQL document
5050
* which correspond to this error.

src/language/source.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const isSourceSymbol = Symbol.for('Source');
1515
* The `line` and `column` properties in `locationOffset` are 1-indexed.
1616
*/
1717
export class Source {
18-
[isSourceSymbol]: true = true;
18+
readonly [isSourceSymbol]: true = true;
1919
body: string;
2020
name: string;
2121
locationOffset: Location;

src/type/directives.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const isGraphQLDirectiveSymbol = Symbol.for('GraphQLDirective');
5757
* behavior. Type system creators will usually not create these directly.
5858
*/
5959
export class GraphQLDirective {
60-
[isGraphQLDirectiveSymbol]: true = true;
60+
readonly [isGraphQLDirectiveSymbol]: true = true;
6161
name: string;
6262
description: Maybe<string>;
6363
locations: ReadonlyArray<DirectiveLocation>;

src/type/schema.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,12 @@ const isSchemaSymbol = Symbol.for('GraphQLSchema');
136136
* ```
137137
*/
138138
export class GraphQLSchema {
139+
readonly [isSchemaSymbol]: true = true;
140+
139141
description: Maybe<string>;
140142
extensions: Readonly<GraphQLSchemaExtensions>;
141143
astNode: Maybe<SchemaDefinitionNode>;
142144
extensionASTNodes: ReadonlyArray<SchemaExtensionNode>;
143-
[isSchemaSymbol]: true = true;
144145

145146
// Used as a cache for validateSchema().
146147
__validationErrors: Maybe<ReadonlyArray<GraphQLError>>;

0 commit comments

Comments
 (0)