mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
31 lines
715 B
TypeScript
31 lines
715 B
TypeScript
import {
|
|
downloadSchema,
|
|
generate,
|
|
introspectSchema,
|
|
printSchema
|
|
} from "apollo-codegen";
|
|
|
|
async function main() {
|
|
await downloadSchema(
|
|
"http://example.com/graphql",
|
|
"schema.json",
|
|
{},
|
|
false,
|
|
"POST"
|
|
);
|
|
|
|
generate(["input.ts"], "schema.json", "types.ts", "", "typescript", "gql", "", {
|
|
passthroughCustomScalars: false,
|
|
customScalarsPrefix: "S",
|
|
addTypename: false,
|
|
namespace: "",
|
|
operationIdsPath: null,
|
|
generateOperationIds: false,
|
|
mergeInFieldsFromFragmentSpreads: false
|
|
});
|
|
|
|
await introspectSchema("schema.json", "schema.gql");
|
|
|
|
await printSchema("schema.in", "schema.out");
|
|
}
|