Skip to content

Fix TS types #284

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
Jul 15, 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
2 changes: 1 addition & 1 deletion src/connection/arrayconnection.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@ export function cursorForObjectInConnection<T>(
* otherwise it will be the default.
*/
export function getOffsetWithDefault(
cursor?: ConnectionCursor | null,
cursor: ConnectionCursor | null | undefined,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TS complains because cursor is optional but the next parameter is not, so I just removed the optional and added undefined to the union. I also synced this on the Flow side.

defaultOffset: number,
): number;
2 changes: 1 addition & 1 deletion src/connection/arrayconnection.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export function cursorForObjectInConnection<T>(
* otherwise it will be the default.
*/
export function getOffsetWithDefault(
cursor?: ?ConnectionCursor,
cursor: ConnectionCursor | null | void,
defaultOffset: number,
): number {
if (typeof cursor !== 'string') {
Expand Down
1 change: 1 addition & 0 deletions src/node/node.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type {
GraphQLFieldConfig,
GraphQLInterfaceType,
GraphQLResolveInfo,
GraphQLTypeResolver,
} from 'graphql';
Expand Down