Skip to content

angee.graphql.data.resource_fields

GraphQL/Django projection into neutral resource-field descriptions.

resource_wire_field_name

python
def resource_wire_field_name(surface: type | None,
                             name: str | None) -> str | None

Return the actual GraphQL wire field name for a Strawberry surface field.

resource_wire_field_names

python
def resource_wire_field_names(
    surface: type | None, *, exclude: tuple[str, ...] = ()) -> tuple[str, ...]

Return all declared GraphQL wire field names for a Strawberry surface.

resource_type_name

python
def resource_type_name(surface: type | None) -> str | None

Return the GraphQL type name for surface when present.

resource_relation_surface

python
def resource_relation_surface(surface: type | None,
                              name: str) -> object | None

Return the object surface projected by one to-one field, if any.

require_resource_selection_path

python
def require_resource_selection_path(surface: type | None,
                                    path: str,
                                    *,
                                    model_label: str,
                                    fact: str = "subtitle") -> None

Require a dotted GraphQL selection path to resolve through surface.

Each segment is matched by its actual wire name. Intermediate fields must project another Strawberry object; walking through a scalar/list or naming a missing field fails during metadata emission, before a generated detail query can carry the invalid selection.

model_resource_fields

python
def model_resource_fields(
    model: type[models.Model],
    fields: tuple[str | data_contract.DataResourceFieldMetadata, ...],
    *,
    filter_fields: tuple[str, ...] = (),
    order_fields: tuple[str, ...] = (),
    aggregate_fields: tuple[str, ...] = (),
    group_by_fields: tuple[str, ...] = (),
    create_fields: tuple[str, ...] = (),
    update_fields: tuple[str, ...] = (),
    required_create_fields: tuple[str, ...] = (),
    relation_axes: tuple[data_contract.DataRelationAxisMetadata, ...] = ()
) -> tuple[data_contract.DataResourceFieldMetadata, ...]

Return metadata for model fields exposed outside the node class.

A caller may supply explicit metadata for a projected donor field whose shape the bare model cannot reconstruct (notably an enum). Ordinary string declarations retain the model-only fail-fast contract.

input_wire_fields

python
def input_wire_fields(surface: type | None, *,
                      exclude: tuple[str, ...] = ()) -> tuple[str, ...]

Return declared input fields as GraphQL wire names.

required_input_wire_fields

python
def required_input_wire_fields(surface: type | None) -> tuple[str, ...]

Return input fields whose value is required by GraphQL coercion.

resource_fields

python
def resource_fields(
    node_type: type, model: type[models.Model] | None, *,
    filter_fields: tuple[str, ...], order_fields: tuple[str, ...],
    aggregate_fields: tuple[str, ...], group_by_fields: tuple[str, ...],
    create_fields: tuple[str, ...], update_fields: tuple[str, ...],
    required_create_fields: tuple[str, ...],
    relation_axes: tuple[data_contract.DataRelationAxisMetadata, ...]
) -> tuple[data_contract.DataResourceFieldMetadata, ...]

Return model resource field metadata from the declared node surface.

require_unique_resource_fields

python
def require_unique_resource_fields(
    model_label: str, fields: tuple[data_contract.DataResourceFieldMetadata,
                                    ...]
) -> tuple[data_contract.DataResourceFieldMetadata, ...]

Return resource field metadata after rejecting duplicate field names.

Released under the AGPL-3.0 License.