You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given the value of Contracts a way to split out supergraphs from a source variant, there's often use-cases where some directives may only apply to a subset of produced contracts.
Federation should enable a way to do so through a proposed new dircective @applyOnTag where, as the name implies, it'll only apply a given directive on a field if it were to be composed into the resulting contract.
As an example, deprecating fields for a given contract can be helpful, thus: field: String @applyOnTag(tag:"public", directive: "@deprecated(reason:\"test\")") (or similar).
Or for the new AuthN/Z directives, applying conditional scope checks based on the type of contract, as auth models may differ on certain contracts vs. others.
The text was updated successfully, but these errors were encountered:
For the first example use-case, an alternative could be to accept a deprecated argument on the tag directive itself which would, during composition, apply a deprecated directive with the reason matching the deprecated string passed.
The other use-case, however, wouldn't be possible without adding a tag directive to those directives.
Given the value of Contracts a way to split out supergraphs from a source variant, there's often use-cases where some directives may only apply to a subset of produced contracts.
Federation should enable a way to do so through a proposed new dircective
@applyOnTag
where, as the name implies, it'll only apply a given directive on a field if it were to be composed into the resulting contract.As an example, deprecating fields for a given contract can be helpful, thus:
field: String @applyOnTag(tag:"public", directive: "@deprecated(reason:\"test\")")
(or similar).Or for the new AuthN/Z directives, applying conditional scope checks based on the type of contract, as auth models may differ on certain contracts vs. others.
The text was updated successfully, but these errors were encountered: