Skip to content

Commit

Permalink
docs: sendVariableValues.transform should not mutate (#5061)
Browse files Browse the repository at this point in the history
See #5060.
  • Loading branch information
glasser committed Mar 26, 2021
1 parent 318483b commit 0ec7351
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/source/api/plugin/usage-reporting.md
Expand Up @@ -356,7 +356,7 @@ Specify this function to create a signature for a query. This option is not reco
| `{ all: true }` | If you provide this object, **all** GraphQL variable values are sent to Apollo Studio. |
| `{ onlyNames: ["apple", "orange"]}`| If you provide an object with this structure, only values of the GraphQL variables with names that appear in the array are sent to Apollo Studio. Case-sensitive. |
| `{ exceptNames: ["apple", "orange"]}`| If you provide an object with this structure, all GraphQL variable values **except** values of variables with names that appear in the array are sent to Apollo Studio. Case-sensitive. |
| `{ transform: ({ variables, operationString)} => { ... } }` | <p>The value of `transform` is a function that takes the values of all GraphQL variables for an operation. The function should modify or delete necessary values in the `variables` map and return the result. You cannot _add_ variables to the map.</p><p>For security reasons, if an error occurs in the `transform` function, **all** variable values are replaced with `[PREDICATE_FUNCTION_ERROR]`. |
| `{ transform: ({ variables, operationString)} => { ... } }` | <p>The value of `transform` is a function that takes the values of all GraphQL variables for an operation and the operation string. The function returns a new variables map containing values for the operation's variables that should be sent to Apollo Studio. This map does not need to contain all of the operation's variables, but it cannot _add_ variables to the map. You should not mutate `variables` itself or any of the values contained in it.</p><p>For security reasons, if an error occurs in the `transform` function, **all** variable values are replaced with `[PREDICATE_FUNCTION_ERROR]`. |

#### Valid `sendHeaders` object signatures

Expand Down

0 comments on commit 0ec7351

Please sign in to comment.