-
Notifications
You must be signed in to change notification settings - Fork 269
docs: Update connectors error codes #3260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -62,14 +62,89 @@ | |||||||
<tr> | ||||||||
<td> | ||||||||
|
||||||||
##### `CONNECT_BATCH_AND_THIS` | ||||||||
|
||||||||
Since v2.11.0<sup>\*\*</sup> | ||||||||
|
||||||||
</td> | ||||||||
<td> | ||||||||
|
||||||||
Using both [`$batch`](/graphos/connectors/mapping/variables#batch) and [`$this`](/graphos/connectors/mapping/variables#this) in a mapping is not allowed. | ||||||||
|
||||||||
</td> | ||||||||
</tr> | ||||||||
<tr> | ||||||||
<td> | ||||||||
|
||||||||
###### `CONNECTORS_BATCH_KEY_NOT_IN_SELECTION` | ||||||||
|
||||||||
Since v2.11.0<sup>\*\*</sup> | ||||||||
|
||||||||
</td> | ||||||||
<td> | ||||||||
|
||||||||
Every field used on `$batch` must also appear in the `selection` of the same connector. | ||||||||
See [Rules for `batch` Connectors](/graphos/connectors/requests/batching#rules-for-batch-connectors) for more information. | ||||||||
|
||||||||
</td> | ||||||||
</tr> | ||||||||
<tr> | ||||||||
<td> | ||||||||
|
||||||||
###### `CONNECTORS_CANNOT_RESOLVE_KEY` | ||||||||
|
||||||||
Since v2.11.0<sup>\*\*</sup> | ||||||||
|
||||||||
</td> | ||||||||
<td> | ||||||||
|
||||||||
A `@key` could not be resolved for the given combination of variables. In order to create a valid `@key` | ||||||||
selection's are expected contain at least one of the following variables: `$args`, `$this`, or `$batch`. | ||||||||
Check failure on line 102 in docs/source/schema-design/federated-schemas/reference/errors.mdx
|
||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Librarian is correct There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's totally unclear to me from reading the code how this actually happens 😅. Seems like the user actually only gets an error if they mention a field which doesn't exist... which also generates another duplicate error. But I don't think not mentioning any variables causes this? So maybe we should be getting rid of this error code long term. It already exists in released routers now, though, so I guess we should leave it documented. |
||||||||
|
||||||||
</td> | ||||||||
</tr> | ||||||||
<tr> | ||||||||
<td> | ||||||||
|
||||||||
###### `CONNECTORS_FIELD_WITH_ARGUMENTS` | ||||||||
|
||||||||
Since v2.10.0<sup>\*\*</sup> | ||||||||
|
||||||||
</td> | ||||||||
<td> | ||||||||
|
||||||||
A field resolved by a connector has arguments defined. | ||||||||
A field resolved by a [connector](/graphos/connectors) has arguments defined. | ||||||||
|
||||||||
</td> | ||||||||
</tr> | ||||||||
<tr> | ||||||||
<td> | ||||||||
|
||||||||
###### `CONNECTORS_NON_ROOT_BATCH_KEY` | ||||||||
|
||||||||
Since v2.11.0<sup>\*\*</sup> | ||||||||
|
||||||||
|
||||||||
</td> | ||||||||
<td> | ||||||||
|
||||||||
Variables (such as `$this` or `$context`) to define Connector `$batch` selections. | ||||||||
Check failure on line 131 in docs/source/schema-design/federated-schemas/reference/errors.mdx
|
||||||||
Batch selections should be mapped from the `$batch` variable. | ||||||||
Check warning on line 132 in docs/source/schema-design/federated-schemas/reference/errors.mdx
|
||||||||
Comment on lines
+131
to
+132
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't even know why we have this restriction—that doesn't seem like it should be required? But I think we should spell out the issue more clearly:
Suggested change
Can you also add a good/bad to https://www.apollographql.com/docs/graphos/connectors/requests/batching#rules-for-batch-connectors that we can link to here? Unless I'm misunderstanding the code—but again, I'm not sure why we added this restriction? What if the ID comes back in a header for some reason? |
||||||||
|
||||||||
</td> | ||||||||
</tr> | ||||||||
<tr> | ||||||||
<td> | ||||||||
|
||||||||
|
||||||||
###### `CONNECT_ON_ROOT` | ||||||||
|
||||||||
Since v2.11.0<sup>\*\*</sup> | ||||||||
|
||||||||
</td> | ||||||||
<td> | ||||||||
|
||||||||
`@connect` cannot be applied to a query, mutation, or subscription root type | ||||||||
Check warning on line 147 in docs/source/schema-design/federated-schemas/reference/errors.mdx
|
||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
For librarian |
||||||||
|
||||||||
</td> | ||||||||
</tr> | ||||||||
|
@@ -83,7 +158,7 @@ | |||||||
</td> | ||||||||
<td> | ||||||||
|
||||||||
The schema includes fields that aren't resolved by a connector. | ||||||||
The schema includes fields that aren't resolved by a [connector](/graphos/connectors). | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know you just added the link, but I figure we could explain the solution a bit while we're here. |
||||||||
|
||||||||
</td> | ||||||||
</tr> | ||||||||
|
@@ -97,7 +172,7 @@ | |||||||
</td> | ||||||||
<td> | ||||||||
|
||||||||
[Abstract types](/graphos/schema-design/connectors/limitations#abstract-schema-types-are-unsupported) are not allowed when using connectors. | ||||||||
[Abstract types](/graphos/connectors/reference/limitations#abstract-schema-types-are-unsupported) are not allowed when using connectors. | ||||||||
Check warning on line 175 in docs/source/schema-design/federated-schemas/reference/errors.mdx
|
||||||||
|
||||||||
</td> | ||||||||
</tr> | ||||||||
|
@@ -111,7 +186,7 @@ | |||||||
</td> | ||||||||
<td> | ||||||||
|
||||||||
[Certain directives](/graphos/schema-design/connectors/limitations) are not allowed when using connectors. | ||||||||
[Certain directives](/graphos/connectors/reference/limitations) are not allowed when using connectors. | ||||||||
Check warning on line 189 in docs/source/schema-design/federated-schemas/reference/errors.mdx
|
||||||||
|
||||||||
</td> | ||||||||
</tr> | ||||||||
|
@@ -199,7 +274,7 @@ | |||||||
</td> | ||||||||
<td> | ||||||||
|
||||||||
Indicates two connector sources with the same name were created. | ||||||||
Indicates two connector [sources](/graphos/connectors/requests#sharing-configuration-with-source) with the same name were created. | ||||||||
Check warning on line 277 in docs/source/schema-design/federated-schemas/reference/errors.mdx
|
||||||||
|
||||||||
</td> | ||||||||
</tr> | ||||||||
|
@@ -242,7 +317,7 @@ | |||||||
</td> | ||||||||
<td> | ||||||||
|
||||||||
No `name` was provided when creating a connector source with `@source`. | ||||||||
No `name` was provided when creating a connector source with [`@source`](/graphos/connectors/requests#sharing-configuration-with-source). | ||||||||
Check warning on line 320 in docs/source/schema-design/federated-schemas/reference/errors.mdx
|
||||||||
|
||||||||
</td> | ||||||||
</tr> | ||||||||
|
@@ -477,7 +552,7 @@ | |||||||
<tr> | ||||||||
<td> | ||||||||
|
||||||||
###### `GRAPHQL_ERROR` | ||||||||
###### `GRAPH_QL_ERROR` | ||||||||
|
||||||||
Since v2.10.0<sup>\*\*</sup> | ||||||||
|
||||||||
|
@@ -512,7 +587,7 @@ | |||||||
</td> | ||||||||
<td> | ||||||||
|
||||||||
Fields that return an object type must use a group selection mapping `{}`. | ||||||||
Fields that return an object type must use a group selection mapping (i.e. `a { b }`). | ||||||||
|
||||||||
</td> | ||||||||
</tr> | ||||||||
|
@@ -568,7 +643,7 @@ | |||||||
</td> | ||||||||
<td> | ||||||||
|
||||||||
The `http.body` provided in `@connect` was not valid. | ||||||||
The mapping for `http.body` provided in `@connect` was not valid. See [Mapping Language Reference](/graphos/connectors/mapping) for more information on writing mappings. | ||||||||
Check warning on line 646 in docs/source/schema-design/federated-schemas/reference/errors.mdx
|
||||||||
|
||||||||
</td> | ||||||||
</tr> | ||||||||
|
@@ -582,7 +657,7 @@ | |||||||
</td> | ||||||||
<td> | ||||||||
|
||||||||
A provided header in `@source` or `@connect` was not valid. | ||||||||
A provided header in `@source` or `@connect` was not valid. See [Headers](/graphos/connectors/requests#headers) for more on connector request headers. | ||||||||
Check warning on line 660 in docs/source/schema-design/federated-schemas/reference/errors.mdx
|
||||||||
|
||||||||
</td> | ||||||||
</tr> | ||||||||
|
@@ -596,7 +671,7 @@ | |||||||
</td> | ||||||||
<td> | ||||||||
|
||||||||
The provided selection mapping in a `@connect`s `selection` was not valid. | ||||||||
The provided selection mapping in a `@connect`s `selection` was not valid. See [Mapping Language Reference](/graphos/connectors/mapping) for more information on writing selection mappings. | ||||||||
Check failure on line 674 in docs/source/schema-design/federated-schemas/reference/errors.mdx
|
||||||||
|
||||||||
</td> | ||||||||
</tr> | ||||||||
|
@@ -610,7 +685,7 @@ | |||||||
</td> | ||||||||
<td> | ||||||||
|
||||||||
The `name` provided for a `@source` was invalid. Source names must start with a letter, include only letters, numbers, underscores (`_`) and hyphens (`-`), and be less than 64 characters. | ||||||||
The `name` provided for a [`@source`](/graphos/connectors/requests#sharing-configuration-with-source) was invalid. Source names must start with a letter, include only letters, numbers, underscores (`_`) and hyphens (`-`), and be less than 64 characters. | ||||||||
Check warning on line 688 in docs/source/schema-design/federated-schemas/reference/errors.mdx
|
||||||||
|
||||||||
</td> | ||||||||
</tr> | ||||||||
|
@@ -918,7 +993,7 @@ | |||||||
</td> | ||||||||
<td> | ||||||||
|
||||||||
A `@key` was defined without a corresponding entity connector. | ||||||||
A `@key` was defined without a corresponding entity connector. See: [Working with Entities](/graphos/connectors/responses/entities) for more information. | ||||||||
Check warning on line 996 in docs/source/schema-design/federated-schemas/reference/errors.mdx
|
||||||||
|
||||||||
</td> | ||||||||
</tr> | ||||||||
|
@@ -932,7 +1007,7 @@ | |||||||
</td> | ||||||||
<td> | ||||||||
|
||||||||
The `@connect` directive is missing an HTTP method. | ||||||||
The `@connect` directive is missing an [HTTP method](/graphos/connectors/requests#http-methods). | ||||||||
|
||||||||
</td> | ||||||||
</tr> | ||||||||
|
@@ -946,7 +1021,7 @@ | |||||||
</td> | ||||||||
<td> | ||||||||
|
||||||||
The `@connect` directive has multiple HTTP methods when only one is allowed. | ||||||||
The `@connect` directive has multiple [HTTP methods](/graphos/connectors/requests#http-methods) when only one is allowed. | ||||||||
Check warning on line 1024 in docs/source/schema-design/federated-schemas/reference/errors.mdx
|
||||||||
|
||||||||
</td> | ||||||||
</tr> | ||||||||
|
@@ -1009,20 +1084,6 @@ | |||||||
<tr> | ||||||||
<td> | ||||||||
|
||||||||
###### `NULLABILITY_MISMATCH` | ||||||||
|
||||||||
Since v2.10.0<sup>\*\*</sup> | ||||||||
|
||||||||
</td> | ||||||||
<td> | ||||||||
|
||||||||
A variable is nullable in a location which requires non-null at runtime. | ||||||||
|
||||||||
</td> | ||||||||
</tr> | ||||||||
<tr> | ||||||||
<td> | ||||||||
|
||||||||
###### `ONLY_INACCESSIBLE_CHILDREN` | ||||||||
|
||||||||
Since v2.0.0 | ||||||||
|
@@ -1464,7 +1525,7 @@ | |||||||
</td> | ||||||||
<td> | ||||||||
|
||||||||
The `source` argument used in a `@connect` directive doesn't match any named connecter sources created with `@source`. | ||||||||
The `source` argument used in a `@connect` directive doesn't match any named connector sources created with [`@source`](/graphos/connectors/requests#sharing-configuration-with-source). | ||||||||
Check warning on line 1528 in docs/source/schema-design/federated-schemas/reference/errors.mdx
|
||||||||
|
||||||||
</td> | ||||||||
</tr> | ||||||||
|
@@ -1478,7 +1539,7 @@ | |||||||
</td> | ||||||||
<td> | ||||||||
|
||||||||
Connectors currently [don't support subscription operations](/graphos/schema-design/connectors/limitations#subscriptions-are-unsupported). | ||||||||
Connectors currently [don't support subscription operations](/graphos/connectors/reference/limitations#subscriptions-are-unsupported). | ||||||||
|
||||||||
</td> | ||||||||
</tr> | ||||||||
|
@@ -1536,7 +1597,7 @@ | |||||||
</td> | ||||||||
<td> | ||||||||
|
||||||||
Part of the `@connect` refers to an `$args` which is not defined. | ||||||||
Part of the `@connect` directive refers to an [`$args`](/graphos/connectors/mapping/variables#args) which is not defined. | ||||||||
Check warning on line 1600 in docs/source/schema-design/federated-schemas/reference/errors.mdx
|
||||||||
|
||||||||
</td> | ||||||||
</tr> | ||||||||
|
@@ -1550,7 +1611,7 @@ | |||||||
</td> | ||||||||
<td> | ||||||||
|
||||||||
Part of the `@connect` refers to an `$this` which is not defined. | ||||||||
Part of the `@connect` directive refers to an [`$this`](/graphos/connectors/mapping/variables#this) which is not defined. | ||||||||
Check warning on line 1614 in docs/source/schema-design/federated-schemas/reference/errors.mdx
|
||||||||
|
||||||||
</td> | ||||||||
</tr> | ||||||||
|
@@ -1634,7 +1695,7 @@ | |||||||
</td> | ||||||||
<td> | ||||||||
|
||||||||
A type used in a connector's variable is [not yet supported](/graphos/schema-design/connectors/limitations) (i.e., unions). | ||||||||
A type used in a connector's variable is [not yet supported](/graphos/connectors/reference/limitations) (i.e., unions). | ||||||||
Check warning on line 1698 in docs/source/schema-design/federated-schemas/reference/errors.mdx
|
||||||||
|
||||||||
</td> | ||||||||
</tr> | ||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.