toSdl method

String? toSdl()

Built GraphQL SDL.

Implementation

String? toSdl() {
  Object? result = _objectBuilder(value);

  // If result is null return null.
  if (result == null) return null;

  // If result.zero is PrismaNull, return built SDL.
  if (result is PrismaNull) return '$key: null';

  final String? sdl = _sdlBuilder(result);
  if (sdl == null) return null;

  return '$key: $sdl';
}