From e639710006dd1d5f019b4d6f2ea2d074a25f1868 Mon Sep 17 00:00:00 2001 From: Christian Genco Date: Wed, 28 Mar 2018 16:25:21 -0500 Subject: [PATCH] update depreciated reference of `pat` to `rootToken` --- .../06-Auth/02-Authentication/02-Authentication-Tokens.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/0.x/04-Reference/06-Auth/02-Authentication/02-Authentication-Tokens.md b/docs/0.x/04-Reference/06-Auth/02-Authentication/02-Authentication-Tokens.md index 0c21f92f7..2eefd7707 100644 --- a/docs/0.x/04-Reference/06-Auth/02-Authentication/02-Authentication-Tokens.md +++ b/docs/0.x/04-Reference/06-Auth/02-Authentication/02-Authentication-Tokens.md @@ -130,16 +130,16 @@ If you don't pass the token name to the command, it will simply print the names Root tokens are particularly useful inside [functions](!alias-aiw4aimie9) to authenticate requests against the service's API. The input `event` for functions carries a _temporary_ root token that you can access as follows: ```js -module.exports = function(event) { +export default event => { - const rootToken = event.context.graphcool.pat + const { rootToken } = event.context.graphcool; // ... } ``` -> `pat` stands for _permanent access token_ which is the deprecated term for a root token. +> you may see references to `pat` (_permanent access token_), which is depreciated in favor of `rootToken`. When using the `fromEvent` function from [`graphcool-lib`](https://github.com/graphcool/graphcool-lib) to create a GraphQL client for your service's API, the root token will automatically be set in the `Authorization` header.