Download next.js/examples/api-routes-apollo-server-and-client-auth/lib/form.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 319 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/examples/api-routes-apollo-server-and-client-auth/lib/form.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/examples/api-routes-apollo-server-and-client-auth/lib/form.ts
-
curl -L -o form.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/examples/api-routes-apollo-server-and-client-auth/lib/form.ts
319 Bytes
| export function getErrorMessage(error) { | |
| if (error.graphQLErrors) { | |
| for (const graphQLError of error.graphQLErrors) { | |
| if ( | |
| graphQLError.extensions && | |
| graphQLError.extensions.code === "BAD_USER_INPUT" | |
| ) { | |
| return graphQLError.message; | |
| } | |
| } | |
| } | |
| return error.message; | |
| } | |