Giter Club home page Giter Club logo

entity-requests-from-queryplan's Introduction

List _entities requests from operations

This script generates a list of _entities requests that are part of the query plan for a given operation, along with their required input variables.

Using without installing (via NPX)

APOLLO_KEY=xxx APOLLO_GRAPH_REF=MyGraph@variant npx github:@apollosolutions/entity-requests-from-queryplan \                                            
  --operations path/to/operations/

The output of this script will be a json file in the current directory in the following format:

entity-ops-${now}.json

Setup

  • Download this repository
  • Install dependencies
  • Set environment variables

Install dependencies

npm install

Set environment variables

Copy the .env-example file

cp .env-example .env

Set the following environment variables:

  • APOLLO_KEY (required)
  • APOLLO_GRAPH_REF (used if not overridden)

Export environment variables so the script can use them:

source .env

Usage

Required Arguments

  • --operations The path to a local directory that contains the operations to process.
  • --supergraph (path to a local supergraph schema file) OR --graphref (Graph Reference of published schemas to GraphOS.)

Example using a local supergraph file

./bin/index.js \
  --operations examples \
  --supergraph examples/supergraph.graphql

Example using a graphref

APOLLO_GRAPH_REF="MyGraphId@variant" ./bin/index.js --operations examples 
# OR
./bin/index.js --operations path/to/ops/ --graphref MyGraphId@variant

Other arguments

  • --out To override the name of the script output file.

The code in this repository is experimental and has been provided for reference purposes only. Community feedback is welcome but this project may not be supported in the same way that repositories in the official Apollo GraphQL GitHub organization are. If you need help you can file an issue on this repository, contact Apollo to talk to an expert, or create a ticket directly in Apollo Studio.


entity-requests-from-queryplan's People

Contributors

ebylund avatar

Stargazers

Wendy avatar Andrejs Agejevs avatar Brandon Him avatar

Watchers

Matt Ratzke avatar Tushar Bhushan avatar  avatar Lucas Leadbetter avatar Andy Roberts avatar Joe Devine avatar

entity-requests-from-queryplan's Issues

Output examples based on inputs

This is awesome, one thing I would love to see what the output looks like, and 1 simple example on the README of the input and output.

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.