MCPcopy
hub / github.com/hasura/graphql-engine / buildMetadata

Method buildMetadata

cli/internal/projectmetadata/handler.go:148–155  ·  view source on GitHub ↗

buildMetadata is a private function because we don't intend consumers of this package to use the returned result (metadataobject.Metadata) directly because they may assume that they can use json.Marshal to get JSON representation of the built metadata. But this assumption will not hold true because

()

Source from the content-addressed store, hash-verified

146// unexpected results. Rather to get a JSON / YAML form of built metadata make use of Handler.BuildYAMLMetadata and
147// Handler.BuildJSONMetadata helper functions
148func (h *Handler) buildMetadata() (*Metadata, error) {
149 var op internalerrors.Op = "projectmetadata.Handler.buildMetadata"
150 metadataMap, err := h.buildMetadataMap()
151 if err != nil {
152 return nil, internalerrors.E(op, err)
153 }
154 return GenMetadataFromMap(metadataMap)
155}
156
157func (h *Handler) BuildYAMLMetadata() ([]byte, error) {
158 var op internalerrors.Op = "projectmetadata.Handler.BuildYAMLMetadata"

Callers 2

BuildYAMLMetadataMethod · 0.95
BuildJSONMetadataMethod · 0.95

Calls 2

buildMetadataMapMethod · 0.95
GenMetadataFromMapFunction · 0.85

Tested by

no test coverage detected