Member Junction
    Preparing search index...

    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.

    // Create the client
    const registryClient = new GraphQLComponentRegistryClient(graphQLProvider);

    // Get a component from a registry
    const component = await registryClient.GetRegistryComponent({
    registryName: "MJ",
    namespace: "core/ui",
    name: "DataGrid",
    version: "1.0.0"
    });

    // Search for components
    const searchResult = await registryClient.SearchRegistryComponents({
    query: "dashboard",
    type: "dashboard",
    limit: 10
    });
    Index

    Constructors

    Methods

    • Get the latest version of a component.

      Parameters

      • registryName: string
      • namespace: string

        The component namespace

      • name: string

        The component name

      Returns Promise<string>

      A Promise that resolves to the latest version string or null

      const latestVersion = await registryClient.GetLatestVersion(
      "mj-central",
      "core/ui",
      "DataGrid"
      );

      console.log(`Latest version: ${latestVersion}`);
    • 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.

      Parameters

      Returns Promise<ComponentSpec>

      A Promise that resolves to a ComponentSpec

      const component = await registryClient.GetRegistryComponent({
      registryName: "MJ",
      namespace: "core/ui",
      name: "DataGrid",
      version: "2.0.0"
      });

      console.log('Component:', component.name);
      console.log('Description:', component.description);
      console.log('Code:', component.code);
    • 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.

      Parameters

      • registryId: string

        The registry ID

      • componentId: string

        The component ID

      Returns Promise<ComponentDependencyTree>

      A Promise that resolves to a ComponentDependencyTree

      const dependencyTree = await registryClient.ResolveComponentDependencies(
      "mj-central",
      "component-123"
      );

      console.log(`Component has ${dependencyTree.totalCount} total dependencies`);
      if (dependencyTree.circular) {
      console.warn('Circular dependency detected!');
      }
    • 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.

      Parameters

      • params: ComponentFeedbackParams

        The feedback parameters

      Returns Promise<ComponentFeedbackResponse>

      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);
      }