These are examples of queries to fetch user data and log the user in.

Fetching users permalink

A single user with his/her posts:

A list of 5 users, ordered by name:

A list of predefined users, accessing their roles. Field roles is public in the demo site; for your site, you can restrict who can access it through an access control list:

Filtering users by name:

Logging the user in and out permalink

Logging the user in is required to execute mutations (create a post, add a comment, etc).

This query logs the user in (execute it to log in to the demo site, using a test account with role subscriber):

To retrieve the logged-in user:

Log the user out:

Share on 🐦 Twitter | πŸ‘ŽπŸΎ Facebook