fn check_field(&self, field: &unprocessed::Field, parent: &str) -> Vec<String> {
        let mut errors = vec![];

        // step 1: Check field return type
        let gsdl_field_type = self.data_map.get(&field.field_type.inner.name);
        match gsdl_field_type {
            Some(gsdl_item) => assert_eq!(*field.field_type.inner.name, *gsdl_item.name()),
            None => errors.push(format!(
                "{} field {} uses return type {}, but {} is not defined",
                parent, field.name, field.field_type.inner.name, field.field_type.inner.name
            )),
        };

        // step 2: Check field arguments
        for argument in &field.arguments {
            let gsdl_argument_type = self.data_map.get(&argument.argument_type.inner.name);
            match gsdl_argument_type {
                Some(gsdl_item) => {
                    assert_eq!(*argument.argument_type.inner.name, *gsdl_item.name())
                }
                None => errors.push(format!(
                    "{} field {}  argument {} references type {}, but {} is not defined",
                    parent,
                    field.name,
                    argument.name,
                    argument.argument_type.inner.name,
                    argument.argument_type.inner.name
                )),
            };
        }

        errors
    }
// check that field references known data
check that field references known data
check that field references known data
fn check_field(&self, field: &unprocessed::Field, parent: &str) -> Vec<String> {
        let mut errors = vec![];
        // step 1: Check field return type
        let gsdl_field_type = self.data_map.get(&field.field_type.inner.name);
        match gsdl_field_type {
            Some(gsdl_item) => assert_eq!(*field.field_type.inner.name, *gsdl_item.name()),
            None => errors.push(format!(
                "{} field {} uses return type {}, but {} is not defined",
                parent, field.name, field.field_type.inner.name, field.field_type.inner.name
            )),
        };
        // step 2: Check field arguments
        for argument in &field.arguments {
            let gsdl_argument_type = self.data_map.get(&argument.argument_type.inner.name);
            match gsdl_argument_type {
                Some(gsdl_item) => {
                    assert_eq!(*argument.argument_type.inner.name, *gsdl_item.name())
                }
                None => errors.push(format!(
                    "{} field {}  argument {} references type {}, but {} is not defined",
                    parent,
                    field.name,
                    argument.name,
                    argument.argument_type.inner.name,
                    argument.argument_type.inner.name
                )),
            };
        }
        errors
    }
fn check_field ( & self , field : & unprocessed :: Field , parent : & str ) -> Vec < String > { let mut errors = vec ! [ ] ; // step 1: Check field return type let gsdl_field_type = self . data_map . get ( & field . field_type . inner . name ) ; match gsdl_field_type { Some ( gsdl_item ) => assert_eq ! ( field field_type inner name gsdl_item name ( ) ) , None => errors . push ( format ! ( " " parent field name field field_type inner name field field_type inner name ) ) , } ; // step 2: Check field arguments for argument in & field . arguments { let gsdl_argument_type = self . data_map . get ( & argument . argument_type . inner . name ) ; match gsdl_argument_type { Some ( gsdl_item ) => { assert_eq ! ( argument argument_type inner name gsdl_item name ( ) ) } None => errors . push ( format ! ( " " parent field name argument name argument argument_type inner name argument argument_type inner name ) ) , } ; } errors }
check that field references known data
check that field references known data
&self
field
&unprocessed::Field
parent
&str