-
Notifications
You must be signed in to change notification settings - Fork 786
add some typings to graphql HOC #383
add some typings to graphql HOC #383
Conversation
@brettjurgens: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/ |
@@ -52,6 +54,11 @@ export declare interface QueryOptions { | |||
skip?: boolean; | |||
} | |||
|
|||
export interface InjectedGraphQLProps<T> { | |||
data?: T; | |||
loading?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this also have functions like fetchMore etc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, i can add those
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just realized this should be more like
{
data?: T & { loading: boolean, /* etc */ }
}
anyway
@stubailo added the additional functions & updated the type |
@brettjurgens this is so great! We updated types to match apollo-client. Would you mind fixing the conflicts? |
Urgh! I totally missed this PR when opening #394 :/ |
} | ||
|
||
export interface InjectedGraphQLProps<T> { | ||
data?: T & GraphQLDataProps; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could also be mutate
, or whatever the user passes in for operationOptions.name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is fine IMO, because GraphQLDataProps is also exported. that way the user can just make their own interface i.e.
import { GraphQLDataProps } from 'react-apollo';
interface MyCustomInterface<T> {
whatever?: T & GraphQLDataProps
}
@jbaxleyiii just fixed the conflicts |
…t-apollo into add_typings_to_wrapper
@helfer it does not. The other PR is different, as it tries to address the issues from the core rather than the typings. |
@helfer any update here? |
@jbaxleyiii let us know if you're good with merging this, and I'll merge and deploy it 🙂 |
@helfer I am! |
fixes #379
TODO: