--------------------
This release adds support for passing a custom name to schema directives fields,
by using `strawberry.directive_field`.
python
import strawberry
strawberry.schema_directive(locations=[Location.FIELD_DEFINITION])
class Sensitive:
reason: str = strawberry.directive_field(name="as")
real_age_2: str = strawberry.directive_field(name="real_age")
strawberry.type
class Query:
first_name: str = strawberry.field(
directives=[Sensitive(reason="GDPR", real_age_2="42")]
)
should return:
graphql
type Query {
firstName: String! sensitive(as: "GDPR", real_age: "42")
}
Contributed by [Patrick Arminio](https://github.com/patrick91) via [PR #1871](https://github.com/strawberry-graphql/strawberry/pull/1871/)