From 947c1946f0fa45ddd7da959253927939c7ba9743 Mon Sep 17 00:00:00 2001 From: Greg Pstrucha <875316+Gricha@users.noreply.github.com> Date: Mon, 8 Aug 2022 18:05:31 -0700 Subject: [PATCH] Add small section about redacting data from input objects (#1013) --- docs/en/src/define_input_object.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/en/src/define_input_object.md b/docs/en/src/define_input_object.md index 6c65d741..0592fea1 100644 --- a/docs/en/src/define_input_object.md +++ b/docs/en/src/define_input_object.md @@ -94,3 +94,16 @@ pub struct YetAnotherInput { ``` You can pass multiple generic types to `params()`, separated by a comma. + +## Redacting sensitive data + +If any part of your input is considered sensitive and you wish to redact it, you can mark it with `secret` directive. For example: + +```rust +#[derive(InputObject)] +pub struct CredentialsInput { + username: String, + #[graphql(secret)] + password: String, +} +```