Skip to content

TS: sync TS typings with Flow typings #2623

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/language/lexer.d.ts
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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;