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

Allow for specifying variables as a generics argument in graphql TypeScript declaration for react #2198

Closed
dyst5422 opened this issue Sep 23, 2017 · 11 comments
Labels
📚 good-first-issue Issues that are suitable for first-time contributors. 🙏 help-wanted

Comments

@dyst5422
Copy link
Contributor

There are times when a query requires variables that are not useful to the underlying component. Currently, if I specify variables as part of the props the graphql function will receive, my component must also accept those variables.

This should be a relatively simple addition to the declaration to have an extra generic that is variables types defaulted to {} that gets merged into the returned react component type. Though as we all know, a seemingly simple change to types often causes a litany of other type headaches.

@stale
Copy link

stale bot commented Oct 14, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions to Apollo Client!

@jbaxleyiii
Copy link
Contributor

@dyst5422 do you have any interesting in adding this?

@dyst5422
Copy link
Contributor Author

I'll take a stab this week after I fix this one bug....

@stale
Copy link

stale bot commented Nov 6, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions to Apollo Client!

@stale
Copy link

stale bot commented Nov 20, 2017

This issue has been automatically closed because it has not had recent activity after being marked as stale. If you belive this issue is still a problem or should be reopened, please reopen it! Thank you for your contributions to Apollo Client!

@stale stale bot closed this as completed Nov 20, 2017
@dyst5422
Copy link
Contributor Author

Would still like to see this get merged in.

@jbaxleyiii
Copy link
Contributor

@dyst5422 I'll reopen and see if anyone can help add this!

@jbaxleyiii jbaxleyiii reopened this Nov 20, 2017
@jbaxleyiii jbaxleyiii added 📚 good-first-issue Issues that are suitable for first-time contributors. 🙏 help-wanted labels Nov 20, 2017
@dyst5422
Copy link
Contributor Author

I already opened a pull request for this one. I'm not sure if it's still compatible with V2

@jbaxleyiii
Copy link
Contributor

@dyst5422 I'm not sure if it is either! I'm going to create an umbrella issue for typescript / type improvements to see about organizing towards a shared goal of better types (flow, improved depth of typings, etc)

@dyst5422
Copy link
Contributor Author

Thats a good idea. I'll look into whether my PR on V1 is compatible with V2 (just upgraded yesterday, and I didn't have to touch my HOC's at all, so that's good news).

@hwillson
Copy link
Member

This was addressed in apollographql/react-apollo#1365. Closing - thanks!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
📚 good-first-issue Issues that are suitable for first-time contributors. 🙏 help-wanted
Projects
None yet
Development

No branches or pull requests

3 participants