pub struct IntermediateQuery {Show 23 fields
pub name: String,
pub return_type: String,
pub returns_list: bool,
pub nullable: bool,
pub arguments: Vec<IntermediateArgument>,
pub description: Option<String>,
pub sql_source: Option<String>,
pub function: Option<String>,
pub auto_params: Option<IntermediateAutoParams>,
pub deprecated: Option<IntermediateDeprecation>,
pub jsonb_column: Option<String>,
pub relay: bool,
pub count: bool,
pub inject: IndexMap<String, String>,
pub read_routing: ReadRouting,
pub cache_ttl_seconds: Option<u64>,
pub additional_views: Vec<String>,
pub requires_role: Option<String>,
pub requires_actor: Vec<String>,
pub relay_cursor_type: Option<String>,
pub rest: Option<IntermediateRest>,
pub rest_stream: bool,
pub pagination_order: Option<String>,
}Expand description
Query definition in intermediate format
Fields§
§name: StringQuery name (e.g., “users”)
return_type: StringReturn type name (e.g., “User”)
returns_list: boolReturns a list?
nullable: boolResult is nullable?
arguments: Vec<IntermediateArgument>Query arguments
description: Option<String>Query description (from docstring)
sql_source: Option<String>SQL source (table/view name)
function: Option<String>Back this root field with a declared function instead of a relation (#1329).
Names an entry in the functions section whose trigger is request:query.
Mutually exclusive with sql_source — a field resolves
one way, and a precedence rule would be one more thing to remember wrong.
Everything that lowers into SQL is refused beside it rather than ignored:
relay, count, pagination_order, inject_params, rest_stream,
jsonb_column, a non-default read_routing, and an explicitly declared
auto_params flag. Each of those is a setting the compiler would otherwise
carry into an artifact where nothing reads it, and one of them
(inject_params) is a tenant-scoping control — a silently dropped security
setting is the failure this seam exists to refuse.
Project-wide [query_defaults] are not refused, only defaulted away: an
author who set limit = true for the project did not declare it for this
query, and failing their compile over a default they never wrote here would
be refusing the wrong statement.
auto_params: Option<IntermediateAutoParams>Auto-generated parameters config
deprecated: Option<IntermediateDeprecation>Deprecation info (from @deprecated directive)
jsonb_column: Option<String>JSONB column name for extracting data (e.g., “data”) Used for tv_* (denormalized JSONB tables) pattern
relay: boolWhether this is a Relay connection query.
When true, the compiler wraps results in { edges: [{ node, cursor }], pageInfo }
and generates first/after/last/before arguments instead of limit/offset.
Requires returns_list = true and sql_source to be set.
count: boolEmit a <name>Count(where): Int! sibling for this list query (#938).
Opt-in rather than automatic: the count is a second SELECT COUNT(*) that
scans the whole filtered set, which is a real cost on a hot list endpoint
and is wasted on every list that is not rendered with page numbers.
Requires returns_list = true and sql_source. Refused on relay = true
— a connection already carries totalCount.
inject: IndexMap<String, String>Server-injected parameters: SQL column name → source expression (e.g. "jwt:org_id").
Not exposed as GraphQL arguments.
Wire key is inject_params, matching the compiled schema. The two names were
unified because the split is what let three SDKs emit a key that bound to
nothing (#806); see the inject_params_serde module for the full reasoning.
read_routing: ReadRoutingWhere this query’s reads may be served from (#957).
any (the default) follows server policy; primary refuses replicas —
and the result cache — for reads where staleness is a correctness problem;
replica opts out of the read-your-writes pin and may carry its own
max_lag_ms.
FraiseQL defines the shape and enforces it; an authoring language emits
it — a @reads_from(...) directive is one spelling.
cache_ttl_seconds: Option<u64>Per-query result cache TTL in seconds. Overrides the global cache TTL for this query.
additional_views: Vec<String>Additional database views this query reads beyond the primary sql_source.
Used for correct cache invalidation when a query JOINs or reads multiple views. Each entry is validated as a safe SQL identifier at schema compile time.
requires_role: Option<String>Role required to execute this query and see it in introspection.
requires_actor: Vec<String>Actor classes permitted to execute this query — an allow-list (#966).
Empty means unrestricted. Tokens are the snake_case ActorType names
(human_user, service_account, ai_agent, system_job); an
unrecognised one is a compile error rather than a silently-ignored
restriction, which is the difference between a typo and an open operation.
relay_cursor_type: Option<String>Relay cursor column type: "uuid" for UUID PKs, "int64" (or absent) for bigint PKs.
Only meaningful when relay = true.
rest: Option<IntermediateRest>REST route override for this query. See IntermediateRest.
rest_stream: boolAllow this query to be exported as a stream over REST (#958).
Separate from rest rather than a key inside it, because
that block’s path is mandatory: nesting the flag there would make every
author who wants an export also override the route.
pagination_order: Option<String>Override the order this query’s LIMIT/OFFSET pages are cut in (#1303).
Two spellings, and absence is the third:
- a column name — order pages by this column, which must be unique over
sql_sourceor the pages still overlap; - the literal
"none"— emit no default ordering. This is how a view that carries its ownORDER BYkeeps it: the compiler cannot read a view’s body, so the opt-out is declared rather than inferred, and declaring it also silences the compile warning about non-deterministic pages, because the author answered it. - absent — the compiler derives the entity identity, which is what almost every query wants.
"none" is therefore not usable as a column name here. A relation column
actually called none must be ordered by through the SQL view instead.
Trait Implementations§
Source§impl Clone for IntermediateQuery
impl Clone for IntermediateQuery
Source§impl Debug for IntermediateQuery
impl Debug for IntermediateQuery
Source§impl Default for IntermediateQuery
impl Default for IntermediateQuery
Source§impl<'de> Deserialize<'de> for IntermediateQuery
impl<'de> Deserialize<'de> for IntermediateQuery
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 IntermediateQuery
Source§impl PartialEq for IntermediateQuery
impl PartialEq for IntermediateQuery
Source§impl Serialize for IntermediateQuery
impl Serialize for IntermediateQuery
impl StructuralPartialEq for IntermediateQuery
Auto Trait Implementations§
impl Freeze for IntermediateQuery
impl RefUnwindSafe for IntermediateQuery
impl Send for IntermediateQuery
impl Sync for IntermediateQuery
impl Unpin for IntermediateQuery
impl UnsafeUnpin for IntermediateQuery
impl UnwindSafe for IntermediateQuery
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.