🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@aws-amplify/graphql-docs-generator

Package Overview
Dependencies
Maintainers
10
Versions
190
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws-amplify/graphql-docs-generator

amplify graphql docs generator plugin

4.2.1
latest
Source
npm
Version published
Weekly downloads
112K
-8.99%
Maintainers
10
Weekly downloads
 
Created
Source

GraphQL Docs generator

GraphQL document generator takes a schema and generates all possible statements(queries, mutations and subscription) on that schema. This can act as a starting point for the users who are new to GraphQL.

Installation and execution

Executing from the command line:

$ npm install -g @aws-amplify/graphql-docs-generator

$ graphql-docs-generator --schema 'my-graphql-sdl-schema'

$ graphql-docs-generator --schema 'my-graphql-introspection-schema' --maxDepth 2

Executing from NodeJS or browser environments:

Add a dependency on the 3.1.0-studio-graphql-4.0 version of @aws-amplify/graphql-docs-generator in your package.json file, install and build.

import { generateGraphQLDocuments } from '@aws-amplify/graphql-docs-generator';

const schema = 'my-graphql-sdl-schema';

// Below are the supported optional customizations and their defaults
const options = {
  maxDepth: 2
};

const generatedResult = generateGraphQLDocuments(schema, options);

// Test logs to demonstrate the output
console.log(generatedResult.queries);
console.log(generatedResult.mutations);
console.log(generatedResult.subscriptions);
console.log(generatedResult.fragments);

Keywords

graphql

FAQs

Package last updated on 11 Dec 2023

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