MCPcopy Create free account
hub / github.com/StarpTech/FastGraph / enter

Function enter

src/graphql-utils.ts:104–126  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

102 ast,
103 visitWithTypeInfo(typeInfo, {
104 enter(node) {
105 if (node.kind === 'FragmentSpread' || node.kind === 'InlineFragment') {
106 const type = typeInfo.getParentType()
107 if (type) {
108 if (
109 type.astNode?.kind === 'InterfaceTypeDefinition' ||
110 type.astNode?.kind === 'ObjectTypeDefinition'
111 ) {
112 result = !!type.astNode?.fields?.some((field) =>
113 hasAuthDirective(field, directiveName),
114 )
115 } else {
116 result = hasAuthDirective(type.astNode, directiveName)
117 }
118 }
119 } else if (node.kind === 'Field') {
120 const field = typeInfo.getFieldDef()
121 if (field) {
122 result = hasAuthDirective(field.astNode, directiveName)
123 }
124 }
125 if (result) return BREAK
126 },
127 }),
128 )
129

Callers

nothing calls this directly

Calls 1

hasAuthDirectiveFunction · 0.85

Tested by

no test coverage detected