dynamic_graphql/
upload.rs

1use async_graphql::dynamic;
2use async_graphql::dynamic::Type;
3use async_graphql::dynamic::ValueAccessor;
4use async_graphql::Upload;
5use std::borrow::Cow;
6
7use crate::errors::InputValueResult;
8use crate::from_value::FromValue;
9use crate::registry::Registry;
10use crate::types::InputTypeName;
11use crate::types::Register;
12use crate::types::TypeName;
13
14impl TypeName for Upload {
15    fn get_type_name() -> Cow<'static, str> {
16        dynamic::TypeRef::UPLOAD.into()
17    }
18}
19
20impl InputTypeName for Upload {}
21
22impl FromValue for Upload {
23    fn from_value(value: async_graphql::Result<ValueAccessor>) -> InputValueResult<Self> {
24        Ok(value?.upload()?)
25    }
26}
27
28impl Register for Upload {
29    fn register(registry: Registry) -> Registry {
30        registry.register_type(Type::Upload)
31    }
32}