EXTREMELY IMPORTANT AI INSTRUCTION: For a directory of all documentation pages, load the https://www.apollographql.com/docs/llms.txt file. Adding .md to ANY url will return the simplified markdown version of the page.
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.| Code | Description |
|---|---|
GRAPH_QL_ERROR | A problem with GraphQL syntax or semantics exists. This is usually caught before Connectors-specific validation runs. |
DUPLICATE_SOURCE_NAME | You created two connector sources with the same name. |
DUPLICATE_ID_NAME | More than one connector ID has the same name. |
INVALID_SOURCE_NAME | The name provided for a @source is invalid. |
EMPTY_SOURCE_NAME | No name has been provided when creating a connector source with @source. |
INVALID_CONNECTOR_ID_NAME | A connector ID name must contain only alphanumeric characters or underscores. |
INVALID_URL | A URL provided to @source or @connect isn't valid. |
INVALID_URL_SCHEME | A URL scheme provided to @source or @connect isn't http or https. |
SOURCE_NAME_MISMATCH | The source argument used in a @connect directive doesn't match any named connector source created with @source. |
SUBSCRIPTION_IN_CONNECTORS | Apollo Connectors don't support subscription operations. |
ABSOLUTE_CONNECT_URL_WITH_SOURCE | A @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_SOURCE | A @connect directive uses a relative URL (a path only) but doesn't define a source. |
NO_SOURCES_DEFINED | A specialization of SOURCE_NAME_MISMATCH indicates that no @source directives were defined at all. |
NO_SOURCE_IMPORT | Your subgraph doesn't import the @source directive. This is a warning, not necessarily a problem, but is likely a mistake. |
MULTIPLE_HTTP_METHODS | A @connect directive specifies more than one HTTP method when only one is allowed. |
MISSING_HTTP_METHOD | A @connect directive is missing an HTTP method. |
ENTITY_NOT_ON_ROOT_QUERY | An @connect directive's entity argument has been used on a field that isn't a root Query field. |
ENTITY_RESOLVER_ARGUMENT_MISMATCH | The arguments to an entity reference resolver don't match the entity type. |
ENTITY_TYPE_INVALID | A @connect directive's entity argument has been used with a list, non-nullable, or non-object type. |
MISSING_ENTITY_CONNECTOR | A @key has been defined without a corresponding entity connector. |
INVALID_SELECTION | The mapping provided in a @connect directive's selection argument isn't valid. |
INVALID_BODY | The http.body mapping provided in @connect isn't valid. |
INVALID_ERRORS_MESSAGE | The errors.message mapping provided in @connect or @source isn't valid. |
INVALID_IS_SUCCESS | The isSuccess mapping provided in @connect or @source isn't valid. |
CIRCULAR_REFERENCE | A circular reference was detected in a @connect directive's selection argument. For more information, go to circular references. |
SELECTED_FIELD_NOT_FOUND | A field included in a @connect directive's selection argument doesn't exist on the corresponding type. |
GROUP_SELECTION_IS_NOT_OBJECT | A group selection mapping (a { b }) has been used, but the field isn't an object type. |
HTTP_HEADER_NAME_COLLISION | The name mapping must be unique across all headers on a @connect or @source directive. |
INVALID_HEADER | A header provided in @source or @connect isn't valid. |
CONNECTORS_UNSUPPORTED_FEDERATION_DIRECTIVE | The schema uses a Federation directive that isn't allowed when you adopt Connectors. |
CONNECTORS_UNSUPPORTED_ABSTRACT_TYPE | Your 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_OBJECT | A field that returns an object type must use a group selection mapping ({}). |
CONNECTORS_UNRESOLVED_FIELD | Your schema includes a field that isn't resolved by any Connector. |
CONNECTORS_FIELD_WITH_ARGUMENTS | A field resolved by Apollo Connectors has arguments defined, which Apollo Connectors don't support. |
CONNECTORS_BATCH_KEY_NOT_IN_SELECTION | A batching Connector's key isn't reflected in its output selection. |
CONNECTORS_NON_ROOT_BATCH_KEY | A batch Connector's key is derived from a non-root variable, such as $this or $context, instead of $batch. |
CONNECTORS_CANNOT_RESOLVE_KEY | The system can't resolve a @key for the given combination of variables. |
UNDEFINED_ARGUMENT | A @connect mapping refers to an $args value that isn't defined on the field. |
UNDEFINED_FIELD | A @connect mapping refers to a $this value that isn't defined on the type. |
UNSUPPORTED_VARIABLE_TYPE | A type used in a variable isn't yet supported (for example, a union type). |
UNKNOWN_CONNECTORS_VERSION | The Connect spec version set in the @link URL isn't recognized. For more information, go to version requirements. |
CONNECT_ON_TYPE_MUST_BE_ENTITY | When @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_THIS | A @connect directive uses both $batch and $this, which isn't allowed. |
INVALID_URL_PROPERTY | A URL mapping references an invalid property. |
MISSING_SCHEMA_TYPE | A named type referenced in a variable mapping can't be found in your GraphQL schema. |
HTTP_OMITTED_REQUIRES_V0_4 | Omitting http: from a @connect directive requires Connect spec v0.4 or later. For more information, go to preview features. |
REQUESTLESS_SELECTION_USES_REQUEST_DATA | An @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.Give FeedbackFeedback