Skip to content

An Example GraphQL Apollo Server 3 with Redis and Auth Working

Updated: at 02:12 PM

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!

Check out the ORM (Object Relational Mapper) PRISMA. The database access method I use in all my projects