pub enum GraphqlKind {
AsyncGraphql,
}Expand description
A GraphQL backend a record may be rendered by.
One variant today, and the vocabulary exists anyway: a closed framework-owned list, the same
shape DatabaseKind takes, so a second backend is an arm rather than a redesign.
Variants§
AsyncGraphql
async-graphql.
Implementations§
Source§impl GraphqlKind
impl GraphqlKind
Sourcepub const fn output_object(self) -> &'static str
pub const fn output_object(self) -> &'static str
The ATTRIBUTE this backend’s OUTPUT types carry — an impl-position macro over the object’s ACCESSORS, and not a derive over its members.
§#[Object] and not SimpleObject, which is a repair rather than a preference
This slot answered ::async_graphql::SimpleObject until the accessor law landed, and the two
rulings it now sits between leave no room for that answer:
- the wire design rules OUTPUTS AS
#[Object]-STYLE IMPLS over marked fields — the marker rule holding on the wire the way it holds everywhere else; - the three-layer accessor law makes the emitted MEMBERS domain-named and
pub(crate), puts the public face on the ACCESSORS beside them, and givesoutput(field = "…")the job of moving that accessor.
A derive that renders FIELDS can honour neither: it would publish layer 1 — the substrate no
word may move — so output(field = "…") would rename a Rust item the schema never reads, and a
pub(crate) member would be published by a pub type. The attribute renders layer 2 instead,
which is the layer the rename word was given and the layer that is API.
The shape it takes is one impl block of borrows, so nothing about the object’s own declaration changes: the members stay where they are, the inherent accessors stay where they are, and what is added is a second impl naming the same accessors.
Sourcepub const fn input_derive(self) -> &'static str
pub const fn input_derive(self) -> &'static str
The derive path this backend’s input types carry.
Sourcepub const fn order_by_derive(self) -> &'static str
pub const fn order_by_derive(self) -> &'static str
The derive path this backend’s order-by carries.
Not the plain enum derive, though the emitted type IS a Rust enum: the order-by renders as a
@oneOf INPUT OBJECT — one nullable field per column, exactly one of them supplied — and the
derive that produces that from an enum of single-value tuple variants is this one. The plain
Enum derive would render the type as a GraphQL enum of bare column names, which is the shape
this face stopped being: it cannot carry a direction, and a list of it cannot pair one.