This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class TSGen | |
{ | |
public static function fromJSON(string $json, string $interfaceName): string | |
{ | |
try { | |
return self::generateInterface(json_decode($json, true, 512, JSON_THROW_ON_ERROR), $interfaceName); | |
} catch (JsonException $e) { | |
throw new InvalidArgumentException("Error parsing JSON: " . $e->getMessage()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Bun from 'bun' | |
import { createYoga, YogaInitialContext, YogaServerInstance } from 'graphql-yoga' | |
import { makeHandler } from "graphql-ws/lib/use/bun"; | |
import { ExecutionArgs } from "@envelop/types"; | |
import { schema } from './graphql/schema'; | |
interface IUserContext { | |
token?: string; | |
} |