mirror of
https://github.com/netbox-community/netbox.git
synced 2026-02-05 06:46:25 -06:00
Closes #6855: Bundle and locally serve GraphiQL JS/CSS
This commit is contained in:
@@ -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';
|
||||
@@ -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;
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user