Я следую инструкциям по GraphQL, в которых я настраиваю простой сервер GraphQL.
index.js
const { GraphQLServer } = require('graphql-yoga');
// 1
let links = [{
id: 'link-0',
url: 'www.howtographql.com',
description: 'Fullstack tutorial for GraphQL'
}];
const resolvers = {
Query: {
info: () => `This is the API of a Hackernews Clone`,
// 2
feed: () => links,
},
// 3
Link: {
id: (parent) => parent.id,
description: (parent) => parent.description,
url: (parent) => parent.url,
}
};
// 3
const server = new GraphQLServer({
typeDefs:'./schema.graphql',
resolvers,
});
server.start(() => console.log(`Server is running on http://localhost:4000`));
Как видите,Я ссылаюсь на мой файл схемы при создании GraphQLServer.Однако при запуске сервера появляется следующая ошибка:
/Users/BorisGrunwald/Desktop/programmering/Javascript/GraphQL/hackernews-node/node_modules/graphql-yoga/dist/index.js:418
throw new Error("No schema found for path: " + schemaPath);
^
Моя файловая структура:

Можеткто-нибудь заметит ошибку?