This upgrade only requires intervention from you if you’re using Federation or are directly implementing pages that use the table view from the admin-ui-components
package.
Federation
Previously, you could enable Federation with the enableFederation
option in the Graphweaver constructor, like so:
const graphweaver = new Graphweaver({
enableFederation: true
});
This worked, but because federated routers like Cosmo and Apollo use type names as the unique identifier for types, you couldn’t have two or more Graphweaver instances behind a federated router. Our singleton types like Media
and AggregationResult
would clash. Now when you enable federation, you pass a subgraph name, like so:
const graphweaver = new Graphweaver({
federationSubgraphName: 'myTeam'
});
This will enable federation and also rename all of these singleton types. For example:
Media
⇒MediaFromMyTeamSubgraph
AggregationResult
⇒AggregationResultFromMyTeamSubgraph
This behaviour happens on an entity when you use apiOptions.namespaceForFederation
in the @Entity
decorator, like so:
@Entity('Media', {
apiOptions: {
namespaceForFederation: true,
},
})
export class Media {
// ... etc
}
So, if you want the namespacing behaviour, then set that option in the decorator, otherwise we’ll leave your entity names alone.
Admin UI Table
We’ve switched table components and refactored quite a but in the Admin UI and Admin UI Components packages.
Previously there wasn’t much you could do with the table other than use it exactly as we had used it in the list view. It was checking the URL and all sorts of things. Now it’s a dumb table that takes rows and columns, then will render the result. Feel free to use it in your custom pages if you’d like to.
Summary
That’s it! If you’re having trouble with the upgrade, don’t hesitate to reach out to us on Slack, we’re here to help!