Turning off __typename consequences
See original GitHub issueHey, there are a lot of issues about __typename
added to data. There are use cases when you want to receive data exactly as it was asked. The advised solutions were to manually deeply remove __typename
from data or to turn this off with addTypename: false
.
What are the consequences of turning this off with addTypename: false
, will it break cache somehow/make it slower/etc ?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:14 (4 by maintainers)
Top Results From Across the Web
How to remove the `__typename` field from the graphql ...
js:28 DEPRECATION WARNING: using fragments without __typename is unsupported behavior and will be removed in future versions of Apollo client.
Read more >Demystifying Cache Normalization - Apollo GraphQL Blog
Application-specific side-effects are things that you want to happen to the cache after a mutation that may not use anything from the response ......
Read more >Compiler Warning (level 3) C4996 - Microsoft Learn
Turn off the warning for a project in Visual Studio · Open the Property Pages dialog for your project. For information on how...
Read more >What are consequences of changing Record Type Name
Why are wire transfers not reversible by the bank? Is it bad practice to regularly turn a circuit breaker off/on? Meaning of 'Bessel...
Read more >Disable Implicit Casts - Gockel Hut
The compiler will happily add an implicit cast to transform the argument to a 5 . Most compilers have warnings that can be...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We dumped the
react-apollo
all together and switched to using our own library which exposesapollo
throughmobx
. The library itself filters the extraneous__typename
field.Internally, it all just comes to this function
and then (for example in render function/method)
objectKeyFilter
being https://www.npmjs.com/package/object-key-filterIf you want to avoid having to manually remove
__typename
from every response, you can just require this module https://www.npmjs.com/package/typename-monkey-patch somewhere near the entry point of your app. It monkey patches graphql HOC from react-apollo so that__typename
is removed before sendingdata
to your wrapped component.