Giter Site home page Giter Site logo

devcloudyy / graphql-operation-generator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gavinray97/graphql-operation-generator

0.0 0.0 0.0 92 KB

Automatically generate GraphQL operations from a schema

JavaScript 0.08% TypeScript 99.91% Batchfile 0.01%

graphql-operation-generator's Introduction

graphql-operation-generator

Automatically generate GraphQL operations from a schema

oclif Version Downloads/week License

Usage

$ npm install -g graphql-operation-generator
$ graphql-operation-generator --help
Automatically generate GraphQL operations from a schema

USAGE
  $ graphql-operation-generator

OPTIONS
  -d, --depth=depth                             [default: 1] Maximum depth for nested operation selection sets to generate.
  -h, --help                                    show CLI help
  -o, --operations=query|mutation|subscription
  -s, --schema=schema                           Optional file path to a GraphQL schema from the current directory, if not piping through stdin
  -v, --version                                 show CLI version
  --all                                         Generates all operations, equivalent to setting "--operations query mutation subscription"
  --mutation-prefix=mutation-prefix
  --query-prefix=query-prefix
  --subscription-prefix=subscription-prefix

EXAMPLES
  # Pipe from stdin:
  $ cat my-schema.graphql | graphql-operation-generator --all
  $ cat my-schema.graphql | graphql-operation-generator --operations queries mutations --depth 2
  # Or use a filepath to a schema:
  $ graphql-query-generator --all --schema=./my-schema.graphql
  ---------------------------------------------------------------------------
  # 1. Use "graphqurl" to save introspection schema to file:
  $ npx gq http://localhost:8080/v1/graphql --introspect > schema.graphql

  # 2. Use "graphql-operation-generator" to create queries, mutations, and subscriptions for every type in the schema:
  $ cat schema.graphql | graphql-operation-generator --all > queries.graphql

  # 3. Use "graphql-code-generator" to generate Typescript types and a query client for every operation:
  $ npx graphql-code-generator

graphql-operation-generator's People

Contributors

gavinray97 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.