Skip to content
This repository has been archived by the owner on May 12, 2024. It is now read-only.

Support generated root query for async-graphql #69

Open
chipsenkbeil opened this issue Apr 20, 2021 · 1 comment
Open

Support generated root query for async-graphql #69

chipsenkbeil opened this issue Apr 20, 2021 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@chipsenkbeil
Copy link
Owner

Rather than having to hand-write all of the methods for the async-graphql query, it would be nice if we could use something like inventory leveraging ctor or the alternative linkme.

This would need to support compile-time usage of one of these in order to gather all of the defined instances and then gather them into a single query using a macro. Not sure if this is possible right now.

@chipsenkbeil chipsenkbeil added the enhancement New feature or request label Apr 20, 2021
@chipsenkbeil chipsenkbeil added this to the Backlog milestone Apr 20, 2021
@chipsenkbeil
Copy link
Owner Author

Instead of doing the above, a simpler way would to be to support an attribute macro on the impl block of a graphql struct.

pub struct Query;

#[async_graphql::Object]
impl Query {
    // ...
}

would instead become

pub struct Query;

#[entity_async_graphql::query(
    Page,
    BlockElement,
)]
impl Query {
    // ...
}

Need to figure out how to account for diff between enum & struct types as well as handling lifetimes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant