-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #6855: Bundle and locally serve GraphiQL JS/CSS
- Loading branch information
1 parent
80836c7
commit 08ed545
Showing
10 changed files
with
645 additions
and
24 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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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,3 @@ | ||
// Rather than use CDNs to include GraphiQL dependencies, import and bundle the dependencies so | ||
// they can be locally served. | ||
@import '../node_modules/graphiql/graphiql.css'; |
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,17 @@ | ||
/** | ||
* Rather than use CDNs to include GraphiQL dependencies, import and bundle the dependencies so | ||
* they can be locally served. | ||
*/ | ||
|
||
import * as React from 'react'; | ||
import * as ReactDOM from 'react-dom'; | ||
import 'graphql'; | ||
import GraphiQL from 'graphiql'; | ||
import SubscriptionsTransportWs from 'subscriptions-transport-ws'; | ||
|
||
window.React = React; | ||
window.ReactDOM = ReactDOM; | ||
// @ts-expect-error Assigning to window is required for graphene-django | ||
window.SubscriptionsTransportWs = SubscriptionsTransportWs; | ||
// @ts-expect-error Assigning to window is required for graphene-django | ||
window.GraphiQL = GraphiQL; |
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,16 @@ | ||
{ | ||
"name": "netbox-graphiql", | ||
"version": "0.1.0", | ||
"description": "NetBox GraphiQL Custom Front End", | ||
"main": "dist/graphiql.js", | ||
"license": "Apache-2.0", | ||
"private": true, | ||
"dependencies": { | ||
"graphiql": "1.4.1", | ||
"graphql": ">= v14.5.0 <= 15.5.0", | ||
"react": "17.0.2", | ||
"react-dom": "17.0.2", | ||
"subscriptions-transport-ws": "0.9.18", | ||
"whatwg-fetch": "3.6.2" | ||
} | ||
} |
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
Oops, something went wrong.