--------------------
This release adds support for Apollo Federation 2 directives:
- shareable
- tag
- override
- inaccessible
This release does **not** add support for the link directive.
This release updates the key directive to align with Apollo Federation 2 updates.
See the below code snippet and/or the newly-added test cases for examples on how to use the new directives.
The below snippet demonstrates the override directive.
python
import strawberry
from typing import List
strawberry.interface
class SomeInterface:
id: strawberry.ID
strawberry.federation.type(keys=["upc"], extend=True)
class Product(SomeInterface):
upc: str = strawberry.federation.field(external=True, override=["mySubGraph"])
strawberry.federation.type
class Query:
strawberry.field
def top_products(self, first: int) -> List[Product]:
return []
schema = strawberry.federation.Schema(query=Query)
should return:
graphql
extend type Product implements SomeInterface key(fields: "upc", resolvable: "True") {
id: ID!
upc: String! external override(from: "mySubGraph")
}
type Query {
_service: _Service!
_entities(representations: [_Any!]!): [_Entity]!
topProducts(first: Int!): [Product!]!
}
interface SomeInterface {
id: ID!
}
scalar _Any
union _Entity = Product
type _Service {
sdl: String!
}
Contributed by [Matt Skillman](https://github.com/mtskillman) via [PR #1874](https://github.com/strawberry-graphql/strawberry/pull/1874/)