45 lines
831 B
TypeScript
45 lines
831 B
TypeScript
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
|
|
}
|
|
`
|
|
}); |