Skip to content

Commit 20a8f55

Browse files
TS: sync TS typings with Flow typings (#2623)
extracted from #2609
1 parent e4ecbe0 commit 20a8f55

File tree

5 files changed

+13
-5
lines changed

5 files changed

+13
-5
lines changed

src/language/lexer.d.ts

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Token } from './ast';
22
import { Source } from './source';
3+
import { TokenKindEnum } from './tokenKind';
34

45
/**
56
* Given a Source object, this returns a Lexer for that source.
@@ -50,3 +51,8 @@ export class Lexer {
5051
* @internal
5152
*/
5253
export function isPunctuatorToken(token: Token): boolean;
54+
55+
/**
56+
* @internal
57+
*/
58+
export function isPunctuatorTokenKind(kind: TokenKindEnum): boolean;

src/type/definition.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ export interface GraphQLScalarTypeConfig<TInternal, TExternal> {
335335
description?: Maybe<string>;
336336
specifiedByUrl?: Maybe<string>;
337337
// Serializes an internal value to include in a response.
338-
serialize: GraphQLScalarSerializer<TExternal>;
338+
serialize?: GraphQLScalarSerializer<TExternal>;
339339
// Parses an externally provided value to use as an input.
340340
parseValue?: GraphQLScalarValueParser<TInternal>;
341341
// Parses an externally provided literal value to use as an input.

src/type/schema.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export interface GraphQLSchemaValidationOptions {
111111

112112
export interface GraphQLSchemaConfig extends GraphQLSchemaValidationOptions {
113113
description?: Maybe<string>;
114-
query: Maybe<GraphQLObjectType>;
114+
query?: Maybe<GraphQLObjectType>;
115115
mutation?: Maybe<GraphQLObjectType>;
116116
subscription?: Maybe<GraphQLObjectType>;
117117
types?: Maybe<Array<GraphQLNamedType>>;

src/utilities/getIntrospectionQuery.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { DirectiveLocationEnum } from '../language/directiveLocation';
55
export interface IntrospectionOptions {
66
// Whether to include descriptions in the introspection result.
77
// Default: true
8-
descriptions: boolean;
8+
descriptions?: boolean;
99

1010
// Whether to include `specifiedByUrl` in the introspection result.
1111
// Default: false
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import { ASTVisitor } from '../../language/visitor';
2-
import { ValidationContext } from '../ValidationContext';
2+
import { ValidationContext, SDLValidationContext } from '../ValidationContext';
33

44
/**
55
* Known type names
66
*
77
* A GraphQL document is only valid if referenced types (specifically
88
* variable definitions and fragment conditions) are defined by the type schema.
99
*/
10-
export function KnownTypeNamesRule(context: ValidationContext): ASTVisitor;
10+
export function KnownTypeNamesRule(
11+
context: ValidationContext | SDLValidationContext,
12+
): ASTVisitor;

0 commit comments

Comments
 (0)