graphile / graphile/crystal

Bundle `graphql-voyager` in GraphiQL

Open
#1,095 2 comments 3 reactions 0 assignees View on GitHub
✨ Possible via v4 plugin 📄 add-to-docs
Dominant language
TypeScript
Stars
12.9k
Forks
625
Avg merge
5h 23m
Merged PRs (30d)
24

Description

I'm submitting a ...

* [ ] bug report
* [x] feature request
* [ ] question

It is fairly trivial to expose `graphql-voyager` yourself if you are already consuming `postgraphile` as a library. Doing so is roughly as easy as:

```ts
import * as express from 'express';
import { express as voyagerMiddleware } from 'graphql-voyager/middleware';
import { postgraphile } from 'postgraphile';

const app = express();

app.use(postgraphile(PG_POOL, PG_SCHEMA, graphileConfig));
app.use('/voyager', voyagerMiddleware({
endpointUrl: `${graphileConfig.externalUrlBase || ''}/graphql`,
displayOptions: {
hideRoot: true,
skipDeprecated: true,
skipRelay: true,
},
}));

app.listen(PORT, () => {
console.log(`Listening on localhost:${PORT}`);
});
```

It would be nice to have Voyager bundled for a couple reasons, namely:

1. easier for CLI users to explore their schema graphically
1. possibility for tighter integration with our custom GraphiQL interface (i.e. [deep linking](https://github.com/APIs-guru/graphql-voyager/issues/12), which is not yet supported by Voyager)
1. could be loaded at the same `/graphiql` endpoint

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.