1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
use proc_macro2::TokenStream; pub fn fragment_arguments_derive(ast: &syn::DeriveInput) -> Result<TokenStream, syn::Error> { use quote::quote; let ident = &ast.ident; Ok(quote! { impl ::cynic::FragmentArguments for #ident {} impl<'a> ::cynic::FromArguments<&'a #ident> for &'a () { fn from_arguments(_: &#ident) -> &() { &() } } }) }