Skip to content

Commit f609209

Browse files
committed
docs(graphql): add Q&A section
1 parent e9c8ec6 commit f609209

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

packages/graphql/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -907,6 +907,20 @@ final HttpLink _httpLink = HttpLink(
907907
final Link _link = _apqLink.concat(_httpLink);
908908
```
909909

910+
## Q&A
911+
### CSRF Error while uploading MultipartFile
912+
If you are receiving csrf error from your apollo graphql server while uploading file,
913+
your need to add some additional headers to the `HttpLink`:
914+
<br>
915+
Also ensure that you're add `contentType` to `MultipartFile` as `MediaType`
916+
917+
```dart
918+
HttpLink httpLink = HttpLink('https://api.url/graphql', defaultHeaders: {
919+
'Content-Type': 'application/json; charset=utf-8',
920+
'X-Apollo-Operation-Name': 'post'
921+
})
922+
```
923+
910924
[build-status-badge]: https://img.shields.io/github/workflow/status/zino-hofmann/graphql-flutter/graphql-flutter%20Tests%20case?style=flat-square
911925
[build-status-link]: https://github.com/zino-hofmann/graphql-flutter/actions
912926
[coverage-badge]: https://img.shields.io/codecov/c/github/zino-hofmann/graphql-flutter/beta?style=flat-square

0 commit comments

Comments
 (0)