Skip to content

juniper::object generated code scope is not isolated #465

Closed
@ghost

Description

juniper::object() macro generates a lambda that has access to the rest of the scope. This is unsafe since the user can access any symbol of the code when juniper::object() expands.
This is the code I am talking about:

let resolver_code = quote!(
(|| #return_ty {
#( #resolve_parts )*
#body
})()
);

It would be better to define a fn and give it the needed arguments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementImprovement of existing features or bugfix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions