Skip to content

Commit

Permalink
TS: sync TS typings with Flow typings (#2623)
Browse files Browse the repository at this point in the history
extracted from #2609
  • Loading branch information
IvanGoncharov committed Jun 6, 2020
1 parent e4ecbe0 commit 20a8f55
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
6 changes: 6 additions & 0 deletions src/language/lexer.d.ts
@@ -1,5 +1,6 @@
import { Token } from './ast';
import { Source } from './source';
import { TokenKindEnum } from './tokenKind';

/**
* Given a Source object, this returns a Lexer for that source.
Expand Down Expand Up @@ -50,3 +51,8 @@ export class Lexer {
* @internal
*/
export function isPunctuatorToken(token: Token): boolean;

/**
* @internal
*/
export function isPunctuatorTokenKind(kind: TokenKindEnum): boolean;
2 changes: 1 addition & 1 deletion src/type/definition.d.ts
Expand Up @@ -335,7 +335,7 @@ export interface GraphQLScalarTypeConfig<TInternal, TExternal> {
description?: Maybe<string>;
specifiedByUrl?: Maybe<string>;
// Serializes an internal value to include in a response.
serialize: GraphQLScalarSerializer<TExternal>;
serialize?: GraphQLScalarSerializer<TExternal>;
// Parses an externally provided value to use as an input.
parseValue?: GraphQLScalarValueParser<TInternal>;
// Parses an externally provided literal value to use as an input.
Expand Down
2 changes: 1 addition & 1 deletion src/type/schema.d.ts
Expand Up @@ -111,7 +111,7 @@ export interface GraphQLSchemaValidationOptions {

export interface GraphQLSchemaConfig extends GraphQLSchemaValidationOptions {
description?: Maybe<string>;
query: Maybe<GraphQLObjectType>;
query?: Maybe<GraphQLObjectType>;
mutation?: Maybe<GraphQLObjectType>;
subscription?: Maybe<GraphQLObjectType>;
types?: Maybe<Array<GraphQLNamedType>>;
Expand Down
2 changes: 1 addition & 1 deletion src/utilities/getIntrospectionQuery.d.ts
Expand Up @@ -5,7 +5,7 @@ import { DirectiveLocationEnum } from '../language/directiveLocation';
export interface IntrospectionOptions {
// Whether to include descriptions in the introspection result.
// Default: true
descriptions: boolean;
descriptions?: boolean;

// Whether to include `specifiedByUrl` in the introspection result.
// Default: false
Expand Down
6 changes: 4 additions & 2 deletions src/validation/rules/KnownTypeNamesRule.d.ts
@@ -1,10 +1,12 @@
import { ASTVisitor } from '../../language/visitor';
import { ValidationContext } from '../ValidationContext';
import { ValidationContext, SDLValidationContext } from '../ValidationContext';

/**
* Known type names
*
* A GraphQL document is only valid if referenced types (specifically
* variable definitions and fragment conditions) are defined by the type schema.
*/
export function KnownTypeNamesRule(context: ValidationContext): ASTVisitor;
export function KnownTypeNamesRule(
context: ValidationContext | SDLValidationContext,
): ASTVisitor;

0 comments on commit 20a8f55

Please sign in to comment.