Macro apollo_compiler::ty
source ยท macro_rules! ty { ($name: ident) => { ... }; ($name: ident !) => { ... }; ([ $($tt: tt)+ ]) => { ... }; ([ $($tt: tt)+ ]!) => { ... }; }
Expand description
Create a static Type with GraphQL-like syntax
use apollo_compiler::ty;
assert_eq!(ty!(Obj).to_string(), "Obj");
assert_eq!(ty!(Obj!).to_string(), "Obj!");
assert_eq!(ty!([Obj]).to_string(), "[Obj]");
assert_eq!(ty!([Obj]!).to_string(), "[Obj]!");
assert_eq!(ty!([[[Obj ] !]]!).to_string(), "[[[Obj]!]]!");