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

graphql-concat

v1.1.1

Published

A CLI tool to concatenate GraphQL files into executable GraphQL files.

Downloads

7

Readme

:smiley_cat: graphql-concat :smile_cat:

npm version Downloads/month
License: MIT typescript-image supports Node.js
build status
dependencies status devDependencies status
code style: prettier codecov

TL;DR

This CLI is used for sharing GraphQL FragmentDefinitions across GraphQL Operations. On the basis of GraphQL AST, gqlcat concatenates FragmentDefinitions into GraphQL Operation (e.g. Query or Mutation) which needs Fragments to be executed.

   +---------------------------+
   |   GraphQL file includes   |
   |  OperationDefinitionNode  +--------------+
   | (e.g. Query and Mutation) |              |
   +---------------------------+              |
                                              |
                                              |
   +---------------------------+              |                                        +--------------------------------------+
   |   GraphQL file includes   |              |                                        |   Concatenated GraphQL DocumentNode  |
   |  OperationDefinitionNode  +---------+    |                              +-------> |    you can execute in your program   |
   | (e.g. Query and Mutation) |         |    +-------> +------------+       |         |  like graphiql or TypeScript program |
   +---------------------------+         +------------> |            +-------+         +--------------------------------------+
                                                        |   gqlcat   |
                                         +------------> |            +-------+         +--------------------------------------+
+----------------------------------+     |    +-------> +------------+       |         |   Concatenated GraphQL DocumentNode  |
|      GraphQL file includes       |     |    |                              +-------> |    you can execute in your program   |
|      FragmentDefinitionNode      +-----+    |                                        |  like graphiql or TypeScript program |
|         (e.g. Fragment)          |          |                                        +--------------------------------------+
|  you want to share between files |          |
------------------------------------          |
                                              |
                                              |
+----------------------------------+          |
|      GraphQL file includes       |          |
|      FragmentDefinitionNode      +----------+
|         (e.g. Fragment)          |
|  you want to share between files |
+----------------------------------+

Usage

$ gqlcat -h

graphql-concat

  Concatenate multiple GraphQL files to executable operation files. 

Version

  1.1.1

Synopsis

  $ gqlcat [--include glob] [--execlude glob] [--dist path] [--output           
  stdout|file] [--lang gql|ts] [--schema path] [--project graphql-project-name] 
  $ gqlcat --help                                                               

Options

  -i, --include string[]   Files you want to include. Default is "./**/*.graphql" "./**/*.gql". You can  
                           specify this option multiply. This option also can be specified via           
                           .graphqlconfig includes values.                                               
  -e, --exclude string[]   Files you want to exclude. Default is not set. You can specify this option    
                           multiply. This option also can be specified via .graphqlconfig excludes       
                           values.                                                                       
  -d, --dist string        Path to distination of gqlcat outputs. Default is dist.                       
  -o, --output type        Output type. Default is stdout.                                               
  -l, --lang type          Language type. Default is gql.                                                
  -s, --schema string      Path to schema.json of your project. This is used for validating concatenated 
                           files. Default is not set, so validation isn't executed. This option also     
                           can be specified via .graphqlconfig schemaPath value.                         
  -p, --project string     Your project name. If your .graphqlconfig file has multiple project configs,  
                           you must specify this option. Default is not set.                             
  -h, --help               Display usage.                                                                
  -v, --version            Display version.

Examples

  Case: Specifying all options via command line args.   $ gqlcat -i "./src/**/*.graphql" -i "./src/**/*.gql" -e "./dist/**/*.graphql" -d ./dist -o file -l ts -s  
                                                        ./src/schema.json                                                                                         
  Case: Using your .graphqlconfig.                      $ gqlcat -d ./dist -o stdout -l gql -p github                                                             

About

  Project home: https://github.com/rkaneko/graphql-concat

Examples

Please see Library example.

License