diff --git a/src/pages/docs/transport/graphql.md b/src/pages/docs/transport/graphql.md index 9c6b3a8..52a3d8a 100644 --- a/src/pages/docs/transport/graphql.md +++ b/src/pages/docs/transport/graphql.md @@ -117,7 +117,6 @@ app.use( ); ``` - ## Authenticating Resolvers You can authenticate your own resolvers with `JSAccounts` authentication flow, by using `authenticated` method from this package. @@ -132,10 +131,13 @@ import { authenticated } from '@accounts/graphql-api'; export const resolver = { Mutation: { - updateUserProfile: authenticated(AccountsServer, (rootValue, args, context) => { - // Write your resolver here - // context.user - the current authenticated user! - }), + updateUserProfile: authenticated( + AccountsServer, + (rootValue, args, context) => { + // Write your resolver here + // context.user - the current authenticated user! + } + ), }, }; ``` @@ -234,7 +236,7 @@ const accountsGraphQL = new GraphQLClient({ }); ``` -## Using with Apollo Link +## Using with Apollo Link In order to send the accounts token on every request sent to your GraphQL server, apollo requires you to implment an apollo-link. This link is usually quite generic when using accounts-js so we've implmeneted the apollo-link you need and offer it as a utility package. @@ -256,4 +258,4 @@ export const apolloClient = new ApolloClient({ link: ApolloLink.from([authLink, httpLink]), cache, }); -``` \ No newline at end of file +```