-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[TS + Docs] Include potential gql input variables in ListCell's Loading and Success component typing & improve TS docs #11773
Conversation
- Fix import order - add query typing via TypedDocumentNode - add query variables generic
- fix import ordr - fix highlighting for some tsx blocks - add query typing via TypedDocumentNode - add generic variable typing for Success and Failure components
- fix some tsx highlighting blocks - add TypedDocumentNode query typing - add query variable generic
Phew this was quite a lot of work, but it's done. @Tobbe kindly review at your convenience. BTW – i'm not sure what prettier is complaining there, i pretty much ran all changed code through my local linter before copying it into the docs. |
Will do! BTW, did you see my DM on the forums? |
Just saw it two days ago and still digesting it … will answer soon, promised. |
@Tobbe the smoke tests are failing b/c redwood/__fixtures__/test-project/web/src/components/BlogPostsCell/BlogPostsCell.test.tsx Lines 25 to 41 in 95afaf9
these generated tests include an These IDs appeared in 495f625#diff-61b70e171dde41fe8e245f38f44c78d8ec3354923c8b8b9a9713d1b1f7db74f8 – so i guess |
Fixed in #11779 |
…ng and Success component typing & improve TS docs (#11773) Although list cells in the simpler examples don't have input variables, they *will* very well have them in more advanced apps (i.e. only selecting the items that belong to a certain user or given other constraints), so it good to have these input vars available for autocompletion out of the box. - Adds to #5343 (updating all docs to reflect QUERY annotation with `TypedDocumentNode`) - adds to in #11737, as i realized these now have to be passed in order for the types to still work. - Updated documentation for new generated …QueryVariables generic on Failure and Success components - docs: fixed some tsx highlighting blocks - docs: fixed import order to reflect Eslint rules since RW 2 --------- Co-authored-by: Tobbe Lundberg <tobbe@tlundberg.com>
Although list cells in the simpler examples don't have input variables, they will very well have them in more advanced apps (i.e. only selecting the items that belong to a certain user or given other constraints), so it good to have these input vars available for autocompletion out of the box.
TypedDocumentNode
)