MCPcopy Create free account
hub / github.com/glideapps/quicktype / getField

Function getField

src/GraphQL.ts:51–59  ·  view source on GitHub ↗
(t: GQLType, name: string)

Source from the content-addressed store, hash-verified

49}
50
51function getField(t: GQLType, name: string): Field {
52 if (!t.fields) return panic(`Required field ${name} in type ${t.name} which doesn't have fields.`);
53 for (const f of t.fields) {
54 if (f.name === name) {
55 return f;
56 }
57 }
58 return panic(`Required field ${name} not defined on type ${t.name}.`);
59}
60
61function makeTypeNames(
62 name: string,

Callers 1

GQLQueryClass · 0.85

Calls 1

panicFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…