Skip to main content

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

javascript
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.

MethodDescriptionCategory
getBlockletRetrieves detailed information about a specific blocklet.Node & Blocklet Management
getBlockletMetaFromUrlFetches blocklet metadata from a given URL.Node & Blocklet Management
getBlockletDiffCompares a local blocklet with a remote version to get the difference.Node & Blocklet Management
getBlockletsLists all installed blocklets on the node.Node & Blocklet Management
getBlockletRuntimeHistoryGets the runtime history (CPU, memory) for a blocklet.Node & Blocklet Management
getBlockletsFromBackupLists blocklets available in a backup.Data & Operations
getDynamicComponentsRetrieves dynamic components from a URL.Node & Blocklet Management
getNodeInfoFetches general information about the Blocklet Server node.Node & Blocklet Management
resetNodeStatusResets the status of the node.Node & Blocklet Management
getNodeEnvRetrieves environment information of the node.Node & Blocklet Management
checkNodeVersionChecks for available updates for the Blocklet Server.Node & Blocklet Management
getDelegationStateGets the delegation state of the node.Node & Blocklet Management
getNodeRuntimeHistoryGets the runtime history (CPU, memory) for the node.Node & Blocklet Management
getBlockletMetaRetrieves the metadata for a specific blocklet.Node & Blocklet Management
getNotificationsFetches a list of notifications.Networking & Services
makeAllNotificationsAsReadMarks all notifications as read.Networking & Services
getNotificationSendLogRetrieves the send log for notifications.Networking & Services
getReceiversGets a list of notification receivers.Networking & Services
getNotificationComponentsRetrieves components that can send notifications.Networking & Services
resendNotificationResends a specific notification.Networking & Services
getRoutingSitesFetches all configured routing sites.Networking & Services
getRoutingSnapshotsRetrieves snapshots of the routing configuration.Networking & Services
getSnapshotSitesGets the sites from a specific routing snapshot.Networking & Services
getRoutingProvidersLists available routing providers.Networking & Services
isDidDomainChecks if a given domain is a DID domain.Networking & Services
getCertificatesRetrieves all SSL/TLS certificates.Networking & Services
checkDomainsChecks the status and configuration of specified domains.Networking & Services
findCertificateByDomainFinds a certificate associated with a specific domain.Networking & Services
getAccessKeysLists all access keys.User & Access Management
getAccessKeyRetrieves a specific access key by its ID.User & Access Management
getWebHooksFetches all configured webhooks.Networking & Services
getWebhookSendersRetrieves a list of available webhook senders.Networking & Services
sendTestMessageSends a test message to a webhook for verification.Networking & Services
getSessionRetrieves session information.User & Access Management
getRolesLists all user roles.User & Access Management
getRoleRetrieves details for a specific role.User & Access Management
getPermissionsLists all available permissions.User & Access Management
getInvitationsFetches all pending invitations.User & Access Management
getUsersRetrieves a list of users.User & Access Management
getUserFetches details for a specific user.User & Access Management
getUserSessionsLists active sessions for a user.User & Access Management
getUserSessionsCountGets the total count of user sessions.User & Access Management
getUsersCountRetrieves the total number of users.User & Access Management
getUsersCountPerRoleGets the count of users for each role.User & Access Management
getOwnerRetrieves the node owner's user information.User & Access Management
getPermissionsByRoleLists permissions associated with a specific role.User & Access Management
getPassportIssuancesFetches information about passport issuances.User & Access Management
logoutUserLogs out a user session.User & Access Management
destroySelfAllows a user to delete their own account.User & Access Management
getUserFollowersRetrieves a list of a user's followers.User & Access Management
getUserFollowingRetrieves a list of users that a user is following.User & Access Management
getUserFollowStatsGets follow statistics for a user.User & Access Management
checkFollowingChecks if one user is following another.User & Access Management
followUserFollows a user.User & Access Management
unfollowUserUnfollows a user.User & Access Management
getUserInvitesRetrieves a list of a user's invitees.User & Access Management
getTagsRetrieves a list of tags.Data & Operations
getAuditLogsFetches audit logs for tracking activities.Data & Operations
getLauncherSessionRetrieves session information from the Blocklet Launcher.Node & Blocklet Management
getBlockletBackupsLists all backups for a specific blocklet.Data & Operations
getBlockletBackupSummaryGets a summary of blocklet backup activities.Data & Operations
getBlockletSpaceGatewaysRetrieves configured space gateways for a blocklet.Node & Blocklet Management
getTrafficInsightsFetches traffic analytics and insights.Data & Operations
getProjectsLists all publishing projects.Publishing & Projects
getProjectRetrieves details for a specific project.Publishing & Projects
getReleasesLists all releases for a project.Publishing & Projects
getReleaseFetches details for a specific release.Publishing & Projects
getSelectedResourcesGets the resources selected for a release.Publishing & Projects
getBlockletSecurityRuleRetrieves a specific security rule for a blocklet.Networking & Services
getBlockletSecurityRulesLists all security rules for a blocklet.Networking & Services
getBlockletResponseHeaderPolicyGets a specific response header policy.Networking & Services
getBlockletResponseHeaderPoliciesLists all response header policies.Networking & Services
getBlockletAccessPolicyRetrieves a specific access policy.Networking & Services
getBlockletAccessPoliciesLists all access policies.Networking & Services
getWebhookEndpointsRetrieves a list of webhook endpoints.Networking & Services
getWebhookEndpointFetches details of a single webhook endpoint.Networking & Services
getWebhookAttemptsGets the delivery attempt history for a webhook.Networking & Services
getPassportRoleCountsCounts the number of passports per role.User & Access Management
getPassportsByRoleRetrieves passports filtered by a specific role.User & Access Management
getPassportLogsFetches logs related to passport activities.User & Access Management
getRelatedPassportsGets passports related to a given passport.User & Access Management
getBlockletBaseInfoRetrieves basic information about a blocklet.Node & Blocklet Management
getDomainDNSFetches DNS information for a domain.Networking & Services
getOAuthClientsLists all configured OAuth clients.User & Access Management
createOAuthClientCreates a new OAuth client.User & Access Management
updateOAuthClientUpdates an existing OAuth client.User & Access Management
deleteOAuthClientDeletes 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.