Skip to content

Commit

Permalink
Merge pull request DefinitelyTyped#21835 from pselden/mobx-apollo-data
Browse files Browse the repository at this point in the history
[mobx-apollo] data in the query result can potentially be undefined
  • Loading branch information
uniqueiniquity authored Nov 29, 2017
2 parents 779a35b + c404dc4 commit 420f99c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion types/mobx-apollo/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface MobxApolloQueryOptions<T> extends WatchQueryOptions {

export interface MobxApolloQuery<T> {
loading: boolean;
data: T;
data?: T;
error?: ApolloError;
ref: ObservableQuery<T>;
}
Expand Down
2 changes: 1 addition & 1 deletion types/mobx-apollo/mobx-apollo-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class PostStore {
}

get posts() {
return this.postsQuery.data.posts;
return this.postsQuery.data && this.postsQuery.data.posts;
}
}

Expand Down

0 comments on commit 420f99c

Please sign in to comment.