Skip to main content

Module field_selection

Module field_selection 

Source
Expand description

Type-driven GraphQL field selection.

Each type that implements GraphQLFields knows how to describe its own GraphQL selection string. Generated types return all their scalar fields. Consumers can define custom lean types with only the fields they need — the struct shape is the query shape.

The FullType associated type provides compile-time validation:

  • Generated types implement GraphQLFields with FullType = Self
  • Custom types use #[graphql(full_type = X)] to validate fields at compile time

Traits§

FieldCompatible
Marker trait for compile-time field type compatibility.
GraphQLFields
Trait implemented by types that know their GraphQL field selection.