Socket
Book a DemoInstallSign in
Socket

@adgstudio/graphql-generator

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adgstudio/graphql-generator

generate graphql object, type definition from graphql sdl

latest
npmnpm
Version
0.3.0
Version published
Maintainers
1
Created
Source

Graphql Generator

Generate graphql object, type definition and merge sdl from graphql sdl/s

Install

install from npm

npm install -D @adgstudio/graphql-generator

Usage

Generate Graphql Types

Generate graphql typescript types from graphql sdl file

import { GraphqlTypesGenerator } from "@adgstudio/graphql-generator";

async function main() {
  const generator = new GraphqlTypesGenerator();
  await factory.generate("./src/**/*.graphql", {
    outputPath: "path/to/destination.ts",
  });
}

main();

Generate Graphql Object

Generate graphql object definition from graphql sdl file

import { GraphqlObjectGenerator } from "@adgstudio/graphql-generator";

async function main() {
  const generator = new GraphqlObjectGenerator();
  await generator.generate("./src/modules/**/*.graphql", {
    outputPath: "path/to/destination.ts",
  });
}

main();

Merge graphql sdl to a single file

Merge multiple graphql sdl files to a single graphql sdl file

import { GraphqlSdlFactory } from "@adgstudio/graphql-generator";

async function main() {
  const generator = new GraphqlSdlFactory();
  await generator.merge("./src/modules/**/*.graphql", {
    outputPath: "path/to/destination.graphql",
  });
}

main();

Contributing

Fork this repo and create pull request to dev branch

Support

Follow twitter, and youtube.

FAQs

Package last updated on 19 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts