pub enum Code {
Show 46 variants
GraphQLError,
DuplicateSourceName,
DuplicateIdName,
InvalidSourceName,
EmptySourceName,
InvalidConnectorIdName,
InvalidUrl,
InvalidUrlScheme,
SourceNameMismatch,
SubscriptionInConnectors,
AbsoluteConnectUrlWithSource,
RelativeConnectUrlWithoutSource,
NoSourcesDefined,
NoSourceImport,
MultipleHttpMethods,
MissingHttpMethod,
EntityNotOnRootQuery,
EntityResolverArgumentMismatch,
EntityTypeInvalid,
MissingEntityConnector,
InvalidSelection,
InvalidBody,
InvalidErrorsMessage,
InvalidIsSuccess,
CircularReference,
SelectedFieldNotFound,
GroupSelectionIsNotObject,
HttpHeaderNameCollision,
InvalidHeader,
ConnectorsUnsupportedFederationDirective,
ConnectorsUnsupportedAbstractType,
GroupSelectionRequiredForObject,
ConnectorsUnresolvedField,
ConnectorsFieldWithArguments,
ConnectorsBatchKeyNotInSelection,
ConnectorsNonRootBatchKey,
ConnectorsCannotResolveKey,
UndefinedArgument,
UndefinedField,
UnsupportedVariableType,
UnknownConnectorsVersion,
ConnectOnTypeMustBeEntity,
ConnectOnRoot,
ConnectBatchAndThis,
InvalidUrlProperty,
MissingSchemaType,
}Expand description
The error code that will be shown to users when a validation fails during composition.
Note that these codes are global, not scoped to connectors, so they should attempt to be unique across all pieces of composition, including JavaScript components.
Variants§
GraphQLError
A problem with GraphQL syntax or semantics was found. These will usually be caught before this validation process.
DuplicateSourceName
Indicates two connector sources with the same name were created.
DuplicateIdName
Indicates two connector IDs with the same name were created.
InvalidSourceName
The name provided for a @source was invalid.
EmptySourceName
No name was provided when creating a connector source with @source.
InvalidConnectorIdName
Connector ID name must be alphanumeric_.
InvalidUrl
A URL provided to @source or @connect was not valid.
InvalidUrlScheme
A URL scheme provided to @source or @connect was not http or https.
SourceNameMismatch
The source argument used in a @connect directive doesn’t match any named connector
sources created with @source.
SubscriptionInConnectors
Connectors currently don’t support subscription operations.
AbsoluteConnectUrlWithSource
The @connect is using a source, but the URL is absolute. This is not allowed because
the @source URL will be joined with the @connect URL, so the @connect URL should
only be a path.
RelativeConnectUrlWithoutSource
The @connect directive is using a relative URL (path only) but does not define a source.
This is a specialization of Self::InvalidUrl.
NoSourcesDefined
This is a specialization of Self::SourceNameMismatch that indicates no sources were defined.
NoSourceImport
The subgraph doesn’t import the @source directive. This isn’t necessarily a problem, but
is likely a mistake.
MultipleHttpMethods
The @connect directive has multiple HTTP methods when only one is allowed.
MissingHttpMethod
The @connect directive is missing an HTTP method.
EntityNotOnRootQuery
The @connect directive’s entity argument should only be used on the root Query field.
EntityResolverArgumentMismatch
The arguments to the entity reference resolver do not match the entity type.
EntityTypeInvalid
The @connect directive’s entity argument should only be used with non-list, nullable, object types.
MissingEntityConnector
A @key was defined without a corresponding entity connector.
InvalidSelection
The provided selection mapping in a @connects selection was not valid.
InvalidBody
The http.body provided in @connect was not valid.
InvalidErrorsMessage
The errors.message provided in @connect or @source was not valid.
InvalidIsSuccess
The isSuccess mapping provided in @connect or @source was not valid.
CircularReference
A circular reference was detected in a @connect directive’s selection argument.
SelectedFieldNotFound
A field included in a @connect directive’s selection argument is not defined on the corresponding type.
GroupSelectionIsNotObject
A group selection mapping (a { b }) was used, but the field is not an object.
HttpHeaderNameCollision
The name mapping must be unique for all headers.
InvalidHeader
A provided header in @source or @connect was not valid.
ConnectorsUnsupportedFederationDirective
Certain directives are not allowed when using connectors.
ConnectorsUnsupportedAbstractType
Abstract types are not allowed when using connectors.
GroupSelectionRequiredForObject
Fields that return an object type must use a group selection mapping {}.
ConnectorsUnresolvedField
The schema includes fields that aren’t resolved by a connector.
ConnectorsFieldWithArguments
A field resolved by a connector has arguments defined.
ConnectorsBatchKeyNotInSelection
Connector batch key is not reflected in the output selection
ConnectorsNonRootBatchKey
Connector batch key is derived from a non-root variable such as $this or $context.
ConnectorsCannotResolveKey
A @key could not be resolved for the given combination of variables.
UndefinedArgument
Part of the @connect refers to an $args which is not defined.
UndefinedField
Part of the @connect refers to an $this which is not defined.
UnsupportedVariableType
A type used in a variable is not yet supported (i.e., unions).
UnknownConnectorsVersion
The version set in the connectors @link URL is not recognized.
ConnectOnTypeMustBeEntity
When @connect is applied to a type, entity can’t be set to false
ConnectOnRoot
@connect cannot be applied to a query, mutation, or subscription root type
ConnectBatchAndThis
Using both $batch and $this is not allowed
InvalidUrlProperty
Invalid URL property
MissingSchemaType
Any named type not found in a GraphQL schema where expected
Implementations§
Trait Implementations§
impl Copy for Code
impl Eq for Code
impl StructuralPartialEq for Code
Auto Trait Implementations§
impl Freeze for Code
impl RefUnwindSafe for Code
impl Send for Code
impl Sync for Code
impl Unpin for Code
impl UnsafeUnpin for Code
impl UnwindSafe for Code
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> 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> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi Quirk value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);