Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[react-apollo] Extract QueryComponentProps #2820

Closed
wants to merge 1 commit into from

Conversation

jevakallio
Copy link

As a user of react-apollo, it's a common use case to want to create your own higher-order Query component to specify default options, additional behaviours, etc.

In order to type that higher order component, we need to export the Props type of the react-apollo Query component, so that a consumer of the library can use it to define their HoC props type by extending it.

This commit extracts and exports a generic QueryComponentProps<TData, TVariables> type. It has no functional changes.

As a user of `react-apollo`, it's a common use case to want to create your own higher-order `Query` component to specify default options, additional behaviours, etc.

In order to type that higher order component, we need to export the Props type of the `react-apollo` `Query` component, so that a consumer of the library can use it to define their HoC props type by extending it.

This commit extracts and exports a generic `QueryComponentProps<TData, TVariables>` type. It has no functional changes.
@jevakallio
Copy link
Author

The failing Travis test does not seem to be related to this change -- it's a failing test for regression #1385.

run-tests (command) › regression 1385 › returns error code if $ExpectError test doesn't fail

@villesau
Copy link
Member

@jevakallio Thanks for the contribution! I rerun the test suite and looks like there are bunch of valid errors too.

@gantoine gantoine added enhancement An addition to an existing component needs updates The PR needs updates before shipping (eg. failing build, bad file path) libdef Related to a library definition labels Oct 18, 2018
@matthargett
Copy link

ping on this? flow is failing for all the teams I work with that use react-apollo.

@villesau
Copy link
Member

@matthargett feel free to fork and reopen the PR with fixed test cases. I'm afraid that the original author is no longer interested in this.

@jevakallio
Copy link
Author

Hi, I'm sorry, I'm still interested in this, but I haven't had time to follow up on it since I'm no longer working in that codebase and using Flow, and I don't have a meaningful local test case to drive it.

@matthargett if you can pick this up that would be fantastic -- if not, I can try to address the issues when I get a chance. Let me know.

@villesau villesau self-assigned this Aug 9, 2019
@villesau
Copy link
Member

villesau commented Aug 9, 2019

@jevakallio any progress? :)

@gantoine gantoine closed this May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement An addition to an existing component libdef Related to a library definition needs updates The PR needs updates before shipping (eg. failing build, bad file path)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants