summaryrefslogtreecommitdiff
path: root/alarm/node_modules/graphql/error/formatError.d.ts
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2022-10-18 08:59:09 +0200
committerMinteck <contact@minteck.org>2022-10-18 08:59:09 +0200
commit2c4ae43e688a9873e86211ea0e7aeb9ba770dd77 (patch)
tree17848d95522dab25d3cdeb9c4a6450e2a234861f /alarm/node_modules/graphql/error/formatError.d.ts
parent108525534c28013cfe1897c30e4565f9893f3766 (diff)
downloadpluralconnect-2c4ae43e688a9873e86211ea0e7aeb9ba770dd77.tar.gz
pluralconnect-2c4ae43e688a9873e86211ea0e7aeb9ba770dd77.tar.bz2
pluralconnect-2c4ae43e688a9873e86211ea0e7aeb9ba770dd77.zip
Update
Diffstat (limited to 'alarm/node_modules/graphql/error/formatError.d.ts')
-rw-r--r--alarm/node_modules/graphql/error/formatError.d.ts40
1 files changed, 40 insertions, 0 deletions
diff --git a/alarm/node_modules/graphql/error/formatError.d.ts b/alarm/node_modules/graphql/error/formatError.d.ts
new file mode 100644
index 0000000..fb3451b
--- /dev/null
+++ b/alarm/node_modules/graphql/error/formatError.d.ts
@@ -0,0 +1,40 @@
+import { SourceLocation } from '../language/location';
+
+import { GraphQLError } from './GraphQLError';
+
+/**
+ * Given a GraphQLError, format it according to the rules described by the
+ * Response Format, Errors section of the GraphQL Specification.
+ */
+export function formatError(error: GraphQLError): GraphQLFormattedError;
+
+/**
+ * @see https://github.com/graphql/graphql-spec/blob/master/spec/Section%207%20--%20Response.md#errors
+ */
+export interface GraphQLFormattedError<
+ TExtensions extends Record<string, any> = Record<string, any>
+> {
+ /**
+ * A short, human-readable summary of the problem that **SHOULD NOT** change
+ * from occurrence to occurrence of the problem, except for purposes of
+ * localization.
+ */
+ readonly message: string;
+ /**
+ * If an error can be associated to a particular point in the requested
+ * GraphQL document, it should contain a list of locations.
+ */
+ readonly locations?: ReadonlyArray<SourceLocation>;
+ /**
+ * If an error can be associated to a particular field in the GraphQL result,
+ * it _must_ contain an entry with the key `path` that details the path of
+ * the response field which experienced the error. This allows clients to
+ * identify whether a null result is intentional or caused by a runtime error.
+ */
+ readonly path?: ReadonlyArray<string | number>;
+ /**
+ * Reserved for implementors to extend the protocol however they see fit,
+ * and hence there are no additional restrictions on its contents.
+ */
+ readonly extensions?: TExtensions;
+}