You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: codegen.rs
    path of file: ./repos/grafbase/cli/crates/typed-resolvers/src
    
    the code of the file until where you have to start completion: use crate::analyze::{AnalyzedSchema, BuiltinScalar, Definition, GraphqlType, ListWrapper, ObjectKind, TypeKind};
use std::fmt;

const INDENT: &str = "  ";
const DOUBLE_INDENT: &str = "    ";

pub(crate) fn generate_module<O>(schema: &AnalyzedSchema<'_>, out: &mut O) -> fmt::Result
where
    O: fmt::Write,
{
    out.write_str(HEADER)?;
    out.write_str("export type Schema = {\n")?;

    for definition in &schema.definitions {
        match definition {
            Definition::Object(id) => {
                let object_type = &schema[*id];
                let mut fields = schema.iter_object_fields(*id).peekable();

                if fields.peek().is_none() {
                    continue;
                }

                let object_type_name = object_type.name;
                let is_input_object = matches!(object_type.kind, ObjectKind::InputObject);

                maybe_docs(out, object_type.docs, INDENT)?;
                writeln!(out, "{INDENT}'{object_type_name}': {{")?;

                if let ObjectKind::Object = object_type.kind {
                    writeln!(out, "{DOUBLE_INDENT}__typena
    
fn write_resolver_type<O: fmt::Write>(schema: &AnalyzedSchema<'_>, out: &mut O) -> fmt::Result {
    let mut fields = schema
        .iter_fields()
        .filter(|(_, _, field)| field.resolver_name.is_some())
        .peekable();

    if fields.peek().is_none() {
        return Ok(());
    }

    out.write_str("\nimport { ResolverFn } from '@grafbase/sdk'\n\n")?;
    out.write_str("export type Resolver = {\n")?;

    for (object_id, field_id, field) in fields {
        let parent_object = &schema[*object_id];
        let parent_object_type_name = parent_object.name;
        let resolver_id = format!("{parent_object_type_name}.{}", field.name);
        let rendered_field_type = render_graphql_type(&field.r#type, schema);

        let mut arguments = String::from("{ ");

        for arg in schema.iter_field_arguments(field_id) {
            arguments.push_str(arg.name);
            arguments.push_str(": ");
            arguments.push_str(&render_graphql_type(&arg.r#type, schema));
            arguments.push_str(", ");
        }

        arguments.push_str(" }");

        writeln!(
            out,
            "{INDENT}'{resolver_id}': ResolverFn<Schema['{parent_object_type_name}'], {arguments}, {rendered_field_type}>"
        )?;
    }

    writeln!(out, "}}\n")