def directive(
    *,
    locations: list[DirectiveLocation],
    description: Optional[str] = None,
    name: Optional[str] = None,
) -> Callable[[Callable[..., T]], StrawberryDirective[T]]:
    """Decorator to create a GraphQL operation directive.

    Args:
        locations: The locations where the directive can be used
        description: The GraphQL description of the directive
        name: The GraphQL name of the directive

    Returns:
        A StrawberryDirective object that can be used to customise a directive

    Example:
    ```python
    import strawberry
    from strawberry.directive import DirectiveLocation


    @strawberry.directive(
        locations=[DirectiveLocation.FIELD], description="Make string uppercase"
    )
    def turn_uppercase(value: str):
        return value.upper()
    ```
    """

    def _wrap(f: Callable[..., T]) -> StrawberryDirective[T]:
        return StrawberryDirective(
            python_name=f.__name__,
            graphql_name=name,
            locations=locations,
            description=description,
            resolver=StrawberryDirectiveResolver(f),
        )

    return _wrap
Decorator to create a GraphQL operation directive.

    Args:
        locations: The locations where the directive can be used
        description: The GraphQL description of the directive
        name: The GraphQL name of the directive

    Returns:
        A StrawberryDirective object that can be used to customise a directive

    Example:
    ```python
    import strawberry
    from strawberry.directive import DirectiveLocation


    @strawberry.directive(
        locations=[DirectiveLocation.FIELD], description="Make string uppercase"
    )
    def turn_uppercase(value: str):
        return value.upper()
    ```
    
strawberry/directive.py