mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-27 00:19:55 +03:00
stash
This commit is contained in:
parent
35ff7d383c
commit
ea49d0e97f
13
.yarnrc.yml
13
.yarnrc.yml
|
@ -19,20 +19,9 @@ packageExtensions:
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/react': '*'
|
'@types/react': '*'
|
||||||
'react': '*'
|
'react': '*'
|
||||||
'apollo-server-core@^2.25.2':
|
'apollo-server-core@^3.4.0':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/node': '^14.17.15'
|
'@types/node': '^14.17.15'
|
||||||
'apollo-server@^2.25.2':
|
|
||||||
dependencies:
|
|
||||||
'@types/express': '^4.17.13'
|
|
||||||
'@types/node': '^14.17.15'
|
|
||||||
'graphql-subscriptions@^1.0.0':
|
|
||||||
dependencies:
|
|
||||||
'@types/node': '^14.17.15'
|
|
||||||
'subscriptions-transport-ws@^0.9.19':
|
|
||||||
dependencies:
|
|
||||||
'@types/node': '^14.17.15'
|
|
||||||
'@types/ws': '^7.4.7'
|
|
||||||
'knex@^0.19.5':
|
'knex@^0.19.5':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@types/node': '^14.17.15'
|
'@types/node': '^14.17.15'
|
||||||
|
|
|
@ -42,7 +42,6 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@redux-devtools/app": "^1.0.0-8",
|
"@redux-devtools/app": "^1.0.0-8",
|
||||||
"@types/react": "^17.0.32",
|
"@types/react": "^17.0.32",
|
||||||
"apollo-server": "^3.4.0",
|
|
||||||
"apollo-server-express": "^3.4.0",
|
"apollo-server-express": "^3.4.0",
|
||||||
"body-parser": "^1.19.0",
|
"body-parser": "^1.19.0",
|
||||||
"chalk": "^4.1.2",
|
"chalk": "^4.1.2",
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import { makeExecutableSchema } from 'apollo-server';
|
|
||||||
import { Store } from '../store';
|
import { Store } from '../store';
|
||||||
|
|
||||||
const schema = fs
|
export const schema = fs
|
||||||
.readFileSync(require.resolve('./schema_def.graphql'))
|
.readFileSync(require.resolve('./schema_def.graphql'))
|
||||||
.toString();
|
.toString();
|
||||||
|
|
||||||
const resolvers = {
|
export const resolvers = {
|
||||||
Query: {
|
Query: {
|
||||||
reports: function report(
|
reports: function report(
|
||||||
source: unknown,
|
source: unknown,
|
||||||
|
@ -24,10 +23,3 @@ const resolvers = {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const executableSchema = makeExecutableSchema({
|
|
||||||
typeDefs: schema,
|
|
||||||
resolvers: resolvers,
|
|
||||||
});
|
|
||||||
|
|
||||||
export default executableSchema;
|
|
||||||
|
|
|
@ -1,28 +1,13 @@
|
||||||
import { ApolloServer } from 'apollo-server-express';
|
import { ApolloServer } from 'apollo-server-express';
|
||||||
import schema from '../api/schema';
|
import { schema, resolvers } from '../api/schema';
|
||||||
import { Store } from '../store';
|
import { Store } from '../store';
|
||||||
|
|
||||||
export default function (store: Store) {
|
export default function (store: Store) {
|
||||||
return new ApolloServer({
|
return new ApolloServer({
|
||||||
schema,
|
typeDefs: schema,
|
||||||
|
resolvers,
|
||||||
context: {
|
context: {
|
||||||
store: store,
|
store: store,
|
||||||
},
|
},
|
||||||
playground: {
|
|
||||||
endpoint: '/graphql',
|
|
||||||
tabs: [
|
|
||||||
{
|
|
||||||
endpoint: '/graphql',
|
|
||||||
query:
|
|
||||||
'{\n' +
|
|
||||||
' reports {\n' +
|
|
||||||
' id,\n' +
|
|
||||||
' type,\n' +
|
|
||||||
' title\n' +
|
|
||||||
' }\n' +
|
|
||||||
'}',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,8 +5,10 @@ import * as http from 'http';
|
||||||
import bodyParser from 'body-parser';
|
import bodyParser from 'body-parser';
|
||||||
import cors from 'cors';
|
import cors from 'cors';
|
||||||
import { SCServer } from 'socketcluster-server';
|
import { SCServer } from 'socketcluster-server';
|
||||||
|
import { ApolloServer } from 'apollo-server-express';
|
||||||
import graphqlMiddleware from './middleware/graphql';
|
import graphqlMiddleware from './middleware/graphql';
|
||||||
import { AddData, ReportBaseFields, Store } from './store';
|
import { AddData, ReportBaseFields, Store } from './store';
|
||||||
|
import { resolvers, schema } from './api/schema';
|
||||||
|
|
||||||
const app = express.Router();
|
const app = express.Router();
|
||||||
|
|
||||||
|
@ -40,6 +42,15 @@ function routes(
|
||||||
else app.use(morgan('combined'));
|
else app.use(morgan('combined'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const server = new ApolloServer({
|
||||||
|
typeDefs: schema,
|
||||||
|
resolvers,
|
||||||
|
context: {
|
||||||
|
store: store,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
await server.start();
|
||||||
|
server.applyMiddleware({ app });
|
||||||
graphqlMiddleware(store).applyMiddleware({ app } as {
|
graphqlMiddleware(store).applyMiddleware({ app } as {
|
||||||
app: express.Application;
|
app: express.Application;
|
||||||
});
|
});
|
||||||
|
|
|
@ -18,7 +18,7 @@ function error(msg: string): Promise<{ error: string }> {
|
||||||
|
|
||||||
type ReportType = 'STATE' | 'ACTION' | 'STATES' | 'ACTIONS';
|
type ReportType = 'STATE' | 'ACTION' | 'STATES' | 'ACTIONS';
|
||||||
|
|
||||||
interface Report {
|
export interface Report {
|
||||||
id: string;
|
id: string;
|
||||||
type: ReportType | null;
|
type: ReportType | null;
|
||||||
title: string | null;
|
title: string | null;
|
||||||
|
|
14
yarn.lock
14
yarn.lock
|
@ -4659,7 +4659,6 @@ __metadata:
|
||||||
"@types/uuid": ^8.3.1
|
"@types/uuid": ^8.3.1
|
||||||
"@typescript-eslint/eslint-plugin": ^5.1.0
|
"@typescript-eslint/eslint-plugin": ^5.1.0
|
||||||
"@typescript-eslint/parser": ^5.1.0
|
"@typescript-eslint/parser": ^5.1.0
|
||||||
apollo-server: ^3.4.0
|
|
||||||
apollo-server-express: ^3.4.0
|
apollo-server-express: ^3.4.0
|
||||||
body-parser: ^1.19.0
|
body-parser: ^1.19.0
|
||||||
chalk: ^4.1.2
|
chalk: ^4.1.2
|
||||||
|
@ -8826,19 +8825,6 @@ __metadata:
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"apollo-server@npm:^3.4.0":
|
|
||||||
version: 3.4.0
|
|
||||||
resolution: "apollo-server@npm:3.4.0"
|
|
||||||
dependencies:
|
|
||||||
apollo-server-core: ^3.4.0
|
|
||||||
apollo-server-express: ^3.4.0
|
|
||||||
express: ^4.17.1
|
|
||||||
peerDependencies:
|
|
||||||
graphql: ^15.3.0
|
|
||||||
checksum: e51e5529b4014cfa2bbf52038223b04a87c423b481a7948d8430a8861ab9766ef12d8bd08945434819f9f85ee5c0134cced6be2da7460b3bc29aa7185cb39bed
|
|
||||||
languageName: node
|
|
||||||
linkType: hard
|
|
||||||
|
|
||||||
"app-root-dir@npm:^1.0.2":
|
"app-root-dir@npm:^1.0.2":
|
||||||
version: 1.0.2
|
version: 1.0.2
|
||||||
resolution: "app-root-dir@npm:1.0.2"
|
resolution: "app-root-dir@npm:1.0.2"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user