-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: reintroduce graphql-voyager, strip old explorer code
- Loading branch information
Rupert Redington
committed
Sep 13, 2021
1 parent
4ae9152
commit a7e6185
Showing
32 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
explorer-old |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
package.json | ||
src/explorer | ||
explorer-old | ||
yarn.lock | ||
.next | ||
public | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import dynamic from 'next/dynamic'; | ||
import Head from 'next/head'; | ||
import PageLayout from '../../components/PageLayout'; | ||
import Container from '../../components/Container'; | ||
import config from '../../config'; | ||
import 'graphql-voyager/dist/voyager.css'; | ||
|
||
const VoyagerComponent = dynamic( | ||
() => import('graphql-voyager').then((mod) => mod.Voyager), | ||
{ ssr: false } | ||
); | ||
|
||
function introspectionProvider(query) { | ||
return fetch('/api', { | ||
method: 'post', | ||
headers: { 'Content-Type': 'application/json' }, | ||
body: JSON.stringify({ query: query }), | ||
}).then((response) => response.json()); | ||
} | ||
|
||
const Voyager = () => ( | ||
<PageLayout layoutMode="blog"> | ||
<Head> | ||
<title>{config.getTitle('Schema Visualisation')}</title> | ||
</Head> | ||
|
||
<Container> | ||
<VoyagerComponent | ||
introspection={introspectionProvider} | ||
workerURI={'/voyager.worker.js'} | ||
/> | ||
</Container> | ||
</PageLayout> | ||
); | ||
|
||
export default Voyager; |