Skip to content

Commit 58e2f5f

Browse files
CitoIvanGoncharov
authored andcommitted
Remove forgotten internal error message functions (#2159) (#2285)
1 parent e919361 commit 58e2f5f

File tree

5 files changed

+2
-45
lines changed

5 files changed

+2
-45
lines changed

src/type/__tests__/introspection-test.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import { describe, it } from 'mocha';
55

66
import invariant from '../../jsutils/invariant';
77

8-
import { missingFieldArgMessage } from '../../validation/rules/ProvidedRequiredArguments';
9-
108
import { graphqlSync } from '../../graphql';
119
import { getIntrospectionQuery } from '../../utilities/getIntrospectionQuery';
1210

@@ -1253,7 +1251,8 @@ describe('Introspection', () => {
12531251
expect(graphqlSync(schema, request)).to.deep.equal({
12541252
errors: [
12551253
{
1256-
message: missingFieldArgMessage('__type', 'name', 'String!'),
1254+
message:
1255+
'Field "__type" argument "name" of type "String!" is required, but it was not provided.',
12571256
locations: [{ line: 3, column: 9 }],
12581257
},
12591258
],

src/validation/rules/ProvidedRequiredArguments.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,6 @@ import {
1717
type SDLValidationContext,
1818
} from '../ValidationContext';
1919

20-
export function missingFieldArgMessage(
21-
fieldName: string,
22-
argName: string,
23-
type: string,
24-
): string {
25-
return `Field "${fieldName}" argument "${argName}" of type "${type}" is required, but it was not provided.`;
26-
}
27-
28-
export function missingDirectiveArgMessage(
29-
directiveName: string,
30-
argName: string,
31-
type: string,
32-
): string {
33-
return `Directive "@${directiveName}" argument "${argName}" of type "${type}" is required, but it was not provided.`;
34-
}
35-
3620
/**
3721
* Provided required arguments
3822
*

src/validation/rules/ScalarLeafs.js

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,6 @@ import { getNamedType, isLeafType } from '../../type/definition';
1111

1212
import { type ValidationContext } from '../ValidationContext';
1313

14-
export function noSubselectionAllowedMessage(
15-
fieldName: string,
16-
type: string,
17-
): string {
18-
return `Field "${fieldName}" must not have a selection since type "${type}" has no subfields.`;
19-
}
20-
21-
export function requiredSubselectionMessage(
22-
fieldName: string,
23-
type: string,
24-
): string {
25-
return `Field "${fieldName}" of type "${type}" must have a selection of subfields. Did you mean "${fieldName} { ... }"?`;
26-
}
27-
2814
/**
2915
* Scalar leafs
3016
*

src/validation/rules/UniqueArgumentNames.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ import { type ASTVisitor } from '../../language/visitor';
55

66
import { type ASTValidationContext } from '../ValidationContext';
77

8-
export function duplicateArgMessage(argName: string): string {
9-
return `There can be only one argument named "${argName}".`;
10-
}
11-
128
/**
139
* Unique argument names
1410
*

src/validation/rules/UniqueDirectiveNames.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,6 @@ import { type ASTVisitor } from '../../language/visitor';
55

66
import { type SDLValidationContext } from '../ValidationContext';
77

8-
export function duplicateDirectiveNameMessage(directiveName: string): string {
9-
return `There can be only one directive named "${directiveName}".`;
10-
}
11-
12-
export function existedDirectiveNameMessage(directiveName: string): string {
13-
return `Directive "${directiveName}" already exists in the schema. It cannot be redefined.`;
14-
}
15-
168
/**
179
* Unique directive names
1810
*

0 commit comments

Comments
 (0)