MCPcopy
hub / github.com/directus/directus / field

Function field

api/src/services/graphql/schema/parse-query.test.ts:7–14  ·  view source on GitHub ↗
(name: string, opts?: { alias?: string; args?: any[]; children?: any[] })

Source from the content-addressed store, hash-verified

5
6// AST node helpers
7const field = (name: string, opts?: { alias?: string; args?: any[]; children?: any[] }) =>
8 ({
9 kind: 'Field',
10 name: { value: name },
11 ...(opts?.alias && { alias: { value: opts.alias } }),
12 ...(opts?.args && { arguments: opts.args }),
13 ...(opts?.children && { selectionSet: { selections: opts.children } }),
14 }) as unknown as SelectionNode;
15
16const inlineFragment = (type: string, children: any[]) =>
17 ({

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected