Minimum requirements
Package | Minimum version |
---|---|
controlplane | 0.58.0 |
router | 0.60.0 |
wgc | 0.39.0 |
Definition
Declaration
The @authenticated directive can be declared on enums, field definitions, interfaces, objects, and scalars. However, there are some differences between declaration on leaf definitions and parent definitions.Declaration on leaf definitions (enums and scalars)
When @authenticated is declared on a leaf definition, @authenticated will be applied to all field definitions whose named type (the innermost response type name) is the respective leaf definition within that subgraph. If the same leaf definition is defined in another subgraph without @authenticated, the corresponding field definitions unique to that that subgraph will be unaffected. But note that @authenticated could be applied to those field definitions through other means. If at least one instance of a shared field is declared @authenticated, that field will be declared @authenticated in the federated graph (see Federation). Consider the following example:- The enum “Enum”
- The scalar “Scalar”
- Query.enumQuery (named type name is “Enum”)
- Query.scalarQuery (named type name is “Scalar”)
- Object.enumField (named type name is “Enum”)
- Object.scalarField (named type name is “Scalar”)
Declaration on object definitions
When @authenticated is declared on an object definition, @authenticated will be applied to all field definitions defined on the object definition within that subgraph. If the same object definition is defined in another subgraph without @authenticated, the corresponding field definitions unique to that subgraph be unaffected. But note that @authenticated could be applied to those field definitions through other means. If at least one instance of a shared field is declared @authenticated, that field definition will be declared @authenticated in the federated graph (see Federation). Consider the following example:- The root object “Query”
- The object “Object”
- Query.objectQuery
- Query.objectsQuery
- Object.intField
- Object.stringField
Declaration on interface definitions
When @authenticated is declared on an interface definition, @authenticated will be applied to all field definitions defined on the interface definition within that subgraph. If the same interface definition is defined in another subgraph without @authenticated, the corresponding field definitions unique to that subgraph be unaffected. But note that @authenticated could be applied to those field definitions through other means. In addition, @authenticated will be applied to the corresponding field definitions defined on the objects that implement that interface within that subgraph. If at least one instance of a shared field is declared @authenticated, that field definition will be declared @authenticated in the federated graph (see Federation). Consider the following example:- Object
- AnotherObject
- Interface.intField
- Interface.stringField