Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/enisdenjo/graphql-composite
Spec agnostic GraphQL composite schema planner, executor and explainer.
https://github.com/enisdenjo/graphql-composite
composite execution federation gateway graphql planning
Last synced: about 1 month ago
JSON representation
Spec agnostic GraphQL composite schema planner, executor and explainer.
- Host: GitHub
- URL: https://github.com/enisdenjo/graphql-composite
- Owner: enisdenjo
- License: mit
- Created: 2024-04-22T13:27:51.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-10-13T17:41:49.000Z (4 months ago)
- Last Synced: 2025-01-11T16:38:31.238Z (about 1 month ago)
- Topics: composite, execution, federation, gateway, graphql, planning
- Language: TypeScript
- Homepage:
- Size: 3.26 MB
- Stars: 7
- Watchers: 7
- Forks: 0
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# graphql-composite
> [!CAUTION]
> Alpha stage.Spec agnostic GraphQL composite schema planner, executor and explainer.
## Features
- Zero-dependency
- _Not at the moment because I am lazy - [see deps](/package.json) - they'll be dropped in future iterations_
- Spec agnostic
- Even specless since you can design your own [Blueprint](/src/blueprint.ts#Blueprint)
- Runs in any environment
- Stable plans and explanations
- Everything's JSON serialisable, all steps until execution can be cached## Get started
See [plan, gather and execute tests](/tests/planGatherAndExecute.test.ts), and the accompanying [fixtures](/tests/fixtures).
## How does it work?
1. Parse a GraphQL composite schema to a [Blueprint](/src/blueprint.ts#Blueprint)
1. Create a [GatherPlan](/src/gather.ts#GatherPlan) using the [Blueprint](/src/blueprint.ts#Blueprint) and a GraphQL.js document
1. Execute a query using the [GatherPlan](/src/gather.ts#GatherPlan)
- Execution will create a ready-to-use GraphQL response and an [ExecutionExplain](/src/execute.ts#ExecutionExplain) explaining the steps\*_[Blueprint](/src/blueprint.ts#Blueprint), [GatherPlan](/src/gather.ts#GatherPlan) as well as [ExecutionExplain](/src/execute.ts#ExecutionExplain) are serialisable to JSON._