--------------------
This release adds support for passing schema directives to
`Schema(..., types=[])`. This can be useful if using a built-inschema directive
that's not supported by a gateway.
For example the following:
python
import strawberry
from strawberry.scalars import JSON
from strawberry.schema_directive import Location
strawberry.type
class Query:
example: JSON
strawberry.schema_directive(locations=[Location.SCALAR], name="specifiedBy")
class SpecifiedBy:
name: str
schema = strawberry.Schema(query=Query, types=[SpecifiedBy])
will print the following SDL:
graphql
directive specifiedBy(name: String!) on SCALAR
"""
The `JSON` scalar type represents JSON values as specified by [ECMA-404](https://ecma-international.org/wp-content/uploads/ECMA-404_2nd_edition_december_2017.pdf).
"""
scalar JSON
specifiedBy(
url: "https://ecma-international.org/wp-content/uploads/ECMA-404_2nd_edition_december_2017.pdf"
)
type Query {
example: JSON!
}
Contributed by [Patrick Arminio](https://github.com/patrick91) via [PR #2140](https://github.com/strawberry-graphql/strawberry/pull/2140/)