Is it possible to block a variable "property" from entering up in studio traces? Or only the variable as a whole?

Hello Everyone,

I have the following query operation:

query testing($where: ProfileWhereInput) {
 profiles(where: $where){

with the following variable:

{ "where": {"email": ""} }

What I would like to achieve is preventing the “email” from entering up in the traces of studio. I can achieve this with the following plugin:

         sendVariableValues: { exceptNames: ['where'] },

But this would block the complete “where” variable all together. For instance, the following where var, which I would like to see in traces, would also be completely blocked:

{ "where": {"id": "someid"} }

Is there a way to allow but block I tried (which didn’t work):

         sendVariableValues: { exceptNames: ['email'] },

I would like to either only allow certain variable properties or deny others? But as far as I can see, these rules only apply to the whole variable. All ideas are welcome?

For a second I thought to have found a solution in using the translate option:

          sendVariableValues: { transform: options => {
   = '******';
            return options;
          } },

But this has impact on the query execution. The query will also be executed with where { email: “*****”

See also: Surprising behavior if `sendVariableValues.transform` mutates `variables` · Issue #5060 · apollographql/apollo-server · GitHub

Fixed it by doing a deepclone so this post could be closed for now. Still quite a strange behavior tho.

Hello, thanks for the post and followups! Your solution using transform is correct, and you’re also right that this need for a deep copy should be more apparent in the docs.