Skip to content

generics

WithNodes

Bases: BaseModel, Generic[G_Item]

An object that may contain nodes.

Attributes:

Name Type Description
nodes list[G_Item]

...

Source code in m/github/graphql/generics.py
class WithNodes(BaseModel, Generic[G_Item]):
    """An object that may contain nodes."""

    nodes: list[G_Item]

identity(x)

Identity function.

Parameters:

Name Type Description Default
x G_Item

The input

required

Returns:

Type Description
G_Item

The input value.

Source code in m/github/graphql/generics.py
def identity(x: G_Item) -> G_Item:
    """Identity function.

    Args:
        x: The input

    Returns:
        The input value.
    """
    return x