Giter VIP home page Giter VIP logo

the-guild-org / conductor Goto Github PK

View Code? Open in Web Editor NEW
82.0 82.0 2.0 4.32 MB

Conductor is a cutting-edge, open-source GraphQL Gateway, fully compliant with the GraphQL specification and designed to supercharge any API with powerful features and proxy flows.

Home Page: https://the-guild.dev/graphql/gateway

License: MIT License

Rust 79.78% JavaScript 2.10% Dockerfile 0.19% HCL 0.26% TypeScript 16.05% MDX 1.52% Shell 0.10%
federation fusion gateway graphql proxy rust

conductor's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

gklijs

conductor's Issues

feat: upstream endpoint match plugin

This plugin can be used to achieve regional load balancing, @dotansimha came up with how the usage might look like:

server:
  port: 9000

sources:
  - id: my-api
    type: graphql
    config:
      endpoint: https://us.myapi.com/ # this is the default

endpoints:
  - path: /graphql
    from: my-api
    plugins:
      - type: upstream-endpoint-match
        config:
          value: {{ headers["CF-Geo-Location"] }} 
          set:
            - match: US-America
              value: https://us.myapi.com/ 
            - match: EU
              value: https://eu.myapi.com/

config file relative paths aren't relative to the config file's parent directory but rather the binary's pwd

When running cargo run ../../test_config/config.yaml while cd crates/conductor, and having my config.yaml as follows:

    plugins:
      - type: persisted_operations
        config:
          store:
            source: file
            path: ./test_config/persisted_operations_store.json

It breaks with the error:

thread 'main' panicked at 'Failed to read file:
Os{ code: 2, kind: NotFound, message: "No such file or directory" }', crates/config/src/serde_utils.rs:22:61

Because, it was unable to find the ./test_config/persisted_operations_store.json path since it started the relative path from the binary's pwd, instead of the config's parent directory, which should be the expected behavior.

smoke testing

We should add a test that gets an endpoint and runs some sanity checks against it.
This way we can find critical runtime issues (wasm might fail at runtime, actix-web might throw a slient error in case of invalid Data, etc..).

Tasks

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): update dependency @types/react to v18.2.75

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

cargo
Cargo.toml
  • tokio 1.37.0
  • futures 0.3.30
  • serde 1.0.197
  • serde_json 1.0.115
  • tracing 0.1.40
  • http 0.2.12
  • http-body 0.4.6
  • bytes 1.6.0
  • async-trait 0.1.79
  • anyhow 1.0.81
  • reqwest 0.11.27
  • thiserror 1.0.58
  • reqwest-middleware 0.2.5
  • tracing-subscriber 0.3.18
  • base64 0.21.7
  • schemars 0.8.16
  • minitrace 0.6.4
bin/cloudflare_worker/Cargo.toml
  • tracing-web 0.1.3
  • time 0.3.34
  • console_error_panic_hook 0.1.7
bin/conductor/Cargo.toml
  • actix-web 4.5.1
  • futures-util 0.3.30
  • ulid 1.1.2
  • openssl 0.10
libs/benches/Cargo.toml
  • criterion 0.5.1
  • hyper 0.14.28
  • actix-web 4.5.1
  • url 2.5.0
libs/common/Cargo.toml
  • graphql-tools 0.2.5
  • mime 0.3.17
  • url 2.5.0
  • querystring 1.1.0
  • once_cell 1.19.0
  • lazy_static 1.4.0
libs/config/Cargo.toml
  • serde_yaml 0.9.33
  • regex 1.10.4
  • humantime-serde 1.1.1
  • http-serde 1.1.3
libs/e2e_tests/Cargo.toml
  • httpmock 0.7.0
  • lazy_static 1.4.0
libs/engine/Cargo.toml
  • ureq 2.9.6
  • humantime 2.1.0
libs/federation_query_planner/Cargo.toml
  • linked-hash-map 0.5.6
  • lazy_static 1.4.0
  • async-graphql 7.0.1
  • insta 1.38.0
  • criterion 0.5.1
libs/logger/Cargo.toml
  • atty 0.2.14
  • tracing-web 0.1.3
libs/minitrace_reqwest/Cargo.toml
  • task-local-extensions 0.1.4
libs/napi/Cargo.toml
  • napi 2.16.1
  • napi-derive 2.16.1
  • actix-web 4.5.1
  • napi-build 2.1.2
libs/smoke_tests/Cargo.toml
  • insta 1.38.0
  • lazy_static 1.4.0
  • serial_test 3.0.0
libs/tracing/Cargo.toml
  • opentelemetry 0.22.0
  • opentelemetry_sdk 0.22.1
  • task-local-extensions 0.1.4
  • rand 0.8.5
libs/wasm_polyfills/Cargo.toml
  • wasm-bindgen-futures 0.4.42
  • send_wrapper 0.6
plugins/cors/Cargo.toml
plugins/disable_introspection/Cargo.toml
plugins/graphiql/Cargo.toml
plugins/graphql_validation/Cargo.toml
plugins/http_get/Cargo.toml
  • urlencoding 2.1.3
plugins/jwt_auth/Cargo.toml
  • jsonwebtoken 9.3.0
  • humantime-serde 1.1.1
  • cookie 0.18.1
  • web-time 1.1.0
  • lazy_static 1.4.0
plugins/match_content_type/Cargo.toml
plugins/telemetry/Cargo.toml
  • humantime-serde 1.1.1
  • opentelemetry 0.22.0
  • opentelemetry_sdk 0.22.1
  • opentelemetry-http 0.11.0
  • rmp-serde 1.1.2
  • web-time 1.1.0
  • opentelemetry-otlp 0.15.0
  • opentelemetry-zipkin 0.20.0
  • opentelemetry-otlp 0.15.0
  • minitrace-datadog 0.6.4
  • opentelemetry-zipkin 0.20.0
  • minitrace-jaeger 0.6.4
  • opentelemetry-http 0.11.0
  • futures 0.3
plugins/trusted_documents/Cargo.toml
plugins/vrl/Cargo.toml
tests/test-server/Cargo.toml
  • async-graphql 7.0.1
  • async-graphql-actix-web 7.0.1
  • actix-web 4.5.1
docker-compose
libs/smoke_tests/docker-compose.yaml
  • quay.io/keycloak/keycloak 24.0.2
  • jaegertracing/all-in-one 1.55
dockerfile
bin/conductor/docker/Dockerfile
  • rust 1.77.0
  • debian 12.5
github-actions
.github/actions/setup/action.yml
  • Swatinem/rust-cache v2
.github/workflows/benchmark.yaml
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • actions/upload-artifact v4
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • JarvusInnovations/background-action v1
  • JarvusInnovations/background-action v1
  • ubuntu 22.04
  • ubuntu 22.04
.github/workflows/ci.yaml
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • actions/setup-node v4
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • JarvusInnovations/background-action v1
  • JarvusInnovations/background-action v1
  • JarvusInnovations/background-action v1
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • JarvusInnovations/background-action v1
  • JarvusInnovations/background-action v1
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • actions-rs/clippy-check v1
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • thollander/actions-comment-pull-request v2
  • ubuntu 22.04
  • ubuntu 22.04
  • ubuntu 22.04
  • ubuntu 22.04
  • ubuntu 22.04
.github/workflows/release.yaml
  • actions/checkout v4
  • docker/setup-qemu-action v3
  • docker/setup-buildx-action v3
  • docker/login-action v3
  • docker/bake-action v4
  • marocchino/sticky-pull-request-comment v2
  • softprops/action-gh-release v2
  • actions/checkout v4
  • actions/upload-artifact v4
  • montudor/action-zip v1
  • svenstaro/upload-release-action v2
  • actions/checkout v4
  • actions/upload-artifact v4
  • svenstaro/upload-release-action v2
  • actions/checkout v4
  • houseabsolute/actions-rust-cross v0
  • actions/upload-artifact v4
  • svenstaro/upload-release-action v2
  • ubuntu 22.04
  • ubuntu 22.04
  • ubuntu 22.04
.github/workflows/website.yaml
  • actions/checkout v4
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • actions/checkout v4@b4ffde65f46336ab88eb53be808477a3936bae11
  • ubuntu 22.04
npm
bin/cloudflare_worker/package.json
  • wrangler 3.48.0
bin/npm/package.json
  • @graphql-conductor/lib 0.0.4-alpha.0
libs/napi/npm/darwin-arm64/package.json
  • node >= 10
libs/napi/npm/darwin-x64/package.json
  • node >= 10
libs/napi/npm/linux-x64-gnu/package.json
  • node >= 10
libs/napi/package.json
  • @napi-rs/cli ^2.16.5
  • ava ^5.1.1
  • node >= 10
tests/graphql-over-http/package.json
  • graphql-http 1.22.0
  • node >=20
  • pnpm >=8
  • pnpm 8.15.6
website/package.json
  • @monaco-editor/react 4.6.0
  • @theguild/components 6.4.1
  • @theguild/prettier-config 2.0.6
  • clsx 2.1.0
  • graphql 16.8.1
  • json-to-pretty-yaml 1.2.2
  • next 14.1.4
  • next-sitemap 4.2.3
  • next-themes 0.3.0
  • nextra 3.0.0-alpha.22
  • prettier 3.2.5
  • prettier-plugin-tailwindcss 0.5.13
  • react 18.2.0
  • react-dom 18.2.0
  • react-icons 5.0.1
  • @theguild/tailwind-config 0.3.2
  • @types/json-schema 7.0.15
  • @types/json-to-pretty-yaml 1.2.1
  • @types/node 20.11.30
  • @types/react 18.2.74
  • typescript 5.4.4
  • node >=20
  • pnpm >=8
  • pnpm 8.15.6

  • Check this box to trigger a request for Renovate to run again on this repository

Detect Federation spec versions and print warnings on unsupported used features

Given a schema like this, federation has its own internal parts that they call โ€œspecsโ€

schema
  @link(url: "https://specs.apollo.dev/link/v1.0")
  @link(url: "https://specs.apollo.dev/join/v0.3", for: EXECUTION) {
  query: Query
}

we should detect these and inform users if we support it or not, specs can be referenced from http://specs.apollo.dev.

  • Fallback to previous supergraph when polling if unsupported features were detected

Dynamic interpolation of variables

Not sure where this needs to be implemented. As we might want to allow users to easily do mapping of headers, and other request parameters.

I was thinking of a plugin like this maybe?

plugins:
  - type: mapping_transform
     config:
        - from: {request.headers['X-Request-ID']}
          to: {upstreamRequest.headers['X-Request-ID']}

GraphQL "fake" `@live`

End-user sends query { something @live { ... }}, we send to the upstream query { something { ... }} and start polling for that specific request.

New config primitive for handling VRL / primitive values? ๐Ÿค”

We can do something like that:

enum ConfigCondition<Context, Alternative> {
  Primitive(Alternative),
  Condition(Context)
}

struct SomeConfig {
   do_something: Option<ConfigCondition<ConditionContext, bool>>
}

In this way we can easily enable configurations like the following:

do_something: true
do_something: false # pass primitive value
do_something: "%request.headers.some-header" == "my-value"    # Context will represent the available data on %

Project Roadmap

Conductor roadmap

๐Ÿ’ก This page's content and the list of tasks is synced automatically from The Guild's Notion. We are open sourcing our roadmap and tasks because we wish to build tools in the public, and allow developers to take part in the process of shaping the future of this library.
๐Ÿš€ Feel free to share your thoughts, feedback and ideas with us.
๐Ÿ‘ If you wish to show interest and help us prioritize tasks, use the ๐Ÿ‘ on the issue.

v0.1

v0.2

Future

  • Spike on integrating uWS server for Conductor
  • #5
  • #131
  • #69

Implement the initial plugin system

Our goal is to allow implementing plugins at the endpoint level. This will allow us to implement caching, persisted operations and so on.

Persisted Operations

requires #8

The goal is to allow running persisted operations by using a hash, and then forward the original query to the upstream.

Tasks

Upstream source request configuration

We can add configuration for the source level, not just endpoint.

Some ideas:

  • Method (POST/GET/something else)
  • Headers (static)

And in the future:

  • Subscription protocol (SSE/WS/polling)

`graphql` source: introspect the server (or load remote/local introspection)

Ideally, we want a graphql source to be able to load introspection for the source.

These are the options we need:

Load from source (default)

(default)

sources:
  - id: countries
    type: graphql
    config:
      endpoint: https://countries.trevorblades.com/

or

sources:
  - id: countries
    type: graphql
    config:
      endpoint: https://countries.trevorblades.com/
      introspection:
        from: source

or, with custom headers:

sources:
  - id: countries
    type: graphql
    config:
      endpoint: https://countries.trevorblades.com/
      introspection:
        from: source
        headers:
           X-Admin-Key: 123

or, with polling:

sources:
  - id: countries
    type: graphql
    config:
      endpoint: https://countries.trevorblades.com/
      introspection:
        from: source
        polling_interval: 60

Load from a remote JSON file (local or remote)

remote:

sources:
  - id: countries
    type: graphql
    config:
      endpoint: https://countries.trevorblades.com/
      introspection:
        from: json
        location: https://countries.trevorblades.com/introspection.json

local:

sources:
  - id: countries
    type: graphql
    config:
      endpoint: https://countries.trevorblades.com/
      introspection:
        from: json
        location: /file-system/introspection.json

Tasks

Support for Supergraph (Apollo) / Fed

The goal is to create a new source that allows us to load Supergraph as a source.

This comes with a set of other requirements:

Tasks

Support for Federation v2

Tasks

Cache core

I wish to add a top-level cache configuration, so we can later use it for implementing plugins and other useful core things.

For example:

caches:
  - type: redis
     id: my-cache
     config:
        connection_string: "..."

And then the core of Conductor can use that, or plugins:

plugins:
  - type: response_cache 
     config:
        cache: my-cache

This way we can also assume that conductor cache is a Key->Value, and users can use a cache that matches their env (D1/KV for CF, Redis/something else for other servers).

Related:

Default headers passthrough

Some headers, like X-Request-Id, can be automatically passed through to the upstream.
We should explore what are other plugins that needs passthrough.

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.