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

Function isCompositeType

packages/plugins/graphql/src/sdk/plugin.ts:377–383  ·  view source on GitHub ↗
(
  ref: IntrospectionTypeRef,
  types: ReadonlyMap<string, IntrospectionType>,
)

Source from the content-addressed store, hash-verified

375// not have one. Anything we cannot resolve in the type map is treated as a leaf
376// (custom scalars live in the map as SCALAR; truly-unknown types are rare).
377const isCompositeType = (
378 ref: IntrospectionTypeRef,
379 types: ReadonlyMap<string, IntrospectionType>,
380): boolean => {
381 const kind = types.get(unwrapTypeName(ref))?.kind;
382 return kind === "OBJECT" || kind === "INTERFACE" || kind === "UNION";
383};
384
385// A field whose argument is non-null without a default cannot be selected by the
386// generator: it has no value to pass and emitting the field without the argument

Callers 1

buildDefaultSelectionSetFunction · 0.85

Calls 2

unwrapTypeNameFunction · 0.70
getMethod · 0.65

Tested by

no test coverage detected