graphql-request
Version: 
Minimal GraphQL client supporting Node and browsers for scripts or simple apps.
14 lines (11 loc) • 305 B
text/typescript
import type { Directive } from '../../types.js'
const name = `include`
export const parseClientDirectiveInclude = (input: Directive.Include['$include']) => {
  const args = {
    if: typeof input === `boolean` ? input : input.if === undefined ? true : input.if,
  }
  return {
    name,
    args,
  }
}