import { getIntrospectedSchema, minifyIntrospectionQuery } from "@urql/introspection";
import { readFileSync, writeFileSync } from "fs";

// Read the existing introspection schema
const schema = readFileSync("./src/gql/schema.graphql", "utf-8");
// const schema = JSON.parse(schemaJson);

const minifiedSchema = minifyIntrospectionQuery(getIntrospectedSchema(schema));

// Write the minified schema to a new file
writeFileSync("./src/gql/minifiedSchema.json", JSON.stringify(minifiedSchema));
