Enum prima_bridge::GraphQLMultipart
source · pub enum GraphQLMultipart {
Single(/* private fields */),
Multiple(/* private fields */),
}
Expand description
A GraphQLRequest multipart body as according to this specification.
Only files can be included in the multipart body.
It can either be Single
(one file) or Multiple
(multiple files).
Variants§
Implementations§
source§impl GraphQLMultipart
impl GraphQLMultipart
sourcepub fn single(path: impl Into<String>, file: MultipartFile) -> Self
pub fn single(path: impl Into<String>, file: MultipartFile) -> Self
Creates a GraphQL multipart body containing a single file.
The path
parameter is the path to the field in the GraphQL variables
object
that will act as a placeholder for the uploaded file.
The field will be automatically injected into the variables
object: you don’t need to add it
to your existing variables struct.
sourcepub fn multiple(map: HashMap<impl Into<String>, Vec<MultipartFile>>) -> Self
pub fn multiple(map: HashMap<impl Into<String>, Vec<MultipartFile>>) -> Self
Creates a GraphQL multipart body containing a list of files or multiple lists of files.
Each key in the hash map is the path to the array field in the GraphQL variables
object that will act as a placeholder for the list of files corresponding to that key.
The fields will be automatically injected into the variables
object: you don’t need to add them
to your existing variables struct.