Code Monkey home page Code Monkey logo

plan-printer's Introduction

Apollo Federation Query Plan Printer

Simple binary to compute query plans for Apollo Federation from the command line.

This is mostly intended for helping working on the query planner code itself. This is not a polished tool in any way.

Usage

Once you've cloned this repository locally, you can test it with:

> npm run build
> npx plan-query examples/minimal

which should output something along the lines of:

QueryPlan {
  Fetch(service: "subgraph1") {
    {
      v
    }
  },
}

Currently, the tool requires a directory as parameter (examples/minimal above). This directory should contain a number of GraphQL files (which must have the .graphql extension) which are used in the following way:

  • One of the files must be named exactly query.graphql, and will be used as the "query" (technically, it should contain either a GraphQL query or a GraphQL mutation, and only one).
  • All other GraphQL files are interpreted as subgraphs schema. The name of the subgraph will be the file name (minus the .graphql extension) and the schema of that subgraph will be the file content.

From such a directory, plan-query will compose all the subgraph files and compute the plan for the provided query against the resulting supergraph. You can use the -v/--verbose option to display the details of the subgraphs and query (and -vv to also get the individual subgraphs schema).

plan-printer's People

Contributors

pcmanus avatar

Watchers

 avatar  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.