lineark-derive 0.6.0

Derive macro for GraphQLFields trait (lineark-sdk)
Documentation

Derive macro for the GraphQLFields trait.

Automatically generates selection() from a struct's field definitions. No manual GraphQL strings needed — the struct shape IS the query shape.

Usage

use lineark_sdk::GraphQLFields;
use lineark_sdk::generated::types::Issue;

#[derive(GraphQLFields, Deserialize)]
#[graphql(full_type = Issue)]
#[serde(rename_all = "camelCase")]
struct MyIssue {
    id: Option<String>,
    title: Option<String>,
    #[graphql(nested)]
    state: Option<StateRef>,
}

Generates: "id title state { <StateRef::selection()> }"

With full_type, the macro also generates compile-time validation that each field exists on the full type with a compatible type.