Add graphql request to back end

This commit is contained in:
Patrick Fic
2025-03-20 14:54:13 -07:00
parent 4310b3779a
commit 6345b5a9a8
8 changed files with 90 additions and 6 deletions

View File

@@ -4,6 +4,7 @@ import log from "electron-log/main";
import path, { join } from "path";
import icon from "../../resources/icon.png?asset";
import ErrorTypeCheck from "../util/errorTypeCheck";
import client from "./graphql/graphql-client";
import store from "./store/store";
log.initialize();
@@ -32,7 +33,7 @@ function createWindow(): void {
},
});
const template = [
const template: Electron.MenuItemConstructorOptions[] = [
// { role: 'appMenu' }
...(isMac
? [
@@ -117,13 +118,14 @@ function createWindow(): void {
submenu: [
{
label: "Learn More",
click: async () => {
click: async (): Promise<void> => {
const { shell } = require("electron");
await shell.openExternal("https://electronjs.org");
},
},
],
},
...(import.meta.env.DEV
? [
{
@@ -148,6 +150,26 @@ function createWindow(): void {
shell.openPath(path.dirname(store.path));
},
},
{
type: "separator",
},
{
label: "Temp Test Action - Get Token from Renderer",
click: (): void => {
client
.request(
`
query jobs{
jobs
{
id}}
`
)
.then((data) => {
log.info("Data from graffle", data);
});
},
},
],
},
]