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.
Node & Blocklet Management
Queries for managing the lifecycle, status, and configuration of the node and blocklets.
User & Access Management
Queries for managing users, roles, permissions, sessions, and access keys.
Networking & Services
Queries for handling routing, domains, certificates, webhooks, and notifications.
Data & Operations
Queries for accessing backups, logs, analytics, and other operational data.
Publishing & Projects
Queries for managing publishing projects, releases, and related resources.
Complete List of Queries
For a quick overview, here is a complete list of all available query methods.
| Method | Description | Category |
|---|---|---|
getBlocklet | Retrieves detailed information about a specific blocklet. | Node & Blocklet Management |
getBlockletMetaFromUrl | Fetches blocklet metadata from a given URL. | Node & Blocklet Management |
getBlockletDiff | Compares a local blocklet with a remote version to get the difference. | Node & Blocklet Management |
getBlocklets | Lists all installed blocklets on the node. | Node & Blocklet Management |
getBlockletRuntimeHistory | Gets the runtime history (CPU, memory) for a blocklet. | Node & Blocklet Management |
getBlockletsFromBackup | Lists blocklets available in a backup. | Data & Operations |
getDynamicComponents | Retrieves dynamic components from a URL. | Node & Blocklet Management |
getNodeInfo | Fetches general information about the Blocklet Server node. | Node & Blocklet Management |
resetNodeStatus | Resets the status of the node. | Node & Blocklet Management |
getNodeEnv | Retrieves environment information of the node. | Node & Blocklet Management |
checkNodeVersion | Checks for available updates for the Blocklet Server. | Node & Blocklet Management |
getDelegationState | Gets the delegation state of the node. | Node & Blocklet Management |
getNodeRuntimeHistory | Gets the runtime history (CPU, memory) for the node. | Node & Blocklet Management |
getBlockletMeta | Retrieves the metadata for a specific blocklet. | Node & Blocklet Management |
getNotifications | Fetches a list of notifications. | Networking & Services |
makeAllNotificationsAsRead | Marks all notifications as read. | Networking & Services |
getNotificationSendLog | Retrieves the send log for notifications. | Networking & Services |
getReceivers | Gets a list of notification receivers. | Networking & Services |
getNotificationComponents | Retrieves components that can send notifications. | Networking & Services |
resendNotification | Resends a specific notification. | Networking & Services |
getRoutingSites | Fetches all configured routing sites. | Networking & Services |
getRoutingSnapshots | Retrieves snapshots of the routing configuration. | Networking & Services |
getSnapshotSites | Gets the sites from a specific routing snapshot. | Networking & Services |
getRoutingProviders | Lists available routing providers. | Networking & Services |
isDidDomain | Checks if a given domain is a DID domain. | Networking & Services |
getCertificates | Retrieves all SSL/TLS certificates. | Networking & Services |
checkDomains | Checks the status and configuration of specified domains. | Networking & Services |
findCertificateByDomain | Finds a certificate associated with a specific domain. | Networking & Services |
getAccessKeys | Lists all access keys. | User & Access Management |
getAccessKey | Retrieves a specific access key by its ID. | User & Access Management |
getWebHooks | Fetches all configured webhooks. | Networking & Services |
getWebhookSenders | Retrieves a list of available webhook senders. | Networking & Services |
sendTestMessage | Sends a test message to a webhook for verification. | Networking & Services |
getSession | Retrieves session information. | User & Access Management |
getRoles | Lists all user roles. | User & Access Management |
getRole | Retrieves details for a specific role. | User & Access Management |
getPermissions | Lists all available permissions. | User & Access Management |
getInvitations | Fetches all pending invitations. | User & Access Management |
getUsers | Retrieves a list of users. | User & Access Management |
getUser | Fetches details for a specific user. | User & Access Management |
getUserSessions | Lists active sessions for a user. | User & Access Management |
getUserSessionsCount | Gets the total count of user sessions. | User & Access Management |
getUsersCount | Retrieves the total number of users. | User & Access Management |
getUsersCountPerRole | Gets the count of users for each role. | User & Access Management |
getOwner | Retrieves the node owner's user information. | User & Access Management |
getPermissionsByRole | Lists permissions associated with a specific role. | User & Access Management |
getPassportIssuances | Fetches information about passport issuances. | User & Access Management |
logoutUser | Logs out a user session. | User & Access Management |
destroySelf | Allows a user to delete their own account. | User & Access Management |
getUserFollowers | Retrieves a list of a user's followers. | User & Access Management |
getUserFollowing | Retrieves a list of users that a user is following. | User & Access Management |
getUserFollowStats | Gets follow statistics for a user. | User & Access Management |
checkFollowing | Checks if one user is following another. | User & Access Management |
followUser | Follows a user. | User & Access Management |
unfollowUser | Unfollows a user. | User & Access Management |
getUserInvites | Retrieves a list of a user's invitees. | User & Access Management |
getTags | Retrieves a list of tags. | Data & Operations |
getAuditLogs | Fetches audit logs for tracking activities. | Data & Operations |
getLauncherSession | Retrieves session information from the Blocklet Launcher. | Node & Blocklet Management |
getBlockletBackups | Lists all backups for a specific blocklet. | Data & Operations |
getBlockletBackupSummary | Gets a summary of blocklet backup activities. | Data & Operations |
getBlockletSpaceGateways | Retrieves configured space gateways for a blocklet. | Node & Blocklet Management |
getTrafficInsights | Fetches traffic analytics and insights. | Data & Operations |
getProjects | Lists all publishing projects. | Publishing & Projects |
getProject | Retrieves details for a specific project. | Publishing & Projects |
getReleases | Lists all releases for a project. | Publishing & Projects |
getRelease | Fetches details for a specific release. | Publishing & Projects |
getSelectedResources | Gets the resources selected for a release. | Publishing & Projects |
getBlockletSecurityRule | Retrieves a specific security rule for a blocklet. | Networking & Services |
getBlockletSecurityRules | Lists all security rules for a blocklet. | Networking & Services |
getBlockletResponseHeaderPolicy | Gets a specific response header policy. | Networking & Services |
getBlockletResponseHeaderPolicies | Lists all response header policies. | Networking & Services |
getBlockletAccessPolicy | Retrieves a specific access policy. | Networking & Services |
getBlockletAccessPolicies | Lists all access policies. | Networking & Services |
getWebhookEndpoints | Retrieves a list of webhook endpoints. | Networking & Services |
getWebhookEndpoint | Fetches details of a single webhook endpoint. | Networking & Services |
getWebhookAttempts | Gets the delivery attempt history for a webhook. | Networking & Services |
getPassportRoleCounts | Counts the number of passports per role. | User & Access Management |
getPassportsByRole | Retrieves passports filtered by a specific role. | User & Access Management |
getPassportLogs | Fetches logs related to passport activities. | User & Access Management |
getRelatedPassports | Gets passports related to a given passport. | User & Access Management |
getBlockletBaseInfo | Retrieves basic information about a blocklet. | Node & Blocklet Management |
getDomainDNS | Fetches DNS information for a domain. | Networking & Services |
getOAuthClients | Lists all configured OAuth clients. | User & Access Management |
createOAuthClient | Creates a new OAuth client. | User & Access Management |
updateOAuthClient | Updates an existing OAuth client. | User & Access Management |
deleteOAuthClient | Deletes an OAuth client. | User & Access Management |
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.