Books GraphQL API

Books / Authors / Reviews / Users GraphQL API a quick reference and a live tester.

Auth endpoints (REST)

MethodPathBody
POST/api/auth/signup{ name, email, password }
POST/api/auth/login{ email, password }
POST/api/auth/refreshuses refresh_token cookie
GET/api/auth/verifyuses access_token cookie
POST/api/auth/logoutclears cookies, revokes current refresh token
POST/api/auth/logout-allrequires auth; revokes every refresh token for the user

Login/signup set httpOnly access_token and refresh_token cookies. Once set, every request to this origin (including /graphql) sends them automatically.

GraphQL query features

books, authors, users, and reviews all use Relay-style cursor pagination: pass first/after to page forward or last/before to page backward. Each connection returns edges, pageInfo, and totalCount.

books, authors, and users also accept a filter (e.g. titleContains, nameContains, search, createdAfter, createdBefore) and a required sort input.

Mutations on Book and Review require login and can only be edited/deleted by their owner. Mutations on Author (createAuthor, updateAuthor, deleteAuthor) require an ADMIN account — try admin@example.com / Admin123! if you seeded the database.

Sample queries & mutations

Click a sample to load it into the tester below.

Try it

// response will appear here