grafbase_hooks_derive/lib.rs
1mod expand;
2
3use proc_macro::TokenStream;
4use syn::{parse_macro_input, ItemImpl};
5
6/// Registers the hook implementations to the gateway. This macro must be added to the
7/// local implementation of the `Hooks` trait.
8#[proc_macro_attribute]
9pub fn grafbase_hooks(_: TokenStream, input: TokenStream) -> TokenStream {
10 let item = parse_macro_input!(input as ItemImpl);
11 expand::expand(&item)
12}