-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnotes.txt
28 lines (23 loc) · 1.09 KB
/
notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
ERROR REPORTING
GraphQL:
Dev mode => stacktrace rempli
Prod mode => stacktrace pas defini
Backend (API):
Dev mode => exception.backendStacktrace et exception.type remplis
Production mode => exception.backendStacktrace et exception.type pas definis
Dans les resolvers, faire un catch autour du code qui fetche les reponse, et y mettre:
const {
message,
code,
trace,
type
} = e.extensions.response.body.errors.topLevelError;
// Throw an error that GraphQL clients will understand
throw new ApolloError(message, code, { trace, type });
FILE UPLOADS
https://blog.apollographql.com/file-uploads-with-apollo-server-2-0-5db2f3f60675
Upload via curl: https://github.com/jaydenseric/graphql-multipart-request-spec#curl-request
https://www.youtube.com/watch?v=KQ_ty4A6Nsc
https://github.com/benawad/apollo-upload-example
https://github.com/benawad/graphql-yoga-upload-example
Use https://github.com/jaydenseric/graphql-upload (formerly known as apollo-upload server)