expressでgraphqlサーバーを実行しようとしています。しかし、それは次のエラーをスローする。Express、ノードjs内のgraphqlのエラー
var graphqlHTTP = require('express-graphql'); // express graphql
var { buildSchema } = require('graphql'); // graphql
var schema=buildSchema(
type Query {
name:String});
var classifyRoot={
name:()=>{
classified.find({name:"shoes"},function(err,classified){
//res.render("card",{classifieds:classifieds});
return classified.name;
});
},};
app.use('/graphql', graphqlHTTP({
schema: schema,
rootValue: classifyRoot,
graphiql: true,
}));
、単にエラー –
こんにちは、返信いただきありがとうございますが、更新されたコード –
を見つけてくださいだから、どのラインが上のエラーであるからで動作するように何もない(back-ticksに注意してください) ?それはほぼ間違いなくちょうどどこかのタイプミスです –