graphql-request
Version:
Minimal GraphQL client supporting Node and browsers for scripts or simple apps.
13 lines (10 loc) • 378 B
text/typescript
import type { FieldName } from './FieldName.js'
import { parseClientFieldName } from './FieldName.js'
import type { On } from './on.js'
import { parseClientOn } from './on.js'
export type FieldItem = On | FieldName
export const parseClientFieldItem = (field: string): FieldItem => {
const on = parseClientOn(field)
if (on) return on
return parseClientFieldName(field)
}