npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@diogovcs/graphql-mesh

v1.1.0

Published

NX plugin for integrating GraphQL Mesh into your NX workspace

Downloads

380

Readme

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:

| name | type | default | description | |------------------|-----------|---------|--------------------------------------------------------------| | --dryRun | boolean | false | run with dry mode | | --singleMeshFile | boolean | false | Creates a project with a single .meshrc configuration file | | --directory | string | apps | Directory 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

| name | type | default | description | |-------------------|-----------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------| | meshYmlPath | string | false | Path to the .meshrc.yml file. | | singleMeshFile | boolean | false | Creates a project with a single .meshrc configuration file | | envFile | string | - | Path to the .env file where the environment variables are located. Defaults to do not use environment files. | | fileType | json | ts | ts Type of file. | | outputPath | string | | Path to where the built files will be placed. | | rootPath | string | | Root path of the application. | | tsconfigPath | string | | Path to where the tsconfig file is located. | | typescriptSupport | boolean | true | Either 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

| name | type | default | description | |--------------|----------|---------------------------|----------------------------------------------------------------------------------------------------------------| | meshYmlPath | string | false | Path to the .meshrc.yml file. | | envFile | string | - | Path to the .env file where the environment variables are located. Defaults to do not use environment files. | | tsConfigPath | string | Graphql Mesh default port | Path to the tsconfig.json file. | | mainPath | string | Graphql Mesh default port | Path to the main.ts file. | | rootPath | string | Graphql Mesh default port | Root 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

| name | type | default | description | |-------------------|-----------|---------|------------------------------------------------------------------------------------------------------------------------------------------------------| | meshYmlPath | string | false | Path to the .meshrc.yml file. | | envFile | string | - | Path to the .env file where the environment variables are located. Defaults to do not use environment files. | | typescriptSupport | boolean | true | Either if typescript should be provided to transpile files. IF only using Javascript files, turn this to false, because it will decrease build time. |