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

Function formatTypeRef

packages/plugins/graphql/src/sdk/extract.ts:165–171  ·  view source on GitHub ↗
(ref: IntrospectionTypeRef)

Source from the content-addressed store, hash-verified

163
164/** Format a type ref back to GraphQL type notation (e.g. "[String!]!") */
165const formatTypeRef = (ref: IntrospectionTypeRef): string =>
166 Match.value(ref.kind).pipe(
167 Match.when("NON_NULL", () => (ref.ofType ? `${formatTypeRef(ref.ofType)}!` : "Unknown!")),
168 Match.when("LIST", () => (ref.ofType ? `[${formatTypeRef(ref.ofType)}]` : "[Unknown]")),
169 Match.option,
170 Option.getOrElse(() => ref.name ?? "Unknown"),
171 );
172
173// ---------------------------------------------------------------------------
174// Extract fields from schema

Callers 1

extractFieldsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected