Skip to content

Commit

Permalink
fix(types): stop depending on internal graphql typings
Browse files Browse the repository at this point in the history
  • Loading branch information
MichalLytek committed Apr 24, 2019
1 parent 1312584 commit 4677f1a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# Changelog and release notes

<!-- ## Unreleased -->
## Unreleased
<!-- here goes all the unreleased changes descriptions -->
### Fixes
- fix broken compatibility with newer `@types/graphql` due to using removed private types (e.g. `MaybePromise`) (#320)

## v0.17.2
### Features
- add support for defining `resolveType` function for interfaces and unions (#319)
Expand Down
3 changes: 3 additions & 0 deletions src/interfaces/Maybe.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export type Maybe<T> = T | null | undefined;

export type MaybePromise<T> = Promise<T> | T;
3 changes: 1 addition & 2 deletions src/interfaces/TypeResolver.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { GraphQLResolveInfo } from "graphql";
import { MaybePromise } from "graphql/jsutils/MaybePromise";
import Maybe from "graphql/tsutils/Maybe";

import { ClassType } from "./ClassType";
import { MaybePromise, Maybe } from "./Maybe";

export type TypeResolver<TSource, TContext> = (
value: TSource,
Expand Down
1 change: 1 addition & 0 deletions src/interfaces/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export { MiddlewareFn, NextFn, MiddlewareInterface } from "./Middleware";
export * from "./AuthChecker";
export * from "./ClassType";
export * from "./Complexity";
export * from "./Maybe";
export * from "./Publisher";
export * from "./ResolverData";
export * from "./ResolverFilterData";
Expand Down

0 comments on commit 4677f1a

Please sign in to comment.