Skip to content

Commit

Permalink
TS: sync TS typings with Flow typings
Browse files Browse the repository at this point in the history
extracted from graphql#2609
  • Loading branch information
IvanGoncharov committed Jun 6, 2020
1 parent e4ecbe0 commit eeb395d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
5 changes: 5 additions & 0 deletions src/language/lexer.d.ts
Expand Up @@ -50,3 +50,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 eeb395d

Please sign in to comment.