Skip to content

Commit 5eb7c4d

Browse files
EndaIvanGoncharov
authored andcommitted
Document private functions with @internal tag (#2205)
1 parent 6fc5e42 commit 5eb7c4d

17 files changed

+77
-22
lines changed

src/execution/execute.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,8 @@ function buildResponse(
244244
/**
245245
* Essential assertions before executing to provide developer feedback for
246246
* improper use of the GraphQL library.
247+
*
248+
* @internal
247249
*/
248250
export function assertValidExecutionArguments(
249251
schema: GraphQLSchema,
@@ -267,6 +269,8 @@ export function assertValidExecutionArguments(
267269
* execute, which we will pass throughout the other execution methods.
268270
*
269271
* Throws a GraphQLError if a valid execution context cannot be created.
272+
*
273+
* @internal
270274
*/
271275
export function buildExecutionContext(
272276
schema: GraphQLSchema,
@@ -465,6 +469,8 @@ function executeFields(
465469
* CollectFields requires the "runtime type" of an object. For a field which
466470
* returns an Interface or Union type, the "runtime type" will be the actual
467471
* Object type returned by that field.
472+
*
473+
* @internal
468474
*/
469475
export function collectFields(
470476
exeContext: ExecutionContext,
@@ -641,6 +647,9 @@ function resolveField(
641647
);
642648
}
643649

650+
/**
651+
* @internal
652+
*/
644653
export function buildResolveInfo(
645654
exeContext: ExecutionContext,
646655
fieldDef: GraphQLField<mixed, mixed>,
@@ -664,8 +673,12 @@ export function buildResolveInfo(
664673
};
665674
}
666675

667-
// Isolates the "ReturnOrAbrupt" behavior to not de-opt the `resolveField`
668-
// function. Returns the result of resolveFn or the abrupt-return Error object.
676+
/**
677+
* Isolates the "ReturnOrAbrupt" behavior to not de-opt the `resolveField`
678+
* function. Returns the result of resolveFn or the abrupt-return Error object.
679+
*
680+
* @internal
681+
*/
669682
export function resolveFieldValueOrError(
670683
exeContext: ExecutionContext,
671684
fieldDef: GraphQLField<mixed, mixed>,
@@ -1192,6 +1205,8 @@ export const defaultFieldResolver: GraphQLFieldResolver<
11921205
* are allowed, like on a Union. __schema could get automatically
11931206
* added to the query type, but that would require mutating type
11941207
* definitions, which would cause issues.
1208+
*
1209+
* @internal
11951210
*/
11961211
export function getFieldDef(
11971212
schema: GraphQLSchema,

src/execution/values.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ type CoercedVariableValues =
4141
* Note: The returned value is a plain Object with a prototype, since it is
4242
* exposed to user code. Care should be taken to not pull values from the
4343
* Object prototype.
44+
*
45+
* @internal
4446
*/
4547
export function getVariableValues(
4648
schema: GraphQLSchema,
@@ -153,6 +155,8 @@ function coerceVariableValues(
153155
* Note: The returned value is a plain Object with a prototype, since it is
154156
* exposed to user code. Care should be taken to not pull values from the
155157
* Object prototype.
158+
*
159+
* @internal
156160
*/
157161
export function getArgumentValues(
158162
def: GraphQLField<mixed, mixed> | GraphQLDirective,

src/language/blockString.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* CoffeeScript's block string, Python's docstring trim or Ruby's strip_heredoc.
66
*
77
* This implements the GraphQL spec's BlockStringValue() static algorithm.
8+
*
9+
* @internal
810
*/
911
export function dedentBlockStringValue(rawString: string): string {
1012
// Expand a block string's raw value into independent lines.
@@ -30,8 +32,9 @@ export function dedentBlockStringValue(rawString: string): string {
3032
// Return a string of the lines joined with U+000A.
3133
return lines.join('\n');
3234
}
33-
34-
// @internal
35+
/**
36+
* @internal
37+
*/
3538
export function getBlockStringIndentation(
3639
lines: $ReadOnlyArray<string>,
3740
): number {
@@ -71,6 +74,8 @@ function isBlank(str) {
7174
* Print a block string in the indented block form by adding a leading and
7275
* trailing blank line. However, if a block string starts with whitespace and is
7376
* a single-line, adding a leading blank line would strip that whitespace.
77+
*
78+
* @internal
7479
*/
7580
export function printBlockString(
7681
value: string,

src/language/lexer.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ export type Lexer<TOptions> = {
9393
...
9494
};
9595

96-
// @internal
96+
/**
97+
* @internal
98+
*/
9799
export function isPunctuatorTokenKind(kind: TokenKindEnum) {
98100
return (
99101
kind === TokenKind.BANG ||

src/type/definition.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -822,6 +822,9 @@ function fieldsToFieldsConfig(fields) {
822822
}));
823823
}
824824

825+
/**
826+
* @internal
827+
*/
825828
export function argsToArgsConfig(
826829
args: $ReadOnlyArray<GraphQLArgument>,
827830
): GraphQLFieldConfigArgumentMap {

src/validation/rules/KnownArgumentNames.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ export function KnownArgumentNames(context: ValidationContext): ASTVisitor {
4545
};
4646
}
4747

48-
// @internal
48+
/**
49+
* @internal
50+
*/
4951
export function KnownArgumentNamesOnDirectives(
5052
context: ValidationContext | SDLValidationContext,
5153
): ASTVisitor {

src/validation/rules/ProvidedRequiredArguments.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ export function ProvidedRequiredArguments(
7171
};
7272
}
7373

74-
// @internal
74+
/**
75+
* @internal
76+
*/
7577
export function ProvidedRequiredArgumentsOnDirectives(
7678
context: ValidationContext | SDLValidationContext,
7779
): ASTVisitor {

src/validation/specifiedRules.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ import { UniqueDirectivesPerLocation } from './rules/UniqueDirectivesPerLocation
6060
// Spec Section: "Argument Names"
6161
import {
6262
KnownArgumentNames,
63-
KnownArgumentNamesOnDirectives, // @internal
63+
KnownArgumentNamesOnDirectives,
6464
} from './rules/KnownArgumentNames';
6565

6666
// Spec Section: "Argument Uniqueness"
@@ -72,7 +72,7 @@ import { ValuesOfCorrectType } from './rules/ValuesOfCorrectType';
7272
// Spec Section: "Argument Optionality"
7373
import {
7474
ProvidedRequiredArguments,
75-
ProvidedRequiredArgumentsOnDirectives, // @internal
75+
ProvidedRequiredArgumentsOnDirectives,
7676
} from './rules/ProvidedRequiredArguments';
7777

7878
// Spec Section: "All Variable Usages Are Allowed"
@@ -127,7 +127,9 @@ import { UniqueFieldDefinitionNames } from './rules/UniqueFieldDefinitionNames';
127127
import { UniqueDirectiveNames } from './rules/UniqueDirectiveNames';
128128
import { PossibleTypeExtensions } from './rules/PossibleTypeExtensions';
129129

130-
// @internal
130+
/**
131+
* @internal
132+
*/
131133
export const specifiedSDLRules = Object.freeze([
132134
LoneSchemaDefinition,
133135
UniqueOperationTypes,

src/validation/validate.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ export function validate(
8282
return errors;
8383
}
8484

85-
// @internal
85+
/**
86+
* @internal
87+
*/
8688
export function validateSDL(
8789
documentAST: DocumentNode,
8890
schemaToExtend?: ?GraphQLSchema,

tstypes/language/blockString.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
*/
77
export function dedentBlockStringValue(rawString: string): string;
88

9-
// @internal
9+
/**
10+
* @internal
11+
*/
1012
export function getBlockStringIndentation(lines: ReadonlyArray<string>): number;
1113

1214
/**

0 commit comments

Comments
 (0)