Queries
Queries are used to fetch data from the Blocklet Server. The @blocklet/server-js library provides a set of methods that correspond to the available GraphQL queries, making it easy to retrieve information without writing raw GraphQL.
All query methods are available under the client.queries property.
Get Node Information
import BlockletServerClient from '@blocklet/server-js';
// Initialize the client for a browser environment
const client = new BlockletServerClient();
async function fetchNodeInfo() {
try {
const { info } = await client.queries.getNodeInfo();
console.log('Node Name:', info.name);
console.log('Node Version:', info.version);
} catch (error) {
console.error('Failed to fetch node info:', error);
}
}
fetchNodeInfo();Query Categories#
The available queries are grouped into the following categories for easier navigation. Click on a category to see detailed information and examples for each query.
Complete List of Queries#
For a quick overview, here is a complete list of all available query methods.
Method | Description | Category |
|---|---|---|
| Retrieves detailed information about a specific blocklet. | |
| Fetches blocklet metadata from a given URL. | |
| Compares a local blocklet with a remote version to get the difference. | |
| Lists all installed blocklets on the node. | |
| Gets the runtime history (CPU, memory) for a blocklet. | |
| Lists blocklets available in a backup. | |
| Retrieves dynamic components from a URL. | |
| Fetches general information about the Blocklet Server node. | |
| Resets the status of the node. | |
| Retrieves environment information of the node. | |
| Checks for available updates for the Blocklet Server. | |
| Gets the delegation state of the node. | |
| Gets the runtime history (CPU, memory) for the node. | |
| Retrieves the metadata for a specific blocklet. | |
| Fetches a list of notifications. | |
| Marks all notifications as read. | |
| Retrieves the send log for notifications. | |
| Gets a list of notification receivers. | |
| Retrieves components that can send notifications. | |
| Resends a specific notification. | |
| Fetches all configured routing sites. | |
| Retrieves snapshots of the routing configuration. | |
| Gets the sites from a specific routing snapshot. | |
| Lists available routing providers. | |
| Checks if a given domain is a DID domain. | |
| Retrieves all SSL/TLS certificates. | |
| Checks the status and configuration of specified domains. | |
| Finds a certificate associated with a specific domain. | |
| Lists all access keys. | |
| Retrieves a specific access key by its ID. | |
| Fetches all configured webhooks. | |
| Retrieves a list of available webhook senders. | |
| Sends a test message to a webhook for verification. | |
| Retrieves session information. | |
| Lists all user roles. | |
| Retrieves details for a specific role. | |
| Lists all available permissions. | |
| Fetches all pending invitations. | |
| Retrieves a list of users. | |
| Fetches details for a specific user. | |
| Lists active sessions for a user. | |
| Gets the total count of user sessions. | |
| Retrieves the total number of users. | |
| Gets the count of users for each role. | |
| Retrieves the node owner's user information. | |
| Lists permissions associated with a specific role. | |
| Fetches information about passport issuances. | |
| Logs out a user session. | |
| Allows a user to delete their own account. | |
| Retrieves a list of a user's followers. | |
| Retrieves a list of users that a user is following. | |
| Gets follow statistics for a user. | |
| Checks if one user is following another. | |
| Follows a user. | |
| Unfollows a user. | |
| Retrieves a list of a user's invitees. | |
| Retrieves a list of tags. | |
| Fetches audit logs for tracking activities. | |
| Retrieves session information from the Blocklet Launcher. | |
| Lists all backups for a specific blocklet. | |
| Gets a summary of blocklet backup activities. | |
| Retrieves configured space gateways for a blocklet. | |
| Fetches traffic analytics and insights. | |
| Lists all publishing projects. | |
| Retrieves details for a specific project. | |
| Lists all releases for a project. | |
| Fetches details for a specific release. | |
| Gets the resources selected for a release. | |
| Retrieves a specific security rule for a blocklet. | |
| Lists all security rules for a blocklet. | |
| Gets a specific response header policy. | |
| Lists all response header policies. | |
| Retrieves a specific access policy. | |
| Lists all access policies. | |
| Retrieves a list of webhook endpoints. | |
| Fetches details of a single webhook endpoint. | |
| Gets the delivery attempt history for a webhook. | |
| Counts the number of passports per role. | |
| Retrieves passports filtered by a specific role. | |
| Fetches logs related to passport activities. | |
| Gets passports related to a given passport. | |
| Retrieves basic information about a blocklet. | |
| Fetches DNS information for a domain. | |
| Lists all configured OAuth clients. | |
| Creates a new OAuth client. | |
| Updates an existing OAuth client. | |
| Deletes an OAuth client. |
Next Steps#
Now that you know how to fetch data, the next step is to learn how to modify it. Continue to the Mutations section to explore how to create, update, and delete resources on the Blocklet Server.