Expand description
Shared utilities for code generation targets.
Functions§
- reconstruct_
operation - Reconstruct a GraphQL operation document string from the IR.
- scalar_
to_ mock - Map a ScalarType to a sensible TypeScript mock default value.
- to_
hook_ name - Convert an operation name to a hook name. e.g. “GetUser” -> “useGetUser”
- to_
method_ name - Convert an operation name to a camelCase method name (lowercase first char). e.g. “GetUser” -> “getUser”, “CreatePost” -> “createPost”
- to_
mock_ data_ name - Convert an operation name to a mock data factory name. e.g. “GetUser” -> “mockGetUserData”
- to_
mock_ error_ name - Convert an operation name to a mock error handler name. e.g. “GetUser” -> “mockGetUserError”
- to_
mock_ name - Convert an operation name to a mock handler name. e.g. “GetUser” -> “mockGetUser”
- type_
to_ ts - Map a CompiledType to a TypeScript type string.
- variable_
to_ graphql - Map GraphQL variable type to its GraphQL SDL string representation. e.g. required String -> “String!”, optional Int -> “Int”