INNER CODE UNIT · TypeScript

alias

acro5piano/typed-graphqlify · src/graphqlify.ts:117

export function alias<T extends string>(alias: T, target: string): T {
  return `${alias}:${target}` as T
}

/**
 * Use the `fragment` helper to create GraphQL Fragment, and spread the result into places the fragment is used.
 *
 * ```typescript
 * import { alias, fragment, query } from 'typed-graphqlify'
 *
 * const bankAccountFragment = fragment('bankAccountFragment', 'BankAccount', {
 *   id: types.number,
 *   branch: types.string,
 * })
 *
 * const userFragment = fragment('userFragment', 'User', {
 *   id: types.number,
 *   name: types.string,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…