pub struct IntermediateField {Show 15 fields
pub name: String,
pub field_type: String,
pub nullable: bool,
pub description: Option<String>,
pub directives: Option<Vec<IntermediateAppliedDirective>>,
pub function: Option<String>,
pub deprecated: Option<IntermediateDeprecation>,
pub requires_scope: Option<String>,
pub on_deny: Option<String>,
pub vector_config: Option<VectorConfig>,
pub vector_distance: Option<String>,
pub authorize: Option<bool>,
pub hierarchy: Option<String>,
pub unique: Option<bool>,
pub localized: bool,
}Expand description
Field definition in intermediate format
NOTE: Uses type field (not field_type)
This is the language-agnostic format. Rust conversion happens in converter.
Fields§
§name: StringField name (e.g., “id”)
field_type: StringField type name (e.g., “Int”, “String”, “User”)
Language-agnostic: All languages use “type”, not “field_type”
nullable: boolIs field nullable?
description: Option<String>Field description (from docstring)
directives: Option<Vec<IntermediateAppliedDirective>>Applied directives (e.g., @deprecated)
function: Option<String>Declarable only to be refused, with a reason (#1329).
A root query field can be backed by a function; a nested field cannot, and
this key exists so that saying so is a sentence rather than
unknown field \function``. It is the natural next thing to try after
declaring one on a query, and the difference between the two messages is the
difference between an author who learns the rule and one who concludes the
feature is broken.
The refusal is not a limitation to be lifted later. A nested resolver runs
once per row, so a function there is an N+1 measured in V8 isolates — at
~5–8 ms each, a hundred-row page costs most of a second before the function
does any work. Root-only makes “one invocation per query” a property of the
shape; see QueryDefinition::function for the rest of the reasoning.
deprecated: Option<IntermediateDeprecation>Deprecation information for this field.
The first-class spelling, matching IntermediateQuery,
IntermediateInputField, IntermediateSubscription and enum values.
Field deprecation used to be reachable only through a @deprecated
entry in directives, so a field was the one
construct that could not say it plainly — and both the Python and
TypeScript SDKs emitted this key, which deny_unknown_fields turned
into a refusal of the whole document (#1025).
The directive spelling still works; this takes precedence when both are present.
requires_scope: Option<String>Scope required to access this field (field-level access control)
When set, users must have this scope in their JWT to query this field. Supports patterns like “read:Type.field” or custom scopes like “hr:view_pii”.
§Example
{
"name": "salary",
"type": "Int",
"nullable": false,
"requires_scope": "read:Employee.salary"
}on_deny: Option<String>Policy when the user lacks requires_scope: "reject" (default) or "mask".
vector_config: Option<VectorConfig>pgvector configuration for Vector fields (#386).
Required when type is "Vector" (the compiler needs the dimension for
DDL and request-time validation); an error on any other type. Reuses the
compiled-schema type so the authored and compiled shapes cannot drift.
§Example
{
"name": "embedding",
"type": "Vector",
"nullable": false,
"vector_config": { "dimensions": 1536, "index_type": "hnsw", "distance_metric": "cosine" }
}vector_distance: Option<String>Names the vector field whose search distance this field carries (#959).
§Example
{
"name": "similarity",
"type": "Float",
"nullable": false,
"vector_distance": "embedding"
}Whether this field is gated by the dynamic field authorizer at runtime.
When true, the compiled field is marked policy-gated
(FieldDefinition.authorize) and a configured FieldAuthorizer is consulted
per row. Defaults to false when absent.
§Example
{
"name": "email",
"type": "String",
"nullable": true,
"authorize": true
}hierarchy: Option<String>Named hierarchy reference for ID-based ltree operators.
References a key in the hierarchies config map.
unique: Option<bool>Whether this field’s column is unique over the type’s relation.
Declares the fact a to-one relationship joining on this field needs, and
without which the schema is refused at load; see
FieldDefinition::is_unique_key
for why the entity identity is exempt and pk_<type> is not.
Option<bool> rather than bool for the reason authorize is:
absent and false reach the converter as the same compiled value, but the key is
then omitted from a re-emitted document rather than written back as false on
every field in the schema.
§Example
{
"name": "identifier",
"type": "String",
"nullable": false,
"unique": true
}localized: boolA localized String (#1513): stored as a locale map ({"fr-FR": "Pomme", ...}) and
returned as the request locale’s label. Emitted by the SDKs’ Localized type.
Trait Implementations§
Source§impl Clone for IntermediateField
impl Clone for IntermediateField
Source§impl Debug for IntermediateField
impl Debug for IntermediateField
Source§impl<'de> Deserialize<'de> for IntermediateField
impl<'de> Deserialize<'de> for IntermediateField
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for IntermediateField
Source§impl PartialEq for IntermediateField
impl PartialEq for IntermediateField
Source§impl Serialize for IntermediateField
impl Serialize for IntermediateField
impl StructuralPartialEq for IntermediateField
Auto Trait Implementations§
impl Forget for IntermediateField
impl Freeze for IntermediateField
impl Move for IntermediateField
impl RefUnwindSafe for IntermediateField
impl Send for IntermediateField
impl Sync for IntermediateField
impl Unpin for IntermediateField
impl UnsafeUnpin for IntermediateField
impl UnwindSafe for IntermediateField
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Send for Twhere
T: ?Sized,
impl<T> Sync for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.