Skip to content

Implement juniper_graphql_ws::Schema for &'static RootNode #1268

Open
@JonahPlusPlus

Description

@JonahPlusPlus

Is your feature request related to a problem? Please describe.
Currently, the Schema trait is only implemented for Arc<RootNode>. Arc creates overhead that can be avoided for permanent resources.

Describe the solution you'd like
Implement Schema for &'static RootNode or for types that implement Deref<Target = RootNode> (or could Schema just be replaced with Deref?).
Then, users can create a static reference via Box::leak.

Describe alternatives you've considered
Right now, I'm just using a newtype to implement Schema. It works, but feels like boilerplate.

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