You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Hello,
I'm using the preset client to generate types and using fragment do declare data dependency of some components.
However, I still find there's room for improvements for the DX. Here's the problem I have:
I have a Page that uses a component ProfileCards. This component declares its dependency with a fragment.
This is great, it allows to generate types for the component.
What I find annoying is: I need to include the fragment name in Page query.
For a simple page it's ok to do this, but when the page gets more complex with many components having their own components declaring their own data dependency with fragment, it becomes rapidly a mess.
For instance, if I remove a component from my page, I need also to remove it's fragment from the page's query.
Describe the solution you'd like
What I'd love is :
to still declare the data dependency of a component right in the component
stop giving a unique name to the fragment
automatically include or remove the fragment in the page query when data dependency of my component tree changes
Is your feature request related to a problem? Please describe.
Hello,
I'm using the preset
client
to generate types and usingfragment
do declare data dependency of some components.However, I still find there's room for improvements for the DX. Here's the problem I have:
I have a
Page
that uses a componentProfileCards
. This component declares its dependency with afragment
.This is great, it allows to generate types for the component.
What I find annoying is: I need to include the fragment name in
Page
query.For a simple page it's ok to do this, but when the page gets more complex with many components having their own components declaring their own data dependency with
fragment
, it becomes rapidly a mess.For instance, if I remove a component from my page, I need also to remove it's fragment from the page's query.
Describe the solution you'd like
What I'd love is :
Describe alternatives you've considered
I've looked at
useFragment
from relay but they've got the same limitations (see: https://relay.dev/docs/guided-tour/rendering/fragments/)I know there's many obstacles to be able to do it, for instances:
Page
, on which query should the fragments be added ?I'm wondering if y'all are having the same problem, and what's your way to fix it (or avoid it) ?
Also, thanks a lot for the amazing work you're doing, using
fragment
made my life easier 🙇♂️🥰[EDIT]
To help me detect unused-fragments, I will try to use those eslint rules https://the-guild.dev/graphql/eslint/rules , especially
no-unused-fragments
The text was updated successfully, but these errors were encountered: