# removeTypenameFromVariables is not removing \_\_typeName from variables

**URL:** <https://community.apollographql.com/t/removetypenamefromvariables-is-not-removing-typename-from-variables/6708>\
**Category:** Client SDKs\
**Tags:** client\
**Created:** [September 12, 2023, 12:54pm UTC](https://community.apollographql.com/t/removetypenamefromvariables-is-not-removing-typename-from-variables/6708 "2023-09-12T12:54:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nicole\_Zamora](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/nicole_zamora/32/1196_2.png) [@Nicole\_Zamora](https://community.apollographql.com/u/Nicole_Zamora)\
**Post date:** [September 12, 2023, 12:54pm UTC](https://community.apollographql.com/t/removetypenamefromvariables-is-not-removing-typename-from-variables/6708/1 "2023-09-12T12:54:19Z")

</div>

Hello!  
I am using the data from a GraphQL query as an argument for a mutation and I am seeing errors because `__typename` is not recognized. This is a known issue and is meant to be addressed by the function [RemoveTypenameFromVariables](https://www.apollographql.com/docs/react/api/link/apollo-link-remove-typename/)

I followed the instructions in the apollo article, and called

```Typescript
import { removeTypenameFromVariables } from '@apollo/client/link/remove-typename';

// Inside my JSX component, I called
const removeTypenameLink = removeTypenameFromVariables();

```

After calling this function, I am still seeing the same error related to `__typename` not being recognized. Curious to know if there is an additional step missing in the apollo docs.

I am using “@apollo/client”: “^3.8.3”

Error

> Message: Variable “$input” got invalid value { \_\_typename: “MeasurementObservationValue”, measurement: 85804, units: “cm” } at “input.patientObservations.fundalHeight”; Field “\_\_typename” is not defined by type “MeasurementObservationValueInput”.

---

<div class="post-metadata">

**Author:** ![lenz](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/lenz/32/4007_2.png) [@lenz](https://community.apollographql.com/u/lenz)\
**Post date:** [September 12, 2023, 1:10pm UTC](https://community.apollographql.com/t/removetypenamefromvariables-is-not-removing-typename-from-variables/6708/2 "2023-09-12T13:10:06Z")

</div>

`removeTypenameFromVariables` gives you a Link - just calling it by itself in a component will not do anything. You will have to add that Link to your link chain when creating your ApolloClient instance:

```auto
const removeTypenameLink = removeTypenameFromVariables();

const client = new ApolloClient({
  // ... cache, etc
  link: ApolloLink.from([
    removeTypenameLink,
    // your other links
    yourHttpLink
  ])
})

```

---

<div class="post-metadata">

**Author:** ![Nicole\_Zamora](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/nicole_zamora/32/1196_2.png) [@Nicole\_Zamora](https://community.apollographql.com/u/Nicole_Zamora)\
**Post date:** [September 13, 2023, 5:30pm UTC](https://community.apollographql.com/t/removetypenamefromvariables-is-not-removing-typename-from-variables/6708/3 "2023-09-13T17:30:19Z")

</div>

Thanks for the clarification! This makes more sense now.

---

<div class="post-metadata">

**Author:** ![Justin\_Gonzalez](https://sea1.discourse-cdn.com/flex019/user_avatar/community.apollographql.com/justin_gonzalez/32/5359_2.png) [@Justin\_Gonzalez](https://community.apollographql.com/u/Justin_Gonzalez)\
**Post date:** [February 6, 2025, 8:48pm UTC](https://community.apollographql.com/t/removetypenamefromvariables-is-not-removing-typename-from-variables/6708/4 "2025-02-06T20:48:14Z")

</div>

Archived on February 6, 2025, 8:48pm UTC


