Skip to main content

useBlueprint

Hook to fetch a Blueprint from the DMSS API

Parameters

NameTypeOptionalDescription
typeRefstringFalseThe reference to the blueprint to retrieve

Returns

A list containing the blueprint document, a boolean representing the loading state, and an Error, if any.

Usage

Code example:

import { useBlueprint } from '@data-modelling-tool/core'

const [blueprint, isLoading, error] = useBlueprint('someType')
if (isLoading) return <div>Loading...</div>
if (error) return <div>Error getting the blueprint</div>

if (blueprint) {
  return (<p>Blueprint: {blueprint?.name} ({blueprint?.type})</p>)
}