For example, 'chat.example.com'
and 'localhost:8080'
are valid but 'http://chat.example.com'
is invalid.
A user's bio which cannot exceed 2,500 characters, disallows leading and trailing whitespace, and uses GitHub Flavored Markdown.
The user might want to give their message a context, such as when replying to a message sent several messages ago. In this case, this is the ID of the message being replied to.
A cursor for pagination.
Complies with ISO 8601.
At most 1,000 characters, disallows leading and trailing whitespace, and uses GitHub Flavored Markdown.
'NOT_INVITABLE'
: Users cannot join the chat via an invite code.'INVITABLE'
: Users can join the chat via an invite code.'PUBLIC'
: People can search for, and view public chats without an account. Invite codes are permanently turned on.
Anyone with an account can join a public chat. A frontend UI may allow for a search engine to index the chat should
the administrator allow for it. A chat must be made public when it's being created because chats can't switch between
being public after they've been created.1-70 characters, of which at least one isn't whitespace. Leading and trailing whitespace is disallowed.
HTTPS is strongly recommended for production.
The ID scalar type represents a unique identifier, often used to refetch an object or as the key for a cache. The ID type is serialized in the same way as a String; however, defining it as an ID signifies that it is not intended to be humanâreadable.
1-10,000 characters, of which at least one isn't whitespace. Uses GitHub Flavored Markdown. Leading and trailing whitespace is disallowed.
A name must neither contain whitespace nor exceed 30 characters.
A password which contains non-whitespace characters.
GraphQL mandates data be returned for every operation, and data be present in every type. However, certain operations and types don't have relevant data. This type, which is an empty string, indicates such.
A username must be 1-30 characters long. Only lowercase English letters (a-z), English numbers (0-9), periods, and underscores are allowed.
WSS is strongly recommended for production.
Reads an audio message. You needn't pass an access token if the chat is public.
Reads a doc message. You needn't pass an access token if the chat is public.
Retrieves the group chat's image. Otherwise, the user must be a participant to view the pic.
if the chat has a image, and null
otherwise.
Check if all systems are operational. For example, a backend developer building atop Omni Chat can program the server to automatically restart when it becomes "unhealthy".
Whether the backend is "healthy".
Reads the image from a message. To get the caption, use the GraphQL API. You needn't pass an access token if the chat is public.
if the user has a profile image, and null
if they don't.
Reads a video message. You needn't pass an access token if the chat is public.
Whether the value is a valid Bio.
Returns whether the value is a valid DateTime.
Whether the value is a valid GroupChatDescription.
Whether the value is a valid GroupChatTitle.
Whether the value is a valid MessageText.
Whether the value is a valid Name.
Whether the value is a valid Password.
Whether the value is a valid Username.
Whether the value is a valid Uuid.
Update the group chat's image. The user must be an admin of the chat.
Update the user's profile image.
Creates an audio message.
Creates a doc message.
Creates an image message.
Creates a video message.
Executes a GraphQL query or mutation.
Creates a GraphQL subscription.
For example, if the subscription is hosted on http://localhost/accounts-subscription, this should be
'/accounts-subscription'
.
GraphQL document (i.e., the query to send to the GraphQL server).
Generated using TypeDoc
Omni Chat API JavaScript wrapper library.
The Omni Chat API consists of a REST API, and a GraphQL API.
The REST API is used for tasks not well suited for GraphQL such as image uploads. Use the wrapper functions which have the same name as the operation name in Omni Chat Backend's REST API docs (e.g., getProfileImage) to interact with the REST API.
In order to avoid the under-fetching and over-fetching problems posed by REST APIs, the GraphQL API is the primary interface. Use the queryOrMutate and subscribe functions to handle queries and mutations, and subscriptions respectively.
Use the
isValid*Scalar()
(e.g., isValidUsernameScalar) functions to validate GraphQL scalars.