Loading save files done.
This commit is contained in:
45
src/lib/game.ts
Normal file
45
src/lib/game.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import { createFragment } from "@/lib/fragment";
|
||||
import { gql } from "apollo-server-micro";
|
||||
|
||||
export const GAME_SYSTEM_CORES = <const>{
|
||||
'gb': 'gambatte',
|
||||
'gbc': 'gambatte',
|
||||
'gba': 'mgba'
|
||||
};
|
||||
|
||||
export type GameSystem = keyof typeof GAME_SYSTEM_CORES;
|
||||
export type GameSystemCore = typeof GAME_SYSTEM_CORES[GameSystem];
|
||||
|
||||
export type GameLight = {
|
||||
id:string;
|
||||
name:string;
|
||||
system:GameSystem;
|
||||
};
|
||||
|
||||
export const GameLightFragment = createFragment<GameLight>({
|
||||
name: `GameLight`,
|
||||
query: gql`
|
||||
fragment GameLight on Game {
|
||||
id
|
||||
name
|
||||
system
|
||||
}
|
||||
`
|
||||
});
|
||||
|
||||
export type GameHeavy = {
|
||||
id:string;
|
||||
name:string;
|
||||
system:GameSystem;
|
||||
};
|
||||
|
||||
export const GameHeavyFragment = createFragment<GameHeavy>({
|
||||
name: `GameHeavy`,
|
||||
query: gql`
|
||||
fragment GameHeavy on Game {
|
||||
id
|
||||
name
|
||||
system
|
||||
}
|
||||
`
|
||||
});
|
||||
Reference in New Issue
Block a user