Skip to content

Commit

Permalink
Remove maybe types
Browse files Browse the repository at this point in the history
  • Loading branch information
danielrearden committed Jul 8, 2020
1 parent 3bd6838 commit d69f8b9
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions src/connection/arrayconnection.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export function cursorToOffset(cursor: ConnectionCursor): number {
export function cursorForObjectInConnection<T>(
data: $ReadOnlyArray<T>,
object: T,
): ?ConnectionCursor {
): ConnectionCursor | null {
const offset = data.indexOf(object);
if (offset === -1) {
return null;
Expand All @@ -153,7 +153,7 @@ export function cursorForObjectInConnection<T>(
* otherwise it will be the default.
*/
export function getOffsetWithDefault(
cursor?: ?ConnectionCursor,
cursor: ConnectionCursor | void | null,
defaultOffset: number,
): number {
if (typeof cursor !== 'string') {
Expand Down
10 changes: 5 additions & 5 deletions src/connection/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ export const connectionArgs: GraphQLFieldConfigArgumentMap = {
};

type ConnectionConfig = {
name?: ?string,
name?: string,
nodeType: GraphQLObjectType,
resolveNode?: ?GraphQLFieldResolver<any, any>,
resolveCursor?: ?GraphQLFieldResolver<any, any>,
edgeFields?: ?Thunk<GraphQLFieldConfigMap<any, any>>,
connectionFields?: ?Thunk<GraphQLFieldConfigMap<any, any>>,
resolveNode?: GraphQLFieldResolver<any, any>,
resolveCursor?: GraphQLFieldResolver<any, any>,
edgeFields?: Thunk<GraphQLFieldConfigMap<any, any>>,
connectionFields?: Thunk<GraphQLFieldConfigMap<any, any>>,
};

type GraphQLConnectionDefinitions = {
Expand Down
16 changes: 8 additions & 8 deletions src/connection/connectiontypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ export type ConnectionCursor = string;
* A flow type designed to be exposed as `PageInfo` over GraphQL.
*/
export type PageInfo = {
startCursor: ?ConnectionCursor,
endCursor: ?ConnectionCursor,
hasPreviousPage: ?boolean,
hasNextPage: ?boolean,
startCursor: ConnectionCursor | null,
endCursor: ConnectionCursor | null,
hasPreviousPage: boolean,
hasNextPage: boolean,
};

/**
Expand All @@ -35,9 +35,9 @@ export type Edge<T> = {
* A flow type describing the arguments a connection field receives in GraphQL.
*/
export type ConnectionArguments = {
before?: ?ConnectionCursor,
after?: ?ConnectionCursor,
first?: ?number,
last?: ?number,
before?: ConnectionCursor | null,
after?: ConnectionCursor | null,
first?: number | null,
last?: number | null,
...
};
4 changes: 2 additions & 2 deletions src/node/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type GraphQLNodeDefinitions<TContext> = {
*/
export function nodeDefinitions<TContext>(
idFetcher: (id: string, context: TContext, info: GraphQLResolveInfo) => any,
typeResolver?: ?GraphQLTypeResolver<any, TContext>,
typeResolver?: GraphQLTypeResolver<any, TContext>,
): GraphQLNodeDefinitions<TContext> {
const nodeInterface = new GraphQLInterfaceType({
name: 'Node',
Expand Down Expand Up @@ -110,7 +110,7 @@ export function fromGlobalId(globalId: string): ResolvedGlobalId {
* property on the object.
*/
export function globalIdField(
typeName?: ?string,
typeName?: string,
idFetcher?: (object: any, context: any, info: GraphQLResolveInfo) => string,
): GraphQLFieldConfig<any, mixed> {
return {
Expand Down
4 changes: 2 additions & 2 deletions src/node/plural.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ type PluralIdentifyingRootFieldConfig = {
input: any,
context: any,
info: GraphQLResolveInfo,
) => ?any,
description?: ?string,
) => any,
description?: string,
};

export function pluralIdentifyingRootField(
Expand Down

0 comments on commit d69f8b9

Please sign in to comment.