Creates a new GraphQLComponentRegistryClient instance.
The GraphQL data provider to use for queries
Check if a specific version of a component exists in a registry.
The parameters for checking component existence
A Promise that resolves to true if the component exists, false otherwise
Get the latest version of a component.
The component namespace
The component name
A Promise that resolves to the latest version string or null
Get a specific component from a registry.
This method fetches a component specification from an external registry through the MJ API server. The server handles authentication with the registry and may cache the result for performance.
The parameters for getting the component
A Promise that resolves to a ComponentSpec
Get a component from registry with hash and caching metadata. Returns the full response including hash and notModified flag.
Parameters for fetching the component
Full response with specification, hash, and caching metadata
Resolve the dependency tree for a component.
This method fetches the complete dependency tree for a component, including all transitive dependencies. The server handles circular dependency detection and marks them appropriately.
The registry ID
The component ID
A Promise that resolves to a ComponentDependencyTree
Search for components in registries.
This method searches for components across one or more registries based on the provided criteria. Results are paginated for performance.
The search parameters
A Promise that resolves to a RegistryComponentSearchResult
const searchResult = await registryClient.SearchRegistryComponents({
query: "dashboard",
type: "dashboard",
tags: ["analytics", "reporting"],
limit: 20,
offset: 0
});
console.log(`Found ${searchResult.total} components`);
searchResult.components.forEach(component => {
console.log(`- ${component.name}: ${component.description}`);
});
Send feedback for a component.
This is a registry-agnostic method that allows submitting feedback for any component from any registry. The feedback can include ratings, comments, and associations with conversations, reports, or dashboards.
The feedback parameters
A Promise that resolves to a ComponentFeedbackResponse
const response = await registryClient.SendComponentFeedback({
componentName: 'DataGrid',
componentNamespace: 'core/ui',
componentVersion: '1.0.0',
registryName: 'MJ',
rating: 5,
feedbackType: 'feature-request',
comments: 'Would love to see export to Excel functionality',
conversationID: 'conv-123'
});
if (response.success) {
console.log('Feedback submitted successfully!');
if (response.feedbackID) {
console.log(`Feedback ID: ${response.feedbackID}`);
}
} else {
console.error('Feedback submission failed:', response.error);
}
Client for executing Component Registry operations through GraphQL. This class provides an easy way to fetch components from external registries through the MJ API server, which handles authentication and caching.
The GraphQLComponentRegistryClient follows the same naming convention as other GraphQL clients in the MemberJunction ecosystem, such as GraphQLAIClient and GraphQLActionClient.
Example