Skip to content

Commit

Permalink
chore(core): Deprecate maskTypename option (#3299)
Browse files Browse the repository at this point in the history
  • Loading branch information
kitten authored Jun 30, 2023
1 parent 8b8cf54 commit cbf338b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .changeset/swift-camels-draw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@urql/core': patch
---

Add deprecation notice for `maskTypename` option.
Masking typenames in a result is no longer recommended. It’s only
useful when multiple pre-conditions are applied and inferior to
mapping to an input object manually.
2 changes: 2 additions & 0 deletions packages/core/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ export interface ClientOptions {
*/
preferGetMethod?: boolean | 'force' | 'within-url-limit';
/** Instructs the `Client` to remove `__typename` properties on all results.
*
* @deprecated Not recommended over modelling inputs manually (See #3299)
*
* @remarks
* By default, cache exchanges will alter your GraphQL documents to request `__typename` fields
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/utils/maskTypename.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/** Used to recursively mark `__typename` fields in data as non-enumerable.
*
* @deprecated Not recommended over modelling inputs manually (See #3299)
*
* @remarks
* This utility can be used to recursively copy GraphQl response data and hide
Expand Down

0 comments on commit cbf338b

Please sign in to comment.