-
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?
Conversation
|
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
|
d535d07
to
b717d13
Compare
</td> | ||
<td> | ||
|
||
Using both [`$batch`](/graphos/connectors/mapping/variables#batch) and [`$this`](/graphos/connectors/mapping/variables#this) in a mapping is not allowed. |
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.
Using both [`$batch`](/graphos/connectors/mapping/variables#batch) and [`$this`](/graphos/connectors/mapping/variables#this) in a mapping is not allowed. | |
Using both [`$batch`](/graphos/connectors/mapping/variables#batch) and [`$this`](/graphos/connectors/mapping/variables#this) in the same connector is not allowed. |
<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`. |
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.
selection's are expected contain at least one of the following variables: `$args`, `$this`, or `$batch`. | |
selections are expected contain at least one of the following variables: `$args`, `$this`, or `$batch`. |
Librarian is correct
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.
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.
Variables (such as `$this` or `$context`) to define Connector `$batch` selections. | ||
Batch selections should be mapped from the `$batch` variable. |
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.
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:
Variables (such as `$this` or `$context`) to define Connector `$batch` selections. | |
Batch selections should be mapped from the `$batch` variable. | |
The `selection` fields which match any used `$batch` fields must come from the API response, not from any other variables. |
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> | ||
<td> | ||
|
||
`@connect` cannot be applied to a query, mutation, or subscription root type |
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.
`@connect` cannot be applied to a query, mutation, or subscription root type | |
`@connect` cannot be applied to a query, mutation, or subscription root type. |
For librarian
<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 comment
The reason will be displayed to describe this comment to others. Learn more.
The schema includes fields that aren't resolved by a [connector](/graphos/connectors). | |
When using [Connectors](/graphos/connectors) in a schema, every field must be resolvable by at least one Connector. To solve this problem, you will need to either add a `@connect` to the field in question, or add the field to the `selection` of an existing `@connect`. |
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.
I know you just added the link, but I figure we could explain the solution a bit while we're here.
Updates error code documentation for new
$batch
error codes.Also adds links to a few error messages where it may be helpful.