@@ -28,7 +28,7 @@ export {};
2828/**
2929 * A GraphQL result.
3030 * @see [GraphQL spec for a response](https://spec.graphql.org/October2021/#sec-Response).
31- * @template [ErrorTypes=GraphQLResultError]
31+ * @template [ErrorTypes=GraphQLResultError] Possible error types.
3232 * @typedef {object } GraphQLResult
3333 * @prop {Response } [response] The GraphQL server response. Non-enumerable to
3434 * prevent it from serializing to JSON when sending SSR cache to the client
@@ -39,45 +39,41 @@ export {};
3939 */
4040
4141/**
42- * A {@link GraphQLResult.errors GraphQL result error}; either created by the
43- * GraphQL server, or by whatever loaded the GraphQL on the client (e.g.
44- * {@linkcode fetchGraphQL}).
42+ * A {@link GraphQLResult.errors GraphQL result error}.
4543 * @see [GraphQL spec for response errors](https://spec.graphql.org/October2021/#sec-Errors).
46- * @template [Extensions=Record<string, unknown>] Custom error data.
44+ * @template {Record<string, unknown>} [Extensions=Record<string, unknown>]
45+ * Extensions to a standard GraphQL error.
4746 * @typedef {object } GraphQLResultError
4847 * @prop {string } message Error message.
4948 * @prop {Array<{ line: number; column: number }> } [locations] GraphQL query
5049 * locations related to the error.
5150 * @prop {Array<string | number> } [path] GraphQL result
5251 * {@link GraphQLResult.data `data`} property path related to the error.
53- * @prop {Extensions } [extensions] Custom error data. If the error was created
54- * on the client and not the GraphQL server, this property should be present
55- * and contain at least `client: true`, although `code` and error specific
56- * properties may be present.
52+ * @prop {Extensions } [extensions] Extensions to a standard GraphQL error.
5753 */
5854
5955/**
60- * A {@link GraphQLResult GraphQL result} loading error generated by the client,
56+ * A {@link GraphQLResult GraphQL result} loading error generated on the client,
6157 * not the GraphQL server.
62- * @template {string} Code
63- * @template [Extensions={}]
64- * @typedef {Pick<
65- * GraphQLResultError<GraphQLResultErrorLoadingMeta & Extensions>,
66- * "message" | "extensions"
67- * >} GraphQLResultErrorLoading
68- *
58+ * @template {string} Code Error code.
59+ * @template {Record<string, unknown>} [Extensions={}] Error specific details.
60+ * @typedef {object } GraphQLResultErrorLoading
61+ * @prop {string } message Error message.
62+ * @prop {GraphQLResultErrorLoadingMeta<Code> & Extensions } extensions Error
63+ * specific details.
6964 */
7065
7166/**
67+ * @template {string} Code Error code.
7268 * @typedef {object } GraphQLResultErrorLoadingMeta
73- * @prop {true } client Indicates that this error was generated by the client and
74- * wasn’t present in the GraphQL response .
75- * @prop {string } code Error code.
69+ * @prop {true } client Error was generated on the client, not the GraphQL
70+ * server .
71+ * @prop {Code } code Error code.
7672 */
7773
7874/**
79- * The GraphQL request had a fetch error, e.g. the `fetch` global isn’t defined,
80- * or the network is offline.
75+ * { @link GraphQLResultError GraphQL error} that the GraphQL request had a fetch
76+ * error, e.g. the `fetch` global isn’t defined, or the network is offline.
8177 * @typedef {GraphQLResultErrorLoading<
8278 * "FETCH_ERROR",
8379 * GraphQLResultErrorLoadingFetchDetails
@@ -90,8 +86,8 @@ export {};
9086 */
9187
9288/**
93- * The GraphQL request had a fetch error, e.g. the `fetch` global isn’t defined,
94- * or the network is offline .
89+ * { @link GraphQLResultError GraphQL error} that the GraphQL response had an
90+ * error HTTP status .
9591 * @typedef {GraphQLResultErrorLoading<
9692 * "RESPONSE_HTTP_STATUS",
9793 * GraphQLResultErrorResponseHttpStatusDetails
@@ -105,7 +101,8 @@ export {};
105101 */
106102
107103/**
108- * The GraphQL response JSON had a parse error.
104+ * {@link GraphQLResultError GraphQL error } that the GraphQL response JSON had a
105+ * parse error.
109106 * @typedef {GraphQLResultErrorLoading<
110107 * "RESPONSE_JSON_PARSE_ERROR",
111108 * GraphQLResultErrorResponseJsonParseDetails
@@ -118,9 +115,10 @@ export {};
118115 */
119116
120117/**
121- * The GraphQL response JSON was malformed because it wasn’t an object, was
122- * missing an `errors` or `data` property, the `errors` property wasn’t an
123- * array, or the `data` property wasn’t an object or `null`.
118+ * {@link GraphQLResultError GraphQL error } that the GraphQL response JSON was
119+ * malformed because it wasn’t an object, was missing an `errors` or `data`
120+ * property, the `errors` property wasn’t an array, or the `data` property
121+ * wasn’t an object or `null`.
124122 * @typedef {GraphQLResultErrorLoading<
125123 * "RESPONSE_MALFORMED"
126124 * >} GraphQLResultErrorResponseMalformed
0 commit comments