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

Function unwrapTypeName

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

Source from the content-addressed store, hash-verified

21
22/** Unwrap NON_NULL / LIST wrappers to get the leaf type name */
23const unwrapTypeName = (ref: IntrospectionTypeRef): string => {
24 if (ref.name) return ref.name;
25 if (ref.ofType) return unwrapTypeName(ref.ofType);
26 return "Unknown";
27};
28
29/** Check if a type ref is non-null (required) */
30const isNonNull = (ref: IntrospectionTypeRef): boolean => ref.kind === "NON_NULL";

Callers 1

extractFieldsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected