An Example GraphQL Apollo Server 3 with Redis and Auth Working

Posted by Peter G Kellner on February 11, 2022 · 1 min read

The repository that includes the source

https://github.com/pkellner/apollo-server-3-with-cache-redis

All you have to do is

npm install

npm start

And you are good to go. You’ll get a GraphQL playground that you can type your queries into. Try this one, or in the readme to test auth.

  {
    hello {
      value
    }
    membership {
      id
      firstName
      lastName
    }
  }

You can browse to the final running URL here:

localhost:/graphql

Here is the playground:

And what the Redis data looks like

Enjoy!