Apollo Connectors Composition Error Codes

Reference for error codes raised during schema composition


When a Connectors-enabled subgraph schema fails validation during Federation composition, the resulting error includes a code. These codes are stable: once published, a code's meaning doesn't change, though we may add new codes over time.

note
This reference covers composition-time codes only—the codes returned in graph publish output, rover subgraph check, and GraphOS Studio schema checks. This reference doesn't cover runtime error codes (such as CONNECTOR_FETCH or GATEWAY_TIMEOUT), which appear in GraphQL errors.extensions.code when a Connector call fails at request time. For those, go to the error handling documentation.
CodeDescription
GRAPH_QL_ERRORA problem with GraphQL syntax or semantics exists. This is usually caught before Connectors-specific validation runs.
DUPLICATE_SOURCE_NAMEYou created two connector sources with the same name.
DUPLICATE_ID_NAMEMore than one connector ID has the same name.
INVALID_SOURCE_NAMEThe name provided for a @source is invalid.
EMPTY_SOURCE_NAMENo name has been provided when creating a connector source with @source.
INVALID_CONNECTOR_ID_NAMEA connector ID name must contain only alphanumeric characters or underscores.
INVALID_URLA URL provided to @source or @connect isn't valid.
INVALID_URL_SCHEMEA URL scheme provided to @source or @connect isn't http or https.
SOURCE_NAME_MISMATCHThe source argument used in a @connect directive doesn't match any named connector source created with @source.
SUBSCRIPTION_IN_CONNECTORSApollo Connectors don't support subscription operations.
ABSOLUTE_CONNECT_URL_WITH_SOURCEA @connect directive uses a source, but that directive's URL is absolute. When you set a source, the @connect URL should be a relative path—the router joins it with the @source URL.
RELATIVE_CONNECT_URL_WITHOUT_SOURCEA @connect directive uses a relative URL (a path only) but doesn't define a source.
NO_SOURCES_DEFINEDA specialization of SOURCE_NAME_MISMATCH indicates that no @source directives were defined at all.
NO_SOURCE_IMPORTYour subgraph doesn't import the @source directive. This is a warning, not necessarily a problem, but is likely a mistake.
MULTIPLE_HTTP_METHODSA @connect directive specifies more than one HTTP method when only one is allowed.
MISSING_HTTP_METHODA @connect directive is missing an HTTP method.
ENTITY_NOT_ON_ROOT_QUERYAn @connect directive's entity argument has been used on a field that isn't a root Query field.
ENTITY_RESOLVER_ARGUMENT_MISMATCHThe arguments to an entity reference resolver don't match the entity type.
ENTITY_TYPE_INVALIDA @connect directive's entity argument has been used with a list, non-nullable, or non-object type.
MISSING_ENTITY_CONNECTORA @key has been defined without a corresponding entity connector.
INVALID_SELECTIONThe mapping provided in a @connect directive's selection argument isn't valid.
INVALID_BODYThe http.body mapping provided in @connect isn't valid.
INVALID_ERRORS_MESSAGEThe errors.message mapping provided in @connect or @source isn't valid.
INVALID_IS_SUCCESSThe isSuccess mapping provided in @connect or @source isn't valid.
CIRCULAR_REFERENCEA circular reference was detected in a @connect directive's selection argument. For more information, go to circular references.
SELECTED_FIELD_NOT_FOUNDA field included in a @connect directive's selection argument doesn't exist on the corresponding type.
GROUP_SELECTION_IS_NOT_OBJECTA group selection mapping (a { b }) has been used, but the field isn't an object type.
HTTP_HEADER_NAME_COLLISIONThe name mapping must be unique across all headers on a @connect or @source directive.
INVALID_HEADERA header provided in @source or @connect isn't valid.
CONNECTORS_UNSUPPORTED_FEDERATION_DIRECTIVEThe schema uses a Federation directive that isn't allowed when you adopt Connectors.
CONNECTORS_UNSUPPORTED_ABSTRACT_TYPEYour schema uses an abstract type (interface or union) that isn't supported by the Connect spec version in use. For more information, go to limitations.
GROUP_SELECTION_REQUIRED_FOR_OBJECTA field that returns an object type must use a group selection mapping ({}).
CONNECTORS_UNRESOLVED_FIELDYour schema includes a field that isn't resolved by any Connector.
CONNECTORS_FIELD_WITH_ARGUMENTSA field resolved by Apollo Connectors has arguments defined, which Apollo Connectors don't support.
CONNECTORS_BATCH_KEY_NOT_IN_SELECTIONA batching Connector's key isn't reflected in its output selection.
CONNECTORS_NON_ROOT_BATCH_KEYA batch Connector's key is derived from a non-root variable, such as $this or $context, instead of $batch.
CONNECTORS_CANNOT_RESOLVE_KEYThe system can't resolve a @key for the given combination of variables.
UNDEFINED_ARGUMENTA @connect mapping refers to an $args value that isn't defined on the field.
UNDEFINED_FIELDA @connect mapping refers to a $this value that isn't defined on the type.
UNSUPPORTED_VARIABLE_TYPEA type used in a variable isn't yet supported (for example, a union type).
UNKNOWN_CONNECTORS_VERSIONThe Connect spec version set in the @link URL isn't recognized. For more information, go to version requirements.
CONNECT_ON_TYPE_MUST_BE_ENTITYWhen @connect is applied directly to a type, entity can't be set to false.
CONNECT_ON_ROOT@connect can't be applied to a Query, Mutation, or Subscription root type itself.
CONNECT_BATCH_AND_THISA @connect directive uses both $batch and $this, which isn't allowed.
INVALID_URL_PROPERTYA URL mapping references an invalid property.
MISSING_SCHEMA_TYPEA named type referenced in a variable mapping can't be found in your GraphQL schema.
HTTP_OMITTED_REQUIRES_V0_4Omitting http: from a @connect directive requires Connect spec v0.4 or later. For more information, go to preview features.
REQUESTLESS_SELECTION_USES_REQUEST_DATAAn @connect directive has no transport (http: is absent) but its selection reads request-phase data ($root, $status, or $response), which doesn't bind at runtime.
note
NO_SOURCE_IMPORT is the only code in this table that's a warning rather than an error—it doesn't stop composition.