graphql/graphql-get-user

Get User By ID

Retrieve a single user by ID

graphql
user
query

Command

curl -X POST http://localhost:4000/graphql -H 'Content-Type: application/json' -d '{"query":"{ user(id: 1) { id name email } }"}'

Explanation

Queries a specific user by their ID. Useful for detail views or when editing user-specific data.

Examples

Fetch user with ID 5

{ user(id: 5) { id name email } }