Allow specifying type for #[graphql_object]
#647
Labels
enhancement
Improvement of existing features or bugfix
#[graphql_object]
#647
Is your feature request related to a problem? Please describe.
Consider the following case:
In order to define extra field resolvers for a struct, I need to use the
graphql_object
macro:which generates
impl juniper::GraphQLType<juniper::DefaultScalarValue> for User
. However, I am also usingdiesel
and defining SQL queries inimpl User
, clearly I don't want those functions to be exposed as field resolvers forUser
object.Describe the solution you'd like
I am thinking to use a similar approach for objects-and-generics in the docs:
No sure if reading from an optional
_type
attribute would work, similar to thename
attribute:juniper/juniper_codegen/src/impl_object.rs
Line 34 in 358ca27
Thanks very much for the great library!
The text was updated successfully, but these errors were encountered: