File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -907,6 +907,20 @@ final HttpLink _httpLink = HttpLink(
907907final 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
You can’t perform that action at this time.
0 commit comments