-
Notifications
You must be signed in to change notification settings - Fork 787
Added graphql hoc missing data type generic #2525
Conversation
@EricMcRay: 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/ |
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.
Order seems to be always <TData, TVariables
elsewhere right? Any reason we should change the order on this? It could be type-breaking with inserting TData first but perhaps that is warranted for consistency's sake?
@rosskevin I aware of the order. The reason, I put |
I don't think thats a great idea. It will cause more pain down the road if suddenly TData and TVariables are switched for that one case. This will cause many developer hours wasted on bug hunting as people expect the proper order. In my opinion, it should rather be a breaking change or export new types and deprecate the old ones. |
This looks like it is used internally as far as I can tell from a search of the codebase. I would be ok with directly using |
But it was exported, so people could be using it. Maybe just rename them to be on the safe side? Then people who use them would catch the change immediately. |
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.
I think with the rename and ordering change, this will be good to merge.
@EricMcRay do you intend on finishing this to get it merged? |
I updated typings as you talked. I extended GraphqlQueryControls from QueryControls to prevent any inconsistency in the future. |
@@ -49,28 +49,33 @@ export interface QueryOpts<TGraphQLVariables = OperationVariables> { | |||
partialRefetch?: boolean; | |||
} | |||
|
|||
export interface GraphqlQueryControls<TGraphQLVariables = OperationVariables> { | |||
export interface QueryControls<TData = any, TGraphQLVariables = OperationVariables> { |
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.
Please change all usages of GraphqlQueryControls
to QueryControls
.
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.
I changed all usages and added TData generic for better typing but I am not sure it will break something. I don't have good knowledge about all code base. Can you check and confirm changes?
Great stuff @EricMcRay . Thanks! Just some minor changes and its ready to go. |
It looks like we're all set here - @danilobuerger @rosskevin would you agree? |
Fix for #1920
Checklist:
/label typescript