pastefile1
@@ -0,0 +1,19 @@
+const payload = {
+ query: `
+ mutation($file: Upload!) {
+ server:createServer(
+ input: {
+ bannerFile: $file,
+ name: "${values.serverName}",
+ address: "${values.serverAddress}",
+ description: "${values.serverDescription}"
+ }) { id }
+ }`,
+ variables: {
+ file: values.bannerFile // this comes from the input[file]
+ }
+};
+
+superagent.post('/api').send(payload).set('accept', 'json').then(result => {
+ // handle response
+});
\ No newline at end of file