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

Remove removeTypenameFromVariableExchange to be agnostic to GQL client #183

Open
IzumiSy opened this issue Feb 6, 2025 · 0 comments
Open
Labels
help wanted Need help! package:core Related to @fabrix-framework/fabrix refactor Refactoring

Comments

@IzumiSy
Copy link
Member

IzumiSy commented Feb 6, 2025

Currently, fabrix internally depends on urql, but we have a plan to make it pluggable by #123


Background

Since fabrix automatically adds __typename in its selection that is needed to look up the field type to decide the component to render, in the case of executing update mutation directly with the entities fetched from another queries, __typename should manually be removed before sending the mutation requests to the server without the custom exchange of urql (removeTypenameFromVariableExchange) to avoid an error caused by unmatched fields.

https://github.com/fabrix-framework/fabrix/blob/main/packages/fabrix/src/exchanges/removeTypenameFromVariable.ts

However, the behaviour does not have to be implemented as an urql exchange, so remove removeTypenameFromVariableExchange and implement the behaviour as just a simple object manipulation instead.

@IzumiSy IzumiSy added help wanted Need help! package:core Related to @fabrix-framework/fabrix refactor Refactoring labels Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Need help! package:core Related to @fabrix-framework/fabrix refactor Refactoring
Projects
None yet
Development

No branches or pull requests

1 participant