We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I need upload file using graphql_mutation. I am also using dio package on my app.
https://github.com/zino-hofmann/graphql-flutter/blob/main/packages/graphql/README.md#graphql-upload
How can i put inside variable a file? I tried with file directly and not work.
I tried also with MultipartFile but nothing:
final result = runMutation({ "content": text, "chatroomId": chatRoomId, "attachment": viewModel.attachment.isFileSet() ? await MultipartFile.fromFile( viewModel.attachment.file!.path, filename: viewModel.attachment.file!.path .split("/") .last) : null });
The reuqest not arrive to my server.
Using talen api request to my graphql endpoint with
{ "query":"mutation ($chatroomId: Float!, $content: String, $attachment: Upload ) {\n sendMessage (\n chatroomId: $chatroomId,\n content: $content\n, attachment: $attachment\n ) {\n attachment {\n id\n path\n }\n chatRoomId\n content\n createdAt\n id\n userId\n }\n }", "variables": { "chatroomId":2, "content": "ciao", "attachment": "" } }
the call was blocked by Upload validator, but it arrive...
So i need explaination about how send file using your library to my server.
Thank you for your support
(without attachment request work)
The text was updated successfully, but these errors were encountered:
Now I did some changes the body arrive, but i have a new issue:
[Nest] 31308 - 30/01/2024, 12:46:47 ERROR [ExceptionsHandler] Missing multipart field ‘operations’ (https://github.com/jaydenseric/graphql-multipart-request-spec). BadRequestError: Missing multipart field ‘operations’ (https://github.com/jaydenseric/graphql-multipart-request-spec)
the body that arrive to my backend is:
body: { operationName: null, variables: { content: '', chatroomId: 2, attachment: [Upload] }, query: 'mutation($chatroomId: Float!, $content: String, $attachment: Upload) {\n' + ' __typename\n' + ' sendMessage(chatroomId: $chatroomId, content: $content, attachment: $attachment) {\n' + ' __typename\n' + ' attachment {\n' + ' __typename\n' + ' id\n' + ' path\n' + ' }\n' + ' chatRoomId\n' + ' content\n' + ' createdAt\n' + ' id\n' + ' userId\n' + ' }\n' + '}' },
Sorry, something went wrong.
No branches or pull requests
I need upload file using graphql_mutation. I am also using dio package on my app.
https://github.com/zino-hofmann/graphql-flutter/blob/main/packages/graphql/README.md#graphql-upload
How can i put inside variable a file? I tried with file directly and not work.
I tried also with MultipartFile but nothing:
The reuqest not arrive to my server.
Using talen api request to my graphql endpoint with
the call was blocked by Upload validator, but it arrive...
So i need explaination about how send file using your library to my server.
Thank you for your support
(without attachment request work)
The text was updated successfully, but these errors were encountered: