Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/perl/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript GraphQL:架构不可用_Javascript_Typescript_Schema_Graphql - Fatal编程技术网

Javascript GraphQL:架构不可用

Javascript GraphQL:架构不可用,javascript,typescript,schema,graphql,Javascript,Typescript,Schema,Graphql,我是GraphQL的新手,我需要你的专业知识!!!我的问题是模式在graphiql中不可用 我的项目目录树是: 我的文件的代码是: index.js import express from "express"; import morgan from "morgan"; import config from "./config"; const app = express(); //Settings //Middleware app.use(morgan("dev")); app.use(e

我是GraphQL的新手,我需要你的专业知识!!!我的问题是模式在graphiql中不可用

我的项目目录树是:

我的文件的代码是:

index.js

import express from "express";
import morgan from "morgan";
import config from "./config";

const app = express();

//Settings

//Middleware
app.use(morgan("dev"));
app.use(express.json());

//Routes
app.use(require("./routes/graphql.routes"));

//Starting server
app.listen(process.env.PORT || config.server.port, () => {
    console.log(config.server.name + " is listening on port " + config.server.port);
})
import express from "express";
import GraphHTTP from "express-graphql";
import {PlayerModel} from "../models/player.model"; 
import {Schema} from "../schemas/schema"; 

const router = express.Router();

router.get("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));

module.exports = router;
import {DB} from "../db";
import Sequelize from "sequelize";
const PlayerModel = DB.db.define("tbl003_player", {
        id: {
            type: Sequelize.INTEGER,
            primaryKey: true,
            autoIncrement: true,
            notNull: true
        },
        name: {
            type: Sequelize.STRING,
            notNull: true,
            notEmpty: true
        },
        name_url: {
            type: Sequelize.STRING,
            notNull: true,
            notEmpty: true
        },
        language: {
            type: Sequelize.STRING,
            notNull: true,
            notEmpty: true,
            isIn: {
                args: [["sp", "en"]],
                msg: "Must be 'sp' or 'en'",
            }
        },
        twitter: {
            type: Sequelize.STRING,
            notEmpty: false
        },
        height: {
            type: Sequelize.FLOAT,
            isDecimal: true,
            notEmpty: false
        },
        date_insert: {
            type: Sequelize.DATE,
            notNull: true,
        }
    },{
        getterMethods: {
            getID(){
                return this.id
            },
            getName(){
                return this.name
            },
            getNameURL(){
                return this.name_url
            },
            getLanguage(){
                return this.language
            },
            getTwitter(){
                return this.twitter
            },
            getHeight(){
                return this.height
            },
            getDateInsert(){
                return this.date_insert
            }
        },
        setterMethods: {
            setName(value){
                this.setDataValue("name", value);
            },
            setNameURL(value){
                this.setDataValue("name_url", value);
            },
            setLanguage(value){
                this.setDataValue("language", value);
            },
            setTwitter(value){
                this.setDataValue("twitter", value);
            },
            setHeight(value){
                this.setDataValue("height", value);
            },
            setDataInsert(){
                let date = new Date("now");
                this.setDataValue("date_insert", date);
            }
        }     
    }
);

module.exports.PlayerModel = PlayerModel;
import {
    GraphQLObjectType,
    GraphQLNonNull,
    GraphQLID,
    GraphQLString,
    GraphQLFloat,
    GraphQLList
} from "graphql";
import {DateTime} from "../scalar/dateTime";


const Player = new GraphQLObjectType({
    name: "Player",
    description: "Player of basketball",
    fields: () => {
        return {
            id: {
                type: new GraphQLNonNull(GraphQLID),
                resolve(player){
                    return player.id
                }
            },
            name: {
                type: new GraphQLNonNull(GraphQLString),
                resolve(player){
                    return player.name
                } 
            },
            name_url: {
                type: new GraphQLNonNull(GraphQLString),
                resolve(player){
                    return player.name_url
                }
            },
            language: {
                type: new GraphQLNonNull(GraphQLString),
                resolve(player){
                    return player.language
                }
            },
            twitter: {
                type: GraphQLString,
                resolve(player){
                    return player.twitter
                }
            },
            height: {
                type: GraphQLFloat,
                resolve(player){
                    return player.height
                }
            },
            date_insert: {
                type: new GraphQLNonNull(DateTime),
                resolve(player){
                    return player.date_insert
                }
            }
        }
    }
});

module.exports.Player = Player;
import {
    GraphQLObjectType,
    GraphQLNonNull,
    GraphQLID,
    GraphQLInt,
    GraphQLString,
    GraphQLFloat,
    GraphQLList,
    GraphQLSchema
} from "graphql";
import { DB } from "../db";
import {Player} from "./player.schema";

const Query = new GraphQLObjectType({
    name: "Query",
    description: "This is root query",
    fields: () => {
        return {
            players: {
                type: GraphQLList(Player),
                args: {
                    id: {
                        type: GraphQLID
                    }
                },
                resolve(root, args){
                    return DB.db.models.tbl003_player.findAll({where: args});
                }
            },
        }
    }
});

const Schema = new GraphQLSchema({
    query: Query
});

module.exports.Schema = Schema;
import express from "express";
import GraphHTTP from "express-graphql";
import {PlayerModel} from "../models/player.model"; 
import {Schema} from "../schemas/schema"; 

const router = express.Router();

router.get("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));

router.post("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));


module.exports = router;
import express from "express";
import GraphHTTP from "express-graphql";
import {PlayerModel} from "../models/player.model"; 
import {Schema} from "../schemas/schema"; 

const router = express.Router();

router.get("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));

router.post("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));

module.exports = router;
graphql.routes.js

import express from "express";
import morgan from "morgan";
import config from "./config";

const app = express();

//Settings

//Middleware
app.use(morgan("dev"));
app.use(express.json());

//Routes
app.use(require("./routes/graphql.routes"));

//Starting server
app.listen(process.env.PORT || config.server.port, () => {
    console.log(config.server.name + " is listening on port " + config.server.port);
})
import express from "express";
import GraphHTTP from "express-graphql";
import {PlayerModel} from "../models/player.model"; 
import {Schema} from "../schemas/schema"; 

const router = express.Router();

router.get("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));

module.exports = router;
import {DB} from "../db";
import Sequelize from "sequelize";
const PlayerModel = DB.db.define("tbl003_player", {
        id: {
            type: Sequelize.INTEGER,
            primaryKey: true,
            autoIncrement: true,
            notNull: true
        },
        name: {
            type: Sequelize.STRING,
            notNull: true,
            notEmpty: true
        },
        name_url: {
            type: Sequelize.STRING,
            notNull: true,
            notEmpty: true
        },
        language: {
            type: Sequelize.STRING,
            notNull: true,
            notEmpty: true,
            isIn: {
                args: [["sp", "en"]],
                msg: "Must be 'sp' or 'en'",
            }
        },
        twitter: {
            type: Sequelize.STRING,
            notEmpty: false
        },
        height: {
            type: Sequelize.FLOAT,
            isDecimal: true,
            notEmpty: false
        },
        date_insert: {
            type: Sequelize.DATE,
            notNull: true,
        }
    },{
        getterMethods: {
            getID(){
                return this.id
            },
            getName(){
                return this.name
            },
            getNameURL(){
                return this.name_url
            },
            getLanguage(){
                return this.language
            },
            getTwitter(){
                return this.twitter
            },
            getHeight(){
                return this.height
            },
            getDateInsert(){
                return this.date_insert
            }
        },
        setterMethods: {
            setName(value){
                this.setDataValue("name", value);
            },
            setNameURL(value){
                this.setDataValue("name_url", value);
            },
            setLanguage(value){
                this.setDataValue("language", value);
            },
            setTwitter(value){
                this.setDataValue("twitter", value);
            },
            setHeight(value){
                this.setDataValue("height", value);
            },
            setDataInsert(){
                let date = new Date("now");
                this.setDataValue("date_insert", date);
            }
        }     
    }
);

module.exports.PlayerModel = PlayerModel;
import {
    GraphQLObjectType,
    GraphQLNonNull,
    GraphQLID,
    GraphQLString,
    GraphQLFloat,
    GraphQLList
} from "graphql";
import {DateTime} from "../scalar/dateTime";


const Player = new GraphQLObjectType({
    name: "Player",
    description: "Player of basketball",
    fields: () => {
        return {
            id: {
                type: new GraphQLNonNull(GraphQLID),
                resolve(player){
                    return player.id
                }
            },
            name: {
                type: new GraphQLNonNull(GraphQLString),
                resolve(player){
                    return player.name
                } 
            },
            name_url: {
                type: new GraphQLNonNull(GraphQLString),
                resolve(player){
                    return player.name_url
                }
            },
            language: {
                type: new GraphQLNonNull(GraphQLString),
                resolve(player){
                    return player.language
                }
            },
            twitter: {
                type: GraphQLString,
                resolve(player){
                    return player.twitter
                }
            },
            height: {
                type: GraphQLFloat,
                resolve(player){
                    return player.height
                }
            },
            date_insert: {
                type: new GraphQLNonNull(DateTime),
                resolve(player){
                    return player.date_insert
                }
            }
        }
    }
});

module.exports.Player = Player;
import {
    GraphQLObjectType,
    GraphQLNonNull,
    GraphQLID,
    GraphQLInt,
    GraphQLString,
    GraphQLFloat,
    GraphQLList,
    GraphQLSchema
} from "graphql";
import { DB } from "../db";
import {Player} from "./player.schema";

const Query = new GraphQLObjectType({
    name: "Query",
    description: "This is root query",
    fields: () => {
        return {
            players: {
                type: GraphQLList(Player),
                args: {
                    id: {
                        type: GraphQLID
                    }
                },
                resolve(root, args){
                    return DB.db.models.tbl003_player.findAll({where: args});
                }
            },
        }
    }
});

const Schema = new GraphQLSchema({
    query: Query
});

module.exports.Schema = Schema;
import express from "express";
import GraphHTTP from "express-graphql";
import {PlayerModel} from "../models/player.model"; 
import {Schema} from "../schemas/schema"; 

const router = express.Router();

router.get("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));

router.post("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));


module.exports = router;
import express from "express";
import GraphHTTP from "express-graphql";
import {PlayerModel} from "../models/player.model"; 
import {Schema} from "../schemas/schema"; 

const router = express.Router();

router.get("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));

router.post("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));

module.exports = router;
player.model.js

import express from "express";
import morgan from "morgan";
import config from "./config";

const app = express();

//Settings

//Middleware
app.use(morgan("dev"));
app.use(express.json());

//Routes
app.use(require("./routes/graphql.routes"));

//Starting server
app.listen(process.env.PORT || config.server.port, () => {
    console.log(config.server.name + " is listening on port " + config.server.port);
})
import express from "express";
import GraphHTTP from "express-graphql";
import {PlayerModel} from "../models/player.model"; 
import {Schema} from "../schemas/schema"; 

const router = express.Router();

router.get("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));

module.exports = router;
import {DB} from "../db";
import Sequelize from "sequelize";
const PlayerModel = DB.db.define("tbl003_player", {
        id: {
            type: Sequelize.INTEGER,
            primaryKey: true,
            autoIncrement: true,
            notNull: true
        },
        name: {
            type: Sequelize.STRING,
            notNull: true,
            notEmpty: true
        },
        name_url: {
            type: Sequelize.STRING,
            notNull: true,
            notEmpty: true
        },
        language: {
            type: Sequelize.STRING,
            notNull: true,
            notEmpty: true,
            isIn: {
                args: [["sp", "en"]],
                msg: "Must be 'sp' or 'en'",
            }
        },
        twitter: {
            type: Sequelize.STRING,
            notEmpty: false
        },
        height: {
            type: Sequelize.FLOAT,
            isDecimal: true,
            notEmpty: false
        },
        date_insert: {
            type: Sequelize.DATE,
            notNull: true,
        }
    },{
        getterMethods: {
            getID(){
                return this.id
            },
            getName(){
                return this.name
            },
            getNameURL(){
                return this.name_url
            },
            getLanguage(){
                return this.language
            },
            getTwitter(){
                return this.twitter
            },
            getHeight(){
                return this.height
            },
            getDateInsert(){
                return this.date_insert
            }
        },
        setterMethods: {
            setName(value){
                this.setDataValue("name", value);
            },
            setNameURL(value){
                this.setDataValue("name_url", value);
            },
            setLanguage(value){
                this.setDataValue("language", value);
            },
            setTwitter(value){
                this.setDataValue("twitter", value);
            },
            setHeight(value){
                this.setDataValue("height", value);
            },
            setDataInsert(){
                let date = new Date("now");
                this.setDataValue("date_insert", date);
            }
        }     
    }
);

module.exports.PlayerModel = PlayerModel;
import {
    GraphQLObjectType,
    GraphQLNonNull,
    GraphQLID,
    GraphQLString,
    GraphQLFloat,
    GraphQLList
} from "graphql";
import {DateTime} from "../scalar/dateTime";


const Player = new GraphQLObjectType({
    name: "Player",
    description: "Player of basketball",
    fields: () => {
        return {
            id: {
                type: new GraphQLNonNull(GraphQLID),
                resolve(player){
                    return player.id
                }
            },
            name: {
                type: new GraphQLNonNull(GraphQLString),
                resolve(player){
                    return player.name
                } 
            },
            name_url: {
                type: new GraphQLNonNull(GraphQLString),
                resolve(player){
                    return player.name_url
                }
            },
            language: {
                type: new GraphQLNonNull(GraphQLString),
                resolve(player){
                    return player.language
                }
            },
            twitter: {
                type: GraphQLString,
                resolve(player){
                    return player.twitter
                }
            },
            height: {
                type: GraphQLFloat,
                resolve(player){
                    return player.height
                }
            },
            date_insert: {
                type: new GraphQLNonNull(DateTime),
                resolve(player){
                    return player.date_insert
                }
            }
        }
    }
});

module.exports.Player = Player;
import {
    GraphQLObjectType,
    GraphQLNonNull,
    GraphQLID,
    GraphQLInt,
    GraphQLString,
    GraphQLFloat,
    GraphQLList,
    GraphQLSchema
} from "graphql";
import { DB } from "../db";
import {Player} from "./player.schema";

const Query = new GraphQLObjectType({
    name: "Query",
    description: "This is root query",
    fields: () => {
        return {
            players: {
                type: GraphQLList(Player),
                args: {
                    id: {
                        type: GraphQLID
                    }
                },
                resolve(root, args){
                    return DB.db.models.tbl003_player.findAll({where: args});
                }
            },
        }
    }
});

const Schema = new GraphQLSchema({
    query: Query
});

module.exports.Schema = Schema;
import express from "express";
import GraphHTTP from "express-graphql";
import {PlayerModel} from "../models/player.model"; 
import {Schema} from "../schemas/schema"; 

const router = express.Router();

router.get("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));

router.post("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));


module.exports = router;
import express from "express";
import GraphHTTP from "express-graphql";
import {PlayerModel} from "../models/player.model"; 
import {Schema} from "../schemas/schema"; 

const router = express.Router();

router.get("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));

router.post("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));

module.exports = router;
player.schema.js

import express from "express";
import morgan from "morgan";
import config from "./config";

const app = express();

//Settings

//Middleware
app.use(morgan("dev"));
app.use(express.json());

//Routes
app.use(require("./routes/graphql.routes"));

//Starting server
app.listen(process.env.PORT || config.server.port, () => {
    console.log(config.server.name + " is listening on port " + config.server.port);
})
import express from "express";
import GraphHTTP from "express-graphql";
import {PlayerModel} from "../models/player.model"; 
import {Schema} from "../schemas/schema"; 

const router = express.Router();

router.get("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));

module.exports = router;
import {DB} from "../db";
import Sequelize from "sequelize";
const PlayerModel = DB.db.define("tbl003_player", {
        id: {
            type: Sequelize.INTEGER,
            primaryKey: true,
            autoIncrement: true,
            notNull: true
        },
        name: {
            type: Sequelize.STRING,
            notNull: true,
            notEmpty: true
        },
        name_url: {
            type: Sequelize.STRING,
            notNull: true,
            notEmpty: true
        },
        language: {
            type: Sequelize.STRING,
            notNull: true,
            notEmpty: true,
            isIn: {
                args: [["sp", "en"]],
                msg: "Must be 'sp' or 'en'",
            }
        },
        twitter: {
            type: Sequelize.STRING,
            notEmpty: false
        },
        height: {
            type: Sequelize.FLOAT,
            isDecimal: true,
            notEmpty: false
        },
        date_insert: {
            type: Sequelize.DATE,
            notNull: true,
        }
    },{
        getterMethods: {
            getID(){
                return this.id
            },
            getName(){
                return this.name
            },
            getNameURL(){
                return this.name_url
            },
            getLanguage(){
                return this.language
            },
            getTwitter(){
                return this.twitter
            },
            getHeight(){
                return this.height
            },
            getDateInsert(){
                return this.date_insert
            }
        },
        setterMethods: {
            setName(value){
                this.setDataValue("name", value);
            },
            setNameURL(value){
                this.setDataValue("name_url", value);
            },
            setLanguage(value){
                this.setDataValue("language", value);
            },
            setTwitter(value){
                this.setDataValue("twitter", value);
            },
            setHeight(value){
                this.setDataValue("height", value);
            },
            setDataInsert(){
                let date = new Date("now");
                this.setDataValue("date_insert", date);
            }
        }     
    }
);

module.exports.PlayerModel = PlayerModel;
import {
    GraphQLObjectType,
    GraphQLNonNull,
    GraphQLID,
    GraphQLString,
    GraphQLFloat,
    GraphQLList
} from "graphql";
import {DateTime} from "../scalar/dateTime";


const Player = new GraphQLObjectType({
    name: "Player",
    description: "Player of basketball",
    fields: () => {
        return {
            id: {
                type: new GraphQLNonNull(GraphQLID),
                resolve(player){
                    return player.id
                }
            },
            name: {
                type: new GraphQLNonNull(GraphQLString),
                resolve(player){
                    return player.name
                } 
            },
            name_url: {
                type: new GraphQLNonNull(GraphQLString),
                resolve(player){
                    return player.name_url
                }
            },
            language: {
                type: new GraphQLNonNull(GraphQLString),
                resolve(player){
                    return player.language
                }
            },
            twitter: {
                type: GraphQLString,
                resolve(player){
                    return player.twitter
                }
            },
            height: {
                type: GraphQLFloat,
                resolve(player){
                    return player.height
                }
            },
            date_insert: {
                type: new GraphQLNonNull(DateTime),
                resolve(player){
                    return player.date_insert
                }
            }
        }
    }
});

module.exports.Player = Player;
import {
    GraphQLObjectType,
    GraphQLNonNull,
    GraphQLID,
    GraphQLInt,
    GraphQLString,
    GraphQLFloat,
    GraphQLList,
    GraphQLSchema
} from "graphql";
import { DB } from "../db";
import {Player} from "./player.schema";

const Query = new GraphQLObjectType({
    name: "Query",
    description: "This is root query",
    fields: () => {
        return {
            players: {
                type: GraphQLList(Player),
                args: {
                    id: {
                        type: GraphQLID
                    }
                },
                resolve(root, args){
                    return DB.db.models.tbl003_player.findAll({where: args});
                }
            },
        }
    }
});

const Schema = new GraphQLSchema({
    query: Query
});

module.exports.Schema = Schema;
import express from "express";
import GraphHTTP from "express-graphql";
import {PlayerModel} from "../models/player.model"; 
import {Schema} from "../schemas/schema"; 

const router = express.Router();

router.get("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));

router.post("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));


module.exports = router;
import express from "express";
import GraphHTTP from "express-graphql";
import {PlayerModel} from "../models/player.model"; 
import {Schema} from "../schemas/schema"; 

const router = express.Router();

router.get("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));

router.post("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));

module.exports = router;
schema.js

import express from "express";
import morgan from "morgan";
import config from "./config";

const app = express();

//Settings

//Middleware
app.use(morgan("dev"));
app.use(express.json());

//Routes
app.use(require("./routes/graphql.routes"));

//Starting server
app.listen(process.env.PORT || config.server.port, () => {
    console.log(config.server.name + " is listening on port " + config.server.port);
})
import express from "express";
import GraphHTTP from "express-graphql";
import {PlayerModel} from "../models/player.model"; 
import {Schema} from "../schemas/schema"; 

const router = express.Router();

router.get("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));

module.exports = router;
import {DB} from "../db";
import Sequelize from "sequelize";
const PlayerModel = DB.db.define("tbl003_player", {
        id: {
            type: Sequelize.INTEGER,
            primaryKey: true,
            autoIncrement: true,
            notNull: true
        },
        name: {
            type: Sequelize.STRING,
            notNull: true,
            notEmpty: true
        },
        name_url: {
            type: Sequelize.STRING,
            notNull: true,
            notEmpty: true
        },
        language: {
            type: Sequelize.STRING,
            notNull: true,
            notEmpty: true,
            isIn: {
                args: [["sp", "en"]],
                msg: "Must be 'sp' or 'en'",
            }
        },
        twitter: {
            type: Sequelize.STRING,
            notEmpty: false
        },
        height: {
            type: Sequelize.FLOAT,
            isDecimal: true,
            notEmpty: false
        },
        date_insert: {
            type: Sequelize.DATE,
            notNull: true,
        }
    },{
        getterMethods: {
            getID(){
                return this.id
            },
            getName(){
                return this.name
            },
            getNameURL(){
                return this.name_url
            },
            getLanguage(){
                return this.language
            },
            getTwitter(){
                return this.twitter
            },
            getHeight(){
                return this.height
            },
            getDateInsert(){
                return this.date_insert
            }
        },
        setterMethods: {
            setName(value){
                this.setDataValue("name", value);
            },
            setNameURL(value){
                this.setDataValue("name_url", value);
            },
            setLanguage(value){
                this.setDataValue("language", value);
            },
            setTwitter(value){
                this.setDataValue("twitter", value);
            },
            setHeight(value){
                this.setDataValue("height", value);
            },
            setDataInsert(){
                let date = new Date("now");
                this.setDataValue("date_insert", date);
            }
        }     
    }
);

module.exports.PlayerModel = PlayerModel;
import {
    GraphQLObjectType,
    GraphQLNonNull,
    GraphQLID,
    GraphQLString,
    GraphQLFloat,
    GraphQLList
} from "graphql";
import {DateTime} from "../scalar/dateTime";


const Player = new GraphQLObjectType({
    name: "Player",
    description: "Player of basketball",
    fields: () => {
        return {
            id: {
                type: new GraphQLNonNull(GraphQLID),
                resolve(player){
                    return player.id
                }
            },
            name: {
                type: new GraphQLNonNull(GraphQLString),
                resolve(player){
                    return player.name
                } 
            },
            name_url: {
                type: new GraphQLNonNull(GraphQLString),
                resolve(player){
                    return player.name_url
                }
            },
            language: {
                type: new GraphQLNonNull(GraphQLString),
                resolve(player){
                    return player.language
                }
            },
            twitter: {
                type: GraphQLString,
                resolve(player){
                    return player.twitter
                }
            },
            height: {
                type: GraphQLFloat,
                resolve(player){
                    return player.height
                }
            },
            date_insert: {
                type: new GraphQLNonNull(DateTime),
                resolve(player){
                    return player.date_insert
                }
            }
        }
    }
});

module.exports.Player = Player;
import {
    GraphQLObjectType,
    GraphQLNonNull,
    GraphQLID,
    GraphQLInt,
    GraphQLString,
    GraphQLFloat,
    GraphQLList,
    GraphQLSchema
} from "graphql";
import { DB } from "../db";
import {Player} from "./player.schema";

const Query = new GraphQLObjectType({
    name: "Query",
    description: "This is root query",
    fields: () => {
        return {
            players: {
                type: GraphQLList(Player),
                args: {
                    id: {
                        type: GraphQLID
                    }
                },
                resolve(root, args){
                    return DB.db.models.tbl003_player.findAll({where: args});
                }
            },
        }
    }
});

const Schema = new GraphQLSchema({
    query: Query
});

module.exports.Schema = Schema;
import express from "express";
import GraphHTTP from "express-graphql";
import {PlayerModel} from "../models/player.model"; 
import {Schema} from "../schemas/schema"; 

const router = express.Router();

router.get("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));

router.post("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));


module.exports = router;
import express from "express";
import GraphHTTP from "express-graphql";
import {PlayerModel} from "../models/player.model"; 
import {Schema} from "../schemas/schema"; 

const router = express.Router();

router.get("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));

router.post("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));

module.exports = router;
我完全被这个错误迷住了。我不知道这是怎么发生的,因为我想我正在给每个模块打电话。那么,我做错了什么

当我打电话给你时,我得到了这个:

我做错了什么

编辑一:

我已经在chrome控制台中检查过,当我加载页面时,我得到以下信息:

摩根模块在控制台里对我说

GET /graphiql 200 0.886 ms - 3868
POST /graphiql? 404 0.664 ms - 148
POST /graphiql? 404 2.034 ms - 148

为什么在我请求页面时找到了/graphiql,但在POST中找不到它?我什么都不懂:(

看起来不错。但是深入了解基本知识可能有助于解决问题。

看起来不错。但深入了解基本知识可能有助于解决问题。

我找到了解决方案!!!我已经在graphql.routes.js文件中添加了router.post函数,它可以正常工作

graphql.routes.js

import express from "express";
import morgan from "morgan";
import config from "./config";

const app = express();

//Settings

//Middleware
app.use(morgan("dev"));
app.use(express.json());

//Routes
app.use(require("./routes/graphql.routes"));

//Starting server
app.listen(process.env.PORT || config.server.port, () => {
    console.log(config.server.name + " is listening on port " + config.server.port);
})
import express from "express";
import GraphHTTP from "express-graphql";
import {PlayerModel} from "../models/player.model"; 
import {Schema} from "../schemas/schema"; 

const router = express.Router();

router.get("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));

module.exports = router;
import {DB} from "../db";
import Sequelize from "sequelize";
const PlayerModel = DB.db.define("tbl003_player", {
        id: {
            type: Sequelize.INTEGER,
            primaryKey: true,
            autoIncrement: true,
            notNull: true
        },
        name: {
            type: Sequelize.STRING,
            notNull: true,
            notEmpty: true
        },
        name_url: {
            type: Sequelize.STRING,
            notNull: true,
            notEmpty: true
        },
        language: {
            type: Sequelize.STRING,
            notNull: true,
            notEmpty: true,
            isIn: {
                args: [["sp", "en"]],
                msg: "Must be 'sp' or 'en'",
            }
        },
        twitter: {
            type: Sequelize.STRING,
            notEmpty: false
        },
        height: {
            type: Sequelize.FLOAT,
            isDecimal: true,
            notEmpty: false
        },
        date_insert: {
            type: Sequelize.DATE,
            notNull: true,
        }
    },{
        getterMethods: {
            getID(){
                return this.id
            },
            getName(){
                return this.name
            },
            getNameURL(){
                return this.name_url
            },
            getLanguage(){
                return this.language
            },
            getTwitter(){
                return this.twitter
            },
            getHeight(){
                return this.height
            },
            getDateInsert(){
                return this.date_insert
            }
        },
        setterMethods: {
            setName(value){
                this.setDataValue("name", value);
            },
            setNameURL(value){
                this.setDataValue("name_url", value);
            },
            setLanguage(value){
                this.setDataValue("language", value);
            },
            setTwitter(value){
                this.setDataValue("twitter", value);
            },
            setHeight(value){
                this.setDataValue("height", value);
            },
            setDataInsert(){
                let date = new Date("now");
                this.setDataValue("date_insert", date);
            }
        }     
    }
);

module.exports.PlayerModel = PlayerModel;
import {
    GraphQLObjectType,
    GraphQLNonNull,
    GraphQLID,
    GraphQLString,
    GraphQLFloat,
    GraphQLList
} from "graphql";
import {DateTime} from "../scalar/dateTime";


const Player = new GraphQLObjectType({
    name: "Player",
    description: "Player of basketball",
    fields: () => {
        return {
            id: {
                type: new GraphQLNonNull(GraphQLID),
                resolve(player){
                    return player.id
                }
            },
            name: {
                type: new GraphQLNonNull(GraphQLString),
                resolve(player){
                    return player.name
                } 
            },
            name_url: {
                type: new GraphQLNonNull(GraphQLString),
                resolve(player){
                    return player.name_url
                }
            },
            language: {
                type: new GraphQLNonNull(GraphQLString),
                resolve(player){
                    return player.language
                }
            },
            twitter: {
                type: GraphQLString,
                resolve(player){
                    return player.twitter
                }
            },
            height: {
                type: GraphQLFloat,
                resolve(player){
                    return player.height
                }
            },
            date_insert: {
                type: new GraphQLNonNull(DateTime),
                resolve(player){
                    return player.date_insert
                }
            }
        }
    }
});

module.exports.Player = Player;
import {
    GraphQLObjectType,
    GraphQLNonNull,
    GraphQLID,
    GraphQLInt,
    GraphQLString,
    GraphQLFloat,
    GraphQLList,
    GraphQLSchema
} from "graphql";
import { DB } from "../db";
import {Player} from "./player.schema";

const Query = new GraphQLObjectType({
    name: "Query",
    description: "This is root query",
    fields: () => {
        return {
            players: {
                type: GraphQLList(Player),
                args: {
                    id: {
                        type: GraphQLID
                    }
                },
                resolve(root, args){
                    return DB.db.models.tbl003_player.findAll({where: args});
                }
            },
        }
    }
});

const Schema = new GraphQLSchema({
    query: Query
});

module.exports.Schema = Schema;
import express from "express";
import GraphHTTP from "express-graphql";
import {PlayerModel} from "../models/player.model"; 
import {Schema} from "../schemas/schema"; 

const router = express.Router();

router.get("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));

router.post("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));


module.exports = router;
import express from "express";
import GraphHTTP from "express-graphql";
import {PlayerModel} from "../models/player.model"; 
import {Schema} from "../schemas/schema"; 

const router = express.Router();

router.get("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));

router.post("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));

module.exports = router;

我已经找到了解决方案!!!我已经将router.post函数添加到我的graphql.routes.js文件中,它可以正常工作

graphql.routes.js

import express from "express";
import morgan from "morgan";
import config from "./config";

const app = express();

//Settings

//Middleware
app.use(morgan("dev"));
app.use(express.json());

//Routes
app.use(require("./routes/graphql.routes"));

//Starting server
app.listen(process.env.PORT || config.server.port, () => {
    console.log(config.server.name + " is listening on port " + config.server.port);
})
import express from "express";
import GraphHTTP from "express-graphql";
import {PlayerModel} from "../models/player.model"; 
import {Schema} from "../schemas/schema"; 

const router = express.Router();

router.get("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));

module.exports = router;
import {DB} from "../db";
import Sequelize from "sequelize";
const PlayerModel = DB.db.define("tbl003_player", {
        id: {
            type: Sequelize.INTEGER,
            primaryKey: true,
            autoIncrement: true,
            notNull: true
        },
        name: {
            type: Sequelize.STRING,
            notNull: true,
            notEmpty: true
        },
        name_url: {
            type: Sequelize.STRING,
            notNull: true,
            notEmpty: true
        },
        language: {
            type: Sequelize.STRING,
            notNull: true,
            notEmpty: true,
            isIn: {
                args: [["sp", "en"]],
                msg: "Must be 'sp' or 'en'",
            }
        },
        twitter: {
            type: Sequelize.STRING,
            notEmpty: false
        },
        height: {
            type: Sequelize.FLOAT,
            isDecimal: true,
            notEmpty: false
        },
        date_insert: {
            type: Sequelize.DATE,
            notNull: true,
        }
    },{
        getterMethods: {
            getID(){
                return this.id
            },
            getName(){
                return this.name
            },
            getNameURL(){
                return this.name_url
            },
            getLanguage(){
                return this.language
            },
            getTwitter(){
                return this.twitter
            },
            getHeight(){
                return this.height
            },
            getDateInsert(){
                return this.date_insert
            }
        },
        setterMethods: {
            setName(value){
                this.setDataValue("name", value);
            },
            setNameURL(value){
                this.setDataValue("name_url", value);
            },
            setLanguage(value){
                this.setDataValue("language", value);
            },
            setTwitter(value){
                this.setDataValue("twitter", value);
            },
            setHeight(value){
                this.setDataValue("height", value);
            },
            setDataInsert(){
                let date = new Date("now");
                this.setDataValue("date_insert", date);
            }
        }     
    }
);

module.exports.PlayerModel = PlayerModel;
import {
    GraphQLObjectType,
    GraphQLNonNull,
    GraphQLID,
    GraphQLString,
    GraphQLFloat,
    GraphQLList
} from "graphql";
import {DateTime} from "../scalar/dateTime";


const Player = new GraphQLObjectType({
    name: "Player",
    description: "Player of basketball",
    fields: () => {
        return {
            id: {
                type: new GraphQLNonNull(GraphQLID),
                resolve(player){
                    return player.id
                }
            },
            name: {
                type: new GraphQLNonNull(GraphQLString),
                resolve(player){
                    return player.name
                } 
            },
            name_url: {
                type: new GraphQLNonNull(GraphQLString),
                resolve(player){
                    return player.name_url
                }
            },
            language: {
                type: new GraphQLNonNull(GraphQLString),
                resolve(player){
                    return player.language
                }
            },
            twitter: {
                type: GraphQLString,
                resolve(player){
                    return player.twitter
                }
            },
            height: {
                type: GraphQLFloat,
                resolve(player){
                    return player.height
                }
            },
            date_insert: {
                type: new GraphQLNonNull(DateTime),
                resolve(player){
                    return player.date_insert
                }
            }
        }
    }
});

module.exports.Player = Player;
import {
    GraphQLObjectType,
    GraphQLNonNull,
    GraphQLID,
    GraphQLInt,
    GraphQLString,
    GraphQLFloat,
    GraphQLList,
    GraphQLSchema
} from "graphql";
import { DB } from "../db";
import {Player} from "./player.schema";

const Query = new GraphQLObjectType({
    name: "Query",
    description: "This is root query",
    fields: () => {
        return {
            players: {
                type: GraphQLList(Player),
                args: {
                    id: {
                        type: GraphQLID
                    }
                },
                resolve(root, args){
                    return DB.db.models.tbl003_player.findAll({where: args});
                }
            },
        }
    }
});

const Schema = new GraphQLSchema({
    query: Query
});

module.exports.Schema = Schema;
import express from "express";
import GraphHTTP from "express-graphql";
import {PlayerModel} from "../models/player.model"; 
import {Schema} from "../schemas/schema"; 

const router = express.Router();

router.get("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));

router.post("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));


module.exports = router;
import express from "express";
import GraphHTTP from "express-graphql";
import {PlayerModel} from "../models/player.model"; 
import {Schema} from "../schemas/schema"; 

const router = express.Router();

router.get("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));

router.post("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));

module.exports = router;

我知道这个问题已经很老了,但仔细看,我建议您更换这个:

graphql.routes.js

import express from "express";
import morgan from "morgan";
import config from "./config";

const app = express();

//Settings

//Middleware
app.use(morgan("dev"));
app.use(express.json());

//Routes
app.use(require("./routes/graphql.routes"));

//Starting server
app.listen(process.env.PORT || config.server.port, () => {
    console.log(config.server.name + " is listening on port " + config.server.port);
})
import express from "express";
import GraphHTTP from "express-graphql";
import {PlayerModel} from "../models/player.model"; 
import {Schema} from "../schemas/schema"; 

const router = express.Router();

router.get("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));

module.exports = router;
import {DB} from "../db";
import Sequelize from "sequelize";
const PlayerModel = DB.db.define("tbl003_player", {
        id: {
            type: Sequelize.INTEGER,
            primaryKey: true,
            autoIncrement: true,
            notNull: true
        },
        name: {
            type: Sequelize.STRING,
            notNull: true,
            notEmpty: true
        },
        name_url: {
            type: Sequelize.STRING,
            notNull: true,
            notEmpty: true
        },
        language: {
            type: Sequelize.STRING,
            notNull: true,
            notEmpty: true,
            isIn: {
                args: [["sp", "en"]],
                msg: "Must be 'sp' or 'en'",
            }
        },
        twitter: {
            type: Sequelize.STRING,
            notEmpty: false
        },
        height: {
            type: Sequelize.FLOAT,
            isDecimal: true,
            notEmpty: false
        },
        date_insert: {
            type: Sequelize.DATE,
            notNull: true,
        }
    },{
        getterMethods: {
            getID(){
                return this.id
            },
            getName(){
                return this.name
            },
            getNameURL(){
                return this.name_url
            },
            getLanguage(){
                return this.language
            },
            getTwitter(){
                return this.twitter
            },
            getHeight(){
                return this.height
            },
            getDateInsert(){
                return this.date_insert
            }
        },
        setterMethods: {
            setName(value){
                this.setDataValue("name", value);
            },
            setNameURL(value){
                this.setDataValue("name_url", value);
            },
            setLanguage(value){
                this.setDataValue("language", value);
            },
            setTwitter(value){
                this.setDataValue("twitter", value);
            },
            setHeight(value){
                this.setDataValue("height", value);
            },
            setDataInsert(){
                let date = new Date("now");
                this.setDataValue("date_insert", date);
            }
        }     
    }
);

module.exports.PlayerModel = PlayerModel;
import {
    GraphQLObjectType,
    GraphQLNonNull,
    GraphQLID,
    GraphQLString,
    GraphQLFloat,
    GraphQLList
} from "graphql";
import {DateTime} from "../scalar/dateTime";


const Player = new GraphQLObjectType({
    name: "Player",
    description: "Player of basketball",
    fields: () => {
        return {
            id: {
                type: new GraphQLNonNull(GraphQLID),
                resolve(player){
                    return player.id
                }
            },
            name: {
                type: new GraphQLNonNull(GraphQLString),
                resolve(player){
                    return player.name
                } 
            },
            name_url: {
                type: new GraphQLNonNull(GraphQLString),
                resolve(player){
                    return player.name_url
                }
            },
            language: {
                type: new GraphQLNonNull(GraphQLString),
                resolve(player){
                    return player.language
                }
            },
            twitter: {
                type: GraphQLString,
                resolve(player){
                    return player.twitter
                }
            },
            height: {
                type: GraphQLFloat,
                resolve(player){
                    return player.height
                }
            },
            date_insert: {
                type: new GraphQLNonNull(DateTime),
                resolve(player){
                    return player.date_insert
                }
            }
        }
    }
});

module.exports.Player = Player;
import {
    GraphQLObjectType,
    GraphQLNonNull,
    GraphQLID,
    GraphQLInt,
    GraphQLString,
    GraphQLFloat,
    GraphQLList,
    GraphQLSchema
} from "graphql";
import { DB } from "../db";
import {Player} from "./player.schema";

const Query = new GraphQLObjectType({
    name: "Query",
    description: "This is root query",
    fields: () => {
        return {
            players: {
                type: GraphQLList(Player),
                args: {
                    id: {
                        type: GraphQLID
                    }
                },
                resolve(root, args){
                    return DB.db.models.tbl003_player.findAll({where: args});
                }
            },
        }
    }
});

const Schema = new GraphQLSchema({
    query: Query
});

module.exports.Schema = Schema;
import express from "express";
import GraphHTTP from "express-graphql";
import {PlayerModel} from "../models/player.model"; 
import {Schema} from "../schemas/schema"; 

const router = express.Router();

router.get("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));

router.post("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));


module.exports = router;
import express from "express";
import GraphHTTP from "express-graphql";
import {PlayerModel} from "../models/player.model"; 
import {Schema} from "../schemas/schema"; 

const router = express.Router();

router.get("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));

router.post("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));

module.exports = router;
为此:

import express from "express";
import GraphHTTP from "express-graphql";
import {PlayerModel} from "../models/player.model"; 
import {Schema} from "../schemas/schema"; 

const router = express.Router();

router.use("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));

module.exports = router;

我知道这个问题已经很老了,但仔细看,我建议您更换这个:

graphql.routes.js

import express from "express";
import morgan from "morgan";
import config from "./config";

const app = express();

//Settings

//Middleware
app.use(morgan("dev"));
app.use(express.json());

//Routes
app.use(require("./routes/graphql.routes"));

//Starting server
app.listen(process.env.PORT || config.server.port, () => {
    console.log(config.server.name + " is listening on port " + config.server.port);
})
import express from "express";
import GraphHTTP from "express-graphql";
import {PlayerModel} from "../models/player.model"; 
import {Schema} from "../schemas/schema"; 

const router = express.Router();

router.get("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));

module.exports = router;
import {DB} from "../db";
import Sequelize from "sequelize";
const PlayerModel = DB.db.define("tbl003_player", {
        id: {
            type: Sequelize.INTEGER,
            primaryKey: true,
            autoIncrement: true,
            notNull: true
        },
        name: {
            type: Sequelize.STRING,
            notNull: true,
            notEmpty: true
        },
        name_url: {
            type: Sequelize.STRING,
            notNull: true,
            notEmpty: true
        },
        language: {
            type: Sequelize.STRING,
            notNull: true,
            notEmpty: true,
            isIn: {
                args: [["sp", "en"]],
                msg: "Must be 'sp' or 'en'",
            }
        },
        twitter: {
            type: Sequelize.STRING,
            notEmpty: false
        },
        height: {
            type: Sequelize.FLOAT,
            isDecimal: true,
            notEmpty: false
        },
        date_insert: {
            type: Sequelize.DATE,
            notNull: true,
        }
    },{
        getterMethods: {
            getID(){
                return this.id
            },
            getName(){
                return this.name
            },
            getNameURL(){
                return this.name_url
            },
            getLanguage(){
                return this.language
            },
            getTwitter(){
                return this.twitter
            },
            getHeight(){
                return this.height
            },
            getDateInsert(){
                return this.date_insert
            }
        },
        setterMethods: {
            setName(value){
                this.setDataValue("name", value);
            },
            setNameURL(value){
                this.setDataValue("name_url", value);
            },
            setLanguage(value){
                this.setDataValue("language", value);
            },
            setTwitter(value){
                this.setDataValue("twitter", value);
            },
            setHeight(value){
                this.setDataValue("height", value);
            },
            setDataInsert(){
                let date = new Date("now");
                this.setDataValue("date_insert", date);
            }
        }     
    }
);

module.exports.PlayerModel = PlayerModel;
import {
    GraphQLObjectType,
    GraphQLNonNull,
    GraphQLID,
    GraphQLString,
    GraphQLFloat,
    GraphQLList
} from "graphql";
import {DateTime} from "../scalar/dateTime";


const Player = new GraphQLObjectType({
    name: "Player",
    description: "Player of basketball",
    fields: () => {
        return {
            id: {
                type: new GraphQLNonNull(GraphQLID),
                resolve(player){
                    return player.id
                }
            },
            name: {
                type: new GraphQLNonNull(GraphQLString),
                resolve(player){
                    return player.name
                } 
            },
            name_url: {
                type: new GraphQLNonNull(GraphQLString),
                resolve(player){
                    return player.name_url
                }
            },
            language: {
                type: new GraphQLNonNull(GraphQLString),
                resolve(player){
                    return player.language
                }
            },
            twitter: {
                type: GraphQLString,
                resolve(player){
                    return player.twitter
                }
            },
            height: {
                type: GraphQLFloat,
                resolve(player){
                    return player.height
                }
            },
            date_insert: {
                type: new GraphQLNonNull(DateTime),
                resolve(player){
                    return player.date_insert
                }
            }
        }
    }
});

module.exports.Player = Player;
import {
    GraphQLObjectType,
    GraphQLNonNull,
    GraphQLID,
    GraphQLInt,
    GraphQLString,
    GraphQLFloat,
    GraphQLList,
    GraphQLSchema
} from "graphql";
import { DB } from "../db";
import {Player} from "./player.schema";

const Query = new GraphQLObjectType({
    name: "Query",
    description: "This is root query",
    fields: () => {
        return {
            players: {
                type: GraphQLList(Player),
                args: {
                    id: {
                        type: GraphQLID
                    }
                },
                resolve(root, args){
                    return DB.db.models.tbl003_player.findAll({where: args});
                }
            },
        }
    }
});

const Schema = new GraphQLSchema({
    query: Query
});

module.exports.Schema = Schema;
import express from "express";
import GraphHTTP from "express-graphql";
import {PlayerModel} from "../models/player.model"; 
import {Schema} from "../schemas/schema"; 

const router = express.Router();

router.get("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));

router.post("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));


module.exports = router;
import express from "express";
import GraphHTTP from "express-graphql";
import {PlayerModel} from "../models/player.model"; 
import {Schema} from "../schemas/schema"; 

const router = express.Router();

router.get("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));

router.post("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));

module.exports = router;
为此:

import express from "express";
import GraphHTTP from "express-graphql";
import {PlayerModel} from "../models/player.model"; 
import {Schema} from "../schemas/schema"; 

const router = express.Router();

router.use("/graphiql", GraphHTTP({
    schema: Schema,
    pretty: true,
    graphiql: true
}));

module.exports = router;