New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@diogovcs/graphql-mesh

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@diogovcs/graphql-mesh

NX plugin for integrating GraphQL Mesh into your NX workspace

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

NX Graphql Mesh

Nx plugin for GraphQL Mesh integration within a Nx Workspace.

Setup

Npm

npm install -D @diogovcs/graphql-mesh

Yarn

yarn add -D @diogovcs/graphql-mesh

Pnpm

pnpm add -D @diogovcs/graphql-mesh

Add to Workspace

nx generate @diogovcs/graphql-mesh:install [APP_NAME] [...OPTIONS]

This command will create a graphql mesh application with the name APP_NAME for the provided options. By default, this will create a .meshrc.yml file that is separated into multiple yaml files. This uses the yamlinc project to merge all the different configurations before build the application (this configuration can be overridden in the options). The available options allowed when generating an application are the following:

nametypedefaultdescription
--dryRunbooleanfalserun with dry mode
--singleMeshFilebooleanfalseCreates a project with a single .meshrc configuration file
--directorystringappsDirectory where the application will be created at.

Examples

Run with single mesh configuration:

nx generate @diogovcs/graphql-mesh:install my-graphql-mesh --singleMeshFile

Create app on specif folder:

nx generate @diogovcs/graphql-mesh:install my-graphql-mesh --directory=api-gateways

Build

The build executor can take optional parameters as the location of the main .meshrc.yml folder and a boolean flagging if the build should use the yamlinc to build the full .mesrc.yml configuration or not.

Here it is an example a build executor configuration:

{
  "build": {
    "executor": "@diogovcs/graphql-mesh:build",
    "options": {
      "meshYmlPath": "apps/api-gateway/config",
      "singleMeshFile": false
    }
  }
}

Options

nametypedefaultdescription
meshYmlPathstringfalsePath to the .meshrc.yml file.
singleMeshFilebooleanfalseCreates a project with a single .meshrc configuration file
envFilestring-Path to the .env file where the environment variables are located. Defaults to do not use environment files.
fileTypejsontsts Type of file.
outputPathstringPath to where the built files will be placed.
rootPathstringRoot path of the application.
tsconfigPathstringPath to where the tsconfig file is located.
typescriptSupportbooleantrueEither if typescript should be provided to transpile files. IF only using Javascript files, turn this to false, because it will decrease build time.

When using the singleMeshFile configuration with false, the compiled .meshrc.yml will be created under the .compiled folder.

Serve

The serve is intended to be used only in development as it creates a development server to listen for code changes. For Production use the start executor. Here it is an example a serve executor configuration:

{
  "serve": {
    "executor": "@diogovcs/graphql-mesh:serve",
    "options": {
      "meshYmlPath": "apps/api-gateway/config"
    }
  }
}

Options

nametypedefaultdescription
meshYmlPathstringfalsePath to the .meshrc.yml file.
envFilestring-Path to the .env file where the environment variables are located. Defaults to do not use environment files.
tsConfigPathstringGraphql Mesh default portPath to the tsconfig.json file.
mainPathstringGraphql Mesh default portPath to the main.ts file.
rootPathstringGraphql Mesh default portRoot folder of the project.

Start

Triggers the mesh start command. Should be used for production:

{
  "serve": {
    "executor": "@diogovcs/graphql-mesh:start",
    "options": {
      "meshYmlPath": "apps/api-gateway/config"
    }
  }
}

Options

nametypedefaultdescription
meshYmlPathstringfalsePath to the .meshrc.yml file.
envFilestring-Path to the .env file where the environment variables are located. Defaults to do not use environment files.
typescriptSupportbooleantrueEither if typescript should be provided to transpile files. IF only using Javascript files, turn this to false, because it will decrease build time.

Keywords

nx-plugin

FAQs

Package last updated on 25 Nov 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