diff --git a/docs/en/src/apollo_federation.md b/docs/en/src/apollo_federation.md index 93d515d5..c9fa8bed 100644 --- a/docs/en/src/apollo_federation.md +++ b/docs/en/src/apollo_federation.md @@ -14,6 +14,8 @@ - The `shareable` directive is used to indicate that an object type's field is allowed to be resolved by multiple subgraphs (by default, each field can be resolved by only one subgraph). +- The `inaccessible` directive is used to indicate that a location in the schema cannot be queried at the supergraph level, but can still be queried at the subgraph level. + ## Entity lookup function ```rust diff --git a/src/docs/complex_object.md b/src/docs/complex_object.md index d17cb294..0c7e4d08 100644 --- a/src/docs/complex_object.md +++ b/src/docs/complex_object.md @@ -16,6 +16,7 @@ some simple fields, and use the `ComplexObject` macro to define some other field | rename_fields | Rename all the fields according to the given case convention. The possible values are "lowercase", "UPPERCASE", "PascalCase", "camelCase", "snake_case", "SCREAMING_SNAKE_CASE". | string | Y | | rename_args | Rename all the arguments according to the given case convention. The possible values are "lowercase", "UPPERCASE", "PascalCase", "camelCase", "snake_case", "SCREAMING_SNAKE_CASE". | string | Y | | guard | Field of guard *[See also the Book](https://async-graphql.github.io/async-graphql/en/field_guard.html)* | string | Y | +| inaccessible | Indicate that an object is not accessible from a supergraph when using Apollo Federation | bool | Y | # Field attributes @@ -31,6 +32,7 @@ some simple fields, and use the `ComplexObject` macro to define some other field | provides | Annotate the expected returned fieldset from a field on a base type that is guaranteed to be selectable by the gateway. | string | Y | | requires | Annotate the required input fieldset from a base type for a resolver. It is used to develop a query plan where the required fields may not be needed by the client, but the service may need additional information from other services. | string | Y | | shareable | Indicate that a field is allowed to be resolved by multiple subgraphs | bool | Y | +| inaccessible | Indicate that a field is not accessible from a supergraph when using Apollo Federation | bool | Y | | guard | Field of guard *[See also the Book](https://async-graphql.github.io/async-graphql/en/field_guard.html)* | string | Y | | visible | If `false`, it will not be displayed in introspection. *[See also the Book](https://async-graphql.github.io/async-graphql/en/visibility.html).* | bool | Y | | visible | Call the specified function. If the return value is `false`, it will not be displayed in introspection. | string | Y | @@ -49,6 +51,7 @@ some simple fields, and use the `ComplexObject` macro to define some other field | default | Argument default value | literal | Y | | default_with | Expression to generate default value | code string | Y | | validator | Input value validator *[See also the Book](https://async-graphql.github.io/async-graphql/en/input_value_validators.html)* | object | Y | +| inaccessible | Indicate that a field argument is not accessible from a supergraph when using Apollo Federation | bool | Y | | visible | If `false`, it will not be displayed in introspection. *[See also the Book](https://async-graphql.github.io/async-graphql/en/visibility.html).* | bool | Y | | visible | Call the specified function. If the return value is `false`, it will not be displayed in introspection. | string | Y | | secret | Mark this field as a secret, it will not output the actual value in the log. | bool | Y | diff --git a/src/docs/enum.md b/src/docs/enum.md index 1ce6029f..7957ea5e 100644 --- a/src/docs/enum.md +++ b/src/docs/enum.md @@ -11,16 +11,18 @@ Define a GraphQL enum | remote | Derive a remote enum | string | Y | | visible | If `false`, it will not be displayed in introspection. *[See also the Book](https://async-graphql.github.io/async-graphql/en/visibility.html).* | bool | Y | | visible | Call the specified function. If the return value is `false`, it will not be displayed in introspection. | string | Y | +| inaccessible | Indicate that an enum is not accessible from a supergraph when using Apollo Federation | bool | Y | # Item attributes -| Attribute | description | Type | Optional | -|-------------|-------------------------------------------------------------------------------------------------------------------------------------------------|--------|----------| -| name | Item name | string | Y | -| deprecation | Item deprecated | bool | Y | -| deprecation | Item deprecation reason | string | Y | -| visible | If `false`, it will not be displayed in introspection. *[See also the Book](https://async-graphql.github.io/async-graphql/en/visibility.html).* | bool | Y | -| visible | Call the specified function. If the return value is `false`, it will not be displayed in introspection. | string | Y | +| Attribute | description | Type | Optional | +|--------------|-------------------------------------------------------------------------------------------------------------------------------------------------|--------|----------| +| name | Item name | string | Y | +| deprecation | Item deprecated | bool | Y | +| deprecation | Item deprecation reason | string | Y | +| visible | If `false`, it will not be displayed in introspection. *[See also the Book](https://async-graphql.github.io/async-graphql/en/visibility.html).* | bool | Y | +| visible | Call the specified function. If the return value is `false`, it will not be displayed in introspection. | string | Y | +| inaccessible | Indicate that an item is not accessible from a supergraph when using Apollo Federation | bool | Y | # Examples diff --git a/src/docs/input_object.md b/src/docs/input_object.md index c93f1d88..c05c95ce 100644 --- a/src/docs/input_object.md +++ b/src/docs/input_object.md @@ -11,6 +11,7 @@ Define a GraphQL input object | visible | If `false`, it will not be displayed in introspection. *[See also the Book](https://async-graphql.github.io/async-graphql/en/visibility.html).* | bool | Y | | visible | Call the specified function. If the return value is `false`, it will not be displayed in introspection. | string | Y | | concretes | Specify how the concrete type of the generic SimpleObject should be implemented. | ConcreteType | Y | +| inaccessible | Indicate that an input object is not accessible from a supergraph when using Apollo Federation | bool | Y | # Field attributes @@ -28,6 +29,7 @@ Define a GraphQL input object | visible | If `false`, it will not be displayed in introspection. *[See also the Book](https://async-graphql.github.io/async-graphql/en/visibility.html).* | bool | Y | | visible | Call the specified function. If the return value is `false`, it will not be displayed in introspection. | string | Y | | secret | Mark this field as a secret, it will not output the actual value in the log. | bool | Y | +| inaccessible | Indicate that a field is not accessible from a supergraph when using Apollo Federation | bool | Y | # Examples diff --git a/src/docs/interface.md b/src/docs/interface.md index d630af42..34200a3a 100644 --- a/src/docs/interface.md +++ b/src/docs/interface.md @@ -13,23 +13,25 @@ Define a GraphQL interface | extends | Add fields to an entity that's defined in another service | bool | Y | | visible | If `false`, it will not be displayed in introspection. *[See also the Book](https://async-graphql.github.io/async-graphql/en/visibility.html).* | bool | Y | | visible | Call the specified function. If the return value is `false`, it will not be displayed in introspection. | string | Y | +| inaccessible | Indicate that an interface is not accessible from a supergraph when using Apollo Federation | bool | Y | # Field attributes -| Attribute | description | Type | Optional | -|-------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------|----------| -| name | Field name | string | N | -| type | Field type | string | N | -| method | Rust resolver method name. If specified, `name` will not be camelCased in schema definition | string | Y | -| desc | Field description | string | Y | -| deprecation | Field deprecated | bool | Y | -| deprecation | Field deprecation reason | string | Y | -| arg | Field arguments | InterfaceFieldArgument | Y | -| external | Mark a field as owned by another service. This allows service A to use fields from service B while also knowing at runtime the types of that field. | bool | Y | -| provides | Annotate the expected returned fieldset from a field on a base type that is guaranteed to be selectable by the gateway. | string | Y | -| requires | Annotate the required input fieldset from a base type for a resolver. It is used to develop a query plan where the required fields may not be needed by the client, but the service may need additional information from other services. | string | Y | -| visible | If `false`, it will not be displayed in introspection. *[See also the Book](https://async-graphql.github.io/async-graphql/en/visibility.html).* | bool | Y | -| visible | Call the specified function. If the return value is `false`, it will not be displayed in introspection. | string | Y | +| Attribute | description | Type | Optional | +|--------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------|----------| +| name | Field name | string | N | +| type | Field type | string | N | +| method | Rust resolver method name. If specified, `name` will not be camelCased in schema definition | string | Y | +| desc | Field description | string | Y | +| deprecation | Field deprecated | bool | Y | +| deprecation | Field deprecation reason | string | Y | +| arg | Field arguments | InterfaceFieldArgument | Y | +| external | Mark a field as owned by another service. This allows service A to use fields from service B while also knowing at runtime the types of that field. | bool | Y | +| provides | Annotate the expected returned fieldset from a field on a base type that is guaranteed to be selectable by the gateway. | string | Y | +| requires | Annotate the required input fieldset from a base type for a resolver. It is used to develop a query plan where the required fields may not be needed by the client, but the service may need additional information from other services. | string | Y | +| visible | If `false`, it will not be displayed in introspection. *[See also the Book](https://async-graphql.github.io/async-graphql/en/visibility.html).* | bool | Y | +| visible | Call the specified function. If the return value is `false`, it will not be displayed in introspection. | string | Y | +| inaccessible | Indicate that a field is not accessible from a supergraph when using Apollo Federation | bool | Y | # Field argument attributes @@ -44,6 +46,8 @@ Define a GraphQL interface | visible | If `false`, it will not be displayed in introspection. *[See also the Book](https://async-graphql.github.io/async-graphql/en/visibility.html).* | bool | Y | | visible | Call the specified function. If the return value is `false`, it will not be displayed in introspection. | string | Y | | secret | Mark this field as a secret, it will not output the actual value in the log. | bool | Y | +| inaccessible | Indicate that an argument is not accessible from a supergraph when using Apollo Federation | bool | Y | + # Define an interface diff --git a/src/docs/merged_object.md b/src/docs/merged_object.md index 459cc8aa..57382bff 100644 --- a/src/docs/merged_object.md +++ b/src/docs/merged_object.md @@ -12,6 +12,7 @@ Define a merged object with multiple object types. | visible | If `false`, it will not be displayed in introspection. *[See also the Book](https://async-graphql.github.io/async-graphql/en/visibility.html).* | bool | Y | | visible | Call the specified function. If the return value is `false`, it will not be displayed in introspection. | string | Y | | serial | Resolve each field sequentially. | bool | Y | +| inaccessible | Indicate that an object is not accessible from a supergraph when using Apollo Federation | bool | Y | # Examples diff --git a/src/docs/newtype.md b/src/docs/newtype.md index 9dc55454..762d2390 100644 --- a/src/docs/newtype.md +++ b/src/docs/newtype.md @@ -11,6 +11,7 @@ It also implements `From` and `Into`. | visible(Only valid for new scalars) | If `false`, it will not be displayed in introspection. *[See also the Book](https://async-graphql.github.io/async-graphql/en/visibility.html).* | bool | Y | | visible(Only valid for new scalars) | Call the specified function. If the return value is `false`, it will not be displayed in introspection. | string | Y | | specified_by_url(Only valid for new scalars) | Provide a specification URL for this scalar type, it must link to a human-readable specification of the data format, serialization and coercion rules for this scalar. | string | Y | +| inaccessible | Indicate that an object is not accessible from a supergraph when using Apollo Federation | bool | Y | # Examples diff --git a/src/docs/object.md b/src/docs/object.md index 3a821719..19138ad8 100644 --- a/src/docs/object.md +++ b/src/docs/object.md @@ -17,6 +17,7 @@ All methods are converted to camelCase. | use_type_description | Specifies that the description of the type is on the type declaration. [`Description`]()(derive.Description.html) | bool | Y | | visible | If `false`, it will not be displayed in introspection. *[See also the Book](https://async-graphql.github.io/async-graphql/en/visibility.html).* | bool | Y | | visible | Call the specified function. If the return value is `false`, it will not be displayed in introspection. | string | Y | +| inaccessible | Indicate that an object is not accessible from a supergraph when using Apollo Federation | bool | Y | | serial | Resolve each field sequentially. | bool | Y | | concretes | Specify how the concrete type of the generic SimpleObject should be implemented. | ConcreteType | Y | | guard | Field of guard *[See also the Book](https://async-graphql.github.io/async-graphql/en/field_guard.html)* | string | Y | @@ -35,6 +36,7 @@ All methods are converted to camelCase. | provides | Annotate the expected returned fieldset from a field on a base type that is guaranteed to be selectable by the gateway. | string | Y | | requires | Annotate the required input fieldset from a base type for a resolver. It is used to develop a query plan where the required fields may not be needed by the client, but the service may need additional information from other services. | string | Y | | shareable | Indicate that a field is allowed to be resolved by multiple subgraphs | bool | Y | +| inaccessible | Indicate that a field is not accessible from a supergraph when using Apollo Federation | bool | Y | | guard | Field of guard *[See also the Book](https://async-graphql.github.io/async-graphql/en/field_guard.html)* | string | Y | | visible | If `false`, it will not be displayed in introspection. *[See also the Book](https://async-graphql.github.io/async-graphql/en/visibility.html).* | bool | Y | | visible | Call the specified function. If the return value is `false`, it will not be displayed in introspection. | string | Y | @@ -55,6 +57,7 @@ All methods are converted to camelCase. | validator | Input value validator *[See also the Book](https://async-graphql.github.io/async-graphql/en/input_value_validators.html)* | object | Y | | visible | If `false`, it will not be displayed in introspection. *[See also the Book](https://async-graphql.github.io/async-graphql/en/visibility.html).* | bool | Y | | visible | Call the specified function. If the return value is `false`, it will not be displayed in introspection. | string | Y | +| inaccessible | Indicate that an argument is not accessible from a supergraph when using Apollo Federation | bool | Y | | secret | Mark this field as a secret, it will not output the actual value in the log. | bool | Y | | key | Is entity key(for Federation) | bool | Y | | process_with | Upon successful parsing, invokes specified function. Its signature must be `fn(&mut T)`. | code path | Y | diff --git a/src/docs/scalar.md b/src/docs/scalar.md index bf8d01a1..e6a7418e 100644 --- a/src/docs/scalar.md +++ b/src/docs/scalar.md @@ -6,3 +6,4 @@ Define a Scalar |------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------|----------| | name | Scalar name | string | Y | | specified_by_url | Provide a specification URL for this scalar type, it must link to a human-readable specification of the data format, serialization and coercion rules for this scalar. | string | Y | +| inaccessible | Indicate that a scalar is not accessible from a supergraph when using Apollo Federation | bool | Y | \ No newline at end of file diff --git a/src/docs/simple_object.md b/src/docs/simple_object.md index cac68a51..139f8e65 100644 --- a/src/docs/simple_object.md +++ b/src/docs/simple_object.md @@ -13,6 +13,7 @@ Similar to `Object`, but defined on a structure that automatically generates get | cache_control | Object cache control | [`CacheControl`](struct.CacheControl.html) | Y | | extends | Add fields to an entity that's defined in another service | bool | Y | | shareable | Indicate that an object type's field is allowed to be resolved by multiple subgraphs | bool | Y | +| inaccessible | Indicate that an object is not accessible from a supergraph when using Apollo Federation | bool | Y | | visible | If `false`, it will not be displayed in introspection. *[See also the Book](https://async-graphql.github.io/async-graphql/en/visibility.html).* | bool | Y | | visible | Call the specified function. If the return value is `false`, it will not be displayed in introspection. | string | Y | | concretes | Specify how the concrete type of the generic SimpleObject should be implemented. *[See also the Book](https://async-graphql.github.io/async-graphql/en/define_simple_object.html#generic-simpleobjects) | ConcreteType | Y | @@ -35,6 +36,8 @@ Similar to `Object`, but defined on a structure that automatically generates get | provides | Annotate the expected returned fieldset from a field on a base type that is guaranteed to be selectable by the gateway. | string | Y | | requires | Annotate the required input fieldset from a base type for a resolver. It is used to develop a query plan where the required fields may not be needed by the client, but the service may need additional information from other services. | string | Y | | shareable | Indicate that a field is allowed to be resolved by multiple subgraphs | bool | Y | + +| inaccessible | Indicate that a field is not accessible from a supergraph when using Apollo Federation | bool | Y | | guard | Field of guard *[See also the Book](https://async-graphql.github.io/async-graphql/en/field_guard.html)* | string | Y | | visible | If `false`, it will not be displayed in introspection. *[See also the Book](https://async-graphql.github.io/async-graphql/en/visibility.html).* | bool | Y | | visible | Call the specified function. If the return value is `false`, it will not be displayed in introspection. | string | Y | diff --git a/src/docs/union.md b/src/docs/union.md index a2c3cfe3..78615184 100644 --- a/src/docs/union.md +++ b/src/docs/union.md @@ -4,11 +4,12 @@ Define a GraphQL union # Macro attributes -| Attribute | description | Type | Optional | -|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------|--------|----------| -| name | Object name | string | Y | -| visible | If `false`, it will not be displayed in introspection. *[See also the Book](https://async-graphql.github.io/async-graphql/en/visibility.html).* | bool | Y | -| visible | Call the specified function. If the return value is `false`, it will not be displayed in introspection. | string | Y | +| Attribute | description | Type | Optional | +|--------------|-------------------------------------------------------------------------------------------------------------------------------------------------|--------|----------| +| name | Object name | string | Y | +| visible | If `false`, it will not be displayed in introspection. *[See also the Book](https://async-graphql.github.io/async-graphql/en/visibility.html).* | bool | Y | +| visible | Call the specified function. If the return value is `false`, it will not be displayed in introspection. | string | Y | +| inaccessible | Indicate that an union is not accessible from a supergraph when using Apollo Federation | bool | Y | # Item attributes