MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / formatTypeRef

Function formatTypeRef

packages/plugins/graphql/src/sdk/plugin.ts:360–366  ·  view source on GitHub ↗
(ref: IntrospectionTypeRef)

Source from the content-addressed store, hash-verified

358};
359
360const formatTypeRef = (ref: IntrospectionTypeRef): string =>
361 Match.value(ref.kind).pipe(
362 Match.when("NON_NULL", () => (ref.ofType ? `${formatTypeRef(ref.ofType)}!` : "Unknown!")),
363 Match.when("LIST", () => (ref.ofType ? `[${formatTypeRef(ref.ofType)}]` : "[Unknown]")),
364 Match.option,
365 Option.getOrElse(() => ref.name ?? "Unknown"),
366 );
367
368const unwrapTypeName = (ref: IntrospectionTypeRef): string => {
369 if (ref.name) return ref.name;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected