Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
JonahPlusPlus opened this issue Jul 30, 2024 · 0 comments
Open

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

JonahPlusPlus opened this issue Jul 30, 2024 · 0 comments
Labels
enhancement Improvement of existing features or bugfix

Comments

@JonahPlusPlus
Copy link

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.

@JonahPlusPlus JonahPlusPlus added the enhancement Improvement of existing features or bugfix label Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement of existing features or bugfix
Projects
None yet
Development

No branches or pull requests

1 participant