|
| 1 | +""" |
| 2 | +Redact a part of the response from the client. |
| 3 | +
|
| 4 | +Redacted fields are still evaluated for side effects (including data changes and |
| 5 | +`@check`) and the results are still available to later steps in CEL expressions |
| 6 | +(via `response.fieldName`). |
| 7 | +""" |
| 8 | +directive @redact on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT |
| 9 | + |
| 10 | +""" |
| 11 | +Ensure this field is present and is not null or `[]`, or abort the request / transaction. |
| 12 | +
|
| 13 | +A CEL expression, `expr` is used to test the field value. It defaults to |
| 14 | +rejecting null and `[]` but a custom expression can be provided instead. |
| 15 | +
|
| 16 | +If the field occurs multiple times (i.e. directly or indirectly nested under a |
| 17 | +list), `expr` will be executed once for each occurrence and `@check` succeeds if |
| 18 | +all values succeed. `@check` fails when the field is not present at all (i.e. |
| 19 | +all ancestor paths contain `null` or `[]`), unless `optional` is true. |
| 20 | +
|
| 21 | +If a `@check` fails in a mutation, the top-level field containing it will be |
| 22 | +replaced with a partial error, whose message can be customzied via the `message` |
| 23 | +argument. Each subsequent top-level fields will return an aborted error (i.e. |
| 24 | +not executed). To rollback previous steps, see `@transaction`. |
| 25 | +""" |
| 26 | +directive @check( |
| 27 | + """ |
| 28 | + The CEL expression to test the field value (or values if nested under a list). |
| 29 | +
|
| 30 | + Within the CEL expression, a special value `this` evaluates to the field that |
| 31 | + this directive is attached to. If this field occurs multiple times because |
| 32 | + any ancestor is a list, each occurrence is tested with `this` bound to each |
| 33 | + value. When the field itself is a list or object, `this` follows the same |
| 34 | + structure (including all decendants selected in case of objects). |
| 35 | +
|
| 36 | + For any given path, if an ancestor is `null` or `[]`, the field will not be |
| 37 | + reached and the CEL evaluation will be skipped for that path. In other words, |
| 38 | + evaluation only takes place when `this` is `null` or non-null, but never |
| 39 | + undefined. (See also the `optional` argument.) |
| 40 | + """ |
| 41 | + expr: Boolean_Expr! = "!(this in [null, []])" |
| 42 | + """ |
| 43 | + The error message to return to the client if the check fails. |
| 44 | +
|
| 45 | + Defaults to "permission denied" if not specified. |
| 46 | + """ |
| 47 | + message: String! = "permission denied" |
| 48 | + """ |
| 49 | + Whether the check should pass or fail (default) when the field is not present. |
| 50 | +
|
| 51 | + A field will not be reached at a given path if its parent or any ancestor is |
| 52 | + `[]` or `null`. When this happens to all paths, the field will not be present |
| 53 | + anywhere in the response tree. In other words, `expr` is evaluated 0 times. |
| 54 | + By default, @check will automatically fail in this case. Set this argument to |
| 55 | + `true` to make it pass even if no tests are run (a.k.a. "vacuously true"). |
| 56 | + """ |
| 57 | + optional: Boolean = false |
| 58 | +) repeatable on QUERY | MUTATION | FIELD | FRAGMENT_DEFINITION | FRAGMENT_SPREAD | INLINE_FRAGMENT |
| 59 | + |
1 | 60 | "AccessLevel specifies coarse access policies for common situations."
|
2 | 61 | enum AccessLevel {
|
3 | 62 | """
|
@@ -445,6 +504,17 @@ directive @fdc_oneOf(
|
445 | 504 | required: Boolean! = false
|
446 | 505 | ) repeatable on FIELD_DEFINITION | ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION
|
447 | 506 |
|
| 507 | +type Mutation { |
| 508 | + """ |
| 509 | + Run a query during the mutation and add fields into the response. |
| 510 | +
|
| 511 | + Example: foo: query { users { id } } will add a field foo: {users: [{id: "..."}, …]} into the response JSON. |
| 512 | +
|
| 513 | + Note: Data fetched this way can be handy for permission checks. See @check. |
| 514 | + """ |
| 515 | + query: Query |
| 516 | +} |
| 517 | + |
448 | 518 | """
|
449 | 519 | `UUID` is a string of hexadecimal digits representing an RFC4122-compliant UUID.
|
450 | 520 |
|
@@ -1934,73 +2004,3 @@ scalar Vector_Embed_Model
|
1934 | 2004 | @fdc_example(value: "textembedding-gecko@001", description: "An older version of the textembedding-gecko model")
|
1935 | 2005 | @fdc_example(value: "text-embedding-004", description: "Another text embedding model")
|
1936 | 2006 |
|
1937 |
| -""" |
1938 |
| -Redact a part of the response from the client. |
1939 |
| -
|
1940 |
| -Redacted fields are still evaluated for side effects (including data changes and |
1941 |
| -`@check`) and the results are still available to later steps in CEL expressions |
1942 |
| -(via `response.fieldName`). |
1943 |
| -""" |
1944 |
| -directive @redact on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT |
1945 |
| - |
1946 |
| -""" |
1947 |
| -Ensure this field is present and is not null or `[]`, or abort the request / transaction. |
1948 |
| -
|
1949 |
| -A CEL expression, `expr` is used to test the field value. It defaults to |
1950 |
| -rejecting null and `[]` but a custom expression can be provided instead. |
1951 |
| -
|
1952 |
| -If the field occurs multiple times (i.e. directly or indirectly nested under a |
1953 |
| -list), `expr` will be executed once for each occurrence and `@check` succeeds if |
1954 |
| -all values succeed. `@check` fails when the field is not present at all (i.e. |
1955 |
| -all ancestor paths contain `null` or `[]`), unless `optional` is true. |
1956 |
| -
|
1957 |
| -If a `@check` fails in a mutation, the top-level field containing it will be |
1958 |
| -replaced with a partial error, whose message can be customzied via the `message` |
1959 |
| -argument. Each subsequent top-level fields will return an aborted error (i.e. |
1960 |
| -not executed). To rollback previous steps, see `@transaction`. |
1961 |
| -""" |
1962 |
| -directive @check( |
1963 |
| - """ |
1964 |
| - The CEL expression to test the field value (or values if nested under a list). |
1965 |
| -
|
1966 |
| - Within the CEL expression, a special value `this` evaluates to the field that |
1967 |
| - this directive is attached to. If this field occurs multiple times because |
1968 |
| - any ancestor is a list, each occurrence is tested with `this` bound to each |
1969 |
| - value. When the field itself is a list or object, `this` follows the same |
1970 |
| - structure (including all decendants selected in case of objects). |
1971 |
| -
|
1972 |
| - For any given path, if an ancestor is `null` or `[]`, the field will not be |
1973 |
| - reached and the CEL evaluation will be skipped for that path. In other words, |
1974 |
| - evaluation only takes place when `this` is `null` or non-null, but never |
1975 |
| - undefined. (See also the `optional` argument.) |
1976 |
| - """ |
1977 |
| - expr: Boolean_Expr! = "!(this in [null, []])" |
1978 |
| - """ |
1979 |
| - The error message to return to the client if the check fails. |
1980 |
| -
|
1981 |
| - Defaults to "permission denied" if not specified. |
1982 |
| - """ |
1983 |
| - message: String! = "permission denied" |
1984 |
| - """ |
1985 |
| - Whether the check should pass or fail (default) when the field is not present. |
1986 |
| -
|
1987 |
| - A field will not be reached at a given path if its parent or any ancestor is |
1988 |
| - `[]` or `null`. When this happens to all paths, the field will not be present |
1989 |
| - anywhere in the response tree. In other words, `expr` is evaluated 0 times. |
1990 |
| - By default, @check will automatically fail in this case. Set this argument to |
1991 |
| - `true` to make it pass even if no tests are run (a.k.a. "vacuously true"). |
1992 |
| - """ |
1993 |
| - optional: Boolean = false |
1994 |
| -) repeatable on QUERY | MUTATION | FIELD | FRAGMENT_DEFINITION | FRAGMENT_SPREAD | INLINE_FRAGMENT |
1995 |
| - |
1996 |
| -type Mutation { |
1997 |
| - """ |
1998 |
| - Run a query during the mutation and add fields into the response. |
1999 |
| -
|
2000 |
| - Example: foo: query { users { id } } will add a field foo: {users: [{id: "..."}, …]} into the response JSON. |
2001 |
| -
|
2002 |
| - Note: Data fetched this way can be handy for permission checks. See @check. |
2003 |
| - """ |
2004 |
| - query: Query |
2005 |
| -} |
2006 |
| - |
0 commit comments