TedDriggs / darling

A Rust proc-macro attribute parser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for attributes using arbitrary Expr

AlbertMarashi opened this issue · comments

Description of the feature

Forcing users to wrap the attributes in a string is annoying for ergonomics.

#[graphql(guard = "ScopeGuard::new(\"profile:read:email\")")]

Would like to be able to

#[graphql(guard = ScopeGuard::new("profile:read:email"))]

Adding the ability to darling to be able to support expressions as fields would be a great win for ergonomics

async-graphql issue:
async-graphql/async-graphql#1295

Support for this was added in darling 0.20; once async-graphql takes the latest version of darling this will be addressed.

Please see #229 for an ongoing discussion of how crate authors should decide what a quote-wrapped value means for Expr-receiving meta items.