[mobx-apollo] data in the query result can potentially be undefined

This commit is contained in:
Paul Selden
2017-11-29 10:39:19 -05:00
parent 779a35bfdb
commit c404dc4c0a
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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>;
}
+1 -1
View File
@@ -27,7 +27,7 @@ class PostStore {
}
get posts() {
return this.postsQuery.data.posts;
return this.postsQuery.data && this.postsQuery.data.posts;
}
}