https://github.com/graphile/federation
Apollo federation support for PostGraphile [UNMAINTAINED]
https://github.com/graphile/federation
Last synced: 9 months ago
JSON representation
Apollo federation support for PostGraphile [UNMAINTAINED]
- Host: GitHub
- URL: https://github.com/graphile/federation
- Owner: graphile
- License: mit
- Created: 2019-06-29T07:23:31.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2025-03-08T01:36:55.000Z (10 months ago)
- Last Synced: 2025-04-10T23:43:21.525Z (9 months ago)
- Language: TypeScript
- Homepage:
- Size: 667 KB
- Stars: 43
- Watchers: 4
- Forks: 12
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# UNMAINTAINED
This plugin is currently unmaintained whilst we focus on development of
PostGraphile version 5. There are community forks that you may wish to check
out:
- [mgagliardo91/postgraphile-federation-plugin](https://github.com/mgagliardo91/postgraphile-federation-plugin)
To add your fork to the list (or describe what sets it apart) please send a
PR to this file.
# @graphile/federation
Apollo federation support for PostGraphile (or any Graphile Engine schema).
## Installation
```
yarn add postgraphile @graphile/federation
```
## CLI usage
```
postgraphile --append-plugins @graphile/federation
```
## Library usage
```js
const express = require("express");
const { postgraphile } = require("postgraphile");
const { default: FederationPlugin } = require("@graphile/federation");
const app = express();
app.use(
postgraphile(process.env.DATABASE_URL, "public", {
appendPlugins: [FederationPlugin],
})
);
app.listen(process.env.PORT || 3000);
```
## How?
This plugin exposes the [Global Object Identification
Specification](https://facebook.github.io/relay/graphql/objectidentification.htm)
(i.e. `Node` interface) in a way that's compatible with Apollo Federation.
Requires PostGraphile v4.4.2-rc.0+ and a maintained LTS version of Node.
## Do you need this?
Only use this if you're planning to have your API consumed by Apollo
Federation; exposing these redundant interfaces to regular users may be
confusing.
## Status
Proof of concept. No tests, use at your own risk! Pull requests very welcome.