Files
web_server/vue/src/graphql.js
Adam French 3844a32751
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 3m50s
Big formatting spree
2026-04-29 09:06:41 +01:00

9 lines
265 B
JavaScript

import axios from "axios";
export async function gql(query, variables = {}) {
const res = await axios.post("/api/graphql", { query, variables });
if (res.data.errors && !res.data.data)
throw new Error(res.data.errors[0].message);
return res.data.data;
}