Skip to main content

GraphQL Base Schema

Server State makes heavy use of an extensible GraphQL API.

While the complete schema depends on the extensions installed by the user, the following schema provides the base for every such schema. It can, thus, be trusted to exist during plugin/extension development.

Generated using graphql-markdown

Query

FieldArgumentTypeDescription
serverStateServerState!

The APIs for inspecting the server state. This is the core of the Server State ecosystem and what most plugins will interact with.

meUser

The currently authenticated user, if any

users[User!]!

List of all users. Accessible for admins only.

userByIdUser

Get user details based on their user id. Accessible for admins only.

idID!

The user's ID

userByEmailUser

Get user details based on their email address. Accessible for admins only.

emailString!

The user's email address

Mutation

FieldArgumentTypeDescription
loginLoginResponse!

A mutation to login using email and password and get a JWT token for authentication.

emailString!
passwordString!
addUserAddUserResponse!

Adds a new user. Accessible for admins only.

userAddUserInput!
removeUserRemoveUserResponse!

Removes a user. Accessible for admins only.

idID!

The user's user id

editUserEditUserResponse!

Edits an existing user. Specify the user you want to edit in the userEdits input's id field. Accessible for admins only.

userEditUserInput!

Objects

AddUserResponse

The data returned by the addUser mutation.

FieldArgumentTypeDescription
userUser!

The newly created user.

EditUserResponse

The data returned by the editUser mutation.

FieldArgumentTypeDescription
userUser!

The newly saved user details.

LoginResponse

The data returned by the login mutation.

FieldArgumentTypeDescription
tokenString!

A JWT token for authentication. Use the header Authorization: Bearer [token] in later API interactions.

meUser!

Details about the authenticated user.

RemoveUserResponse

The data returned by the removeUser mutation.

FieldArgumentTypeDescription
successBoolean!

true if deletion was successful, false otherwise.

ServerState

The ServerState type that represents every query about the server state. Extensions may extend this type with a property identical to their own ID to add additional "query-able" parameters. For example (with a plugin id of ABCDEF):

extend type ServerState {
ABCDEF: ABCDEF_State
}
type ABCDEF_State {
randomNumber: Int
}
FieldArgumentTypeDescription
timestampString

The timestamp of the query's execution

User

An object representing a single user

FieldArgumentTypeDescription
idID!

The user's unique ID

emailString!

The user's email address

roleUserRole

The user's role within the system

Inputs

AddUserInput

Input for the addUser mutation

FieldTypeDescription
emailString!

The user's email address.

passwordString

The new user's password. If not specified, the new user won't be able to login until the password gets reset.

roleUserRole

The new user's role. Defaults to user.

EditUserInput

Input for the editUser mutation

FieldTypeDescription
idID!

The (existing !) user id.

emailString

A new email address, if applicable.

roleUserRole

A new user role, if applicable.

Enums

UserRole

A user's role. This defines the user's privileges within the system.

ValueDescription
admin

An admin user with additional privileges (like managing other user accounts and installing extensions)

user

A "normal" user without any special privileges

Scalars

Boolean

The Boolean scalar type represents true or false.

ID

The ID scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as "4") or integer (such as 4) input value will be accepted as an ID.

JSON

A JSONSerializable value represented as its serialized JSON string.

String

The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.