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

Support for Multi-File Root Query Definitions Without Conflicting Implementations #1312

Open
noemaireamiot opened this issue Feb 26, 2025 · 0 comments

Comments

@noemaireamiot
Copy link

Hi,

I’m currently using Juniper 0.16.1 and want to split my root queries across multiple files (to keep each domain’s logic separate). My goal is for all fields to appear at the top-level QueryRoot, but I want each file to provide its own set of fields.

Right now, if I annotate each file’s impl QueryRoot { ... } with #[graphql_object], I get a "conflicting implementations" error for GraphQLType. I used to solve this with juniper_compose but that crate no longer supports 0.16.

Is there an official or recommended way to have multiple partial #[graphql_object] impl blocks for the same QueryRoot in Juniper 0.16? Or is there a plan to provide a plugin or crate (similar to juniper_compose) to unify separate query definitions into one root object without conflicting trait implementations?

I’m aware I can create a single impl QueryRoot with #[graphql_object] and delegate the actual logic to separate functions in each file, but that requires aggregating all fields in one place. For maintainability, I’d like to keep each domain fully self-contained—including its own #[graphql_object] block—and still have them end up on the same GraphQL root.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant