rune
Version:
CLI to upload your games to Rune
18 lines (17 loc) • 435 B
JavaScript
import { client } from "../../apollo/client.js";
import { GamesDocument } from "../../generated/types.js";
/**
* Queries for games data outside of React context
* @returns Promise resolving to games data
*/
export async function queryGames() {
const { data, error } = await client.query({
query: GamesDocument,
});
if (error) {
throw error;
}
return {
games: data?.games?.nodes,
};
}