Revisions for untitled paste

View the changes made to this paste.

unlisted ⁨1⁩ ⁨file⁩ 2021-06-19 14:51:09 UTC

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