Getting error when first starting server in the tutorial
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript, node.js
Hướng nghiên cứu
Bắt đầu với schema.js và kiểm tra template literal gql bằng cách đối chiếu với các định nghĩa kiểu được hiển thị trong tutorial; sau đó kiểm tra index.js để xác nhận schema được tải như thế nào. Chạy server và xác minh rằng tutorial khởi động mà không có SyntaxError đã được báo cáo.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I'm sure it's something I'm doing wrong, but I've just started the tutorial and when I first try to start the server I get
type Launch {
^^^^^^SyntaxError: Unexpected identifier
at new Script (vm.js:74:7)
at createScript (vm.js:246:10)
at Object.runInThisContext (vm.js:298:10)
at Module._compile (internal/modules/cjs/loader.js:657:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:20:18)
[nodemon] app crashed - waiting for file changes before starting...
My schema.js file is
const { gql } = require('apollo-server');
const typeDefs = gql``
module.exports = typeDefs;
type Launch {
id: ID!
site: String
mission: Mission
rocket: Rocket
isBooked: Boolean!
}
type Rocket {
id: ID!
name: String
type: String
}
type User {
id: ID!
email: String!
trips: [Launch]!
}
type Mission {
name: String
missionPatch(size: PatchSize): String
}
enum PatchSize {
SMALL
LARGE
}
type Mutation {
# if false, booking trips failed -- check errors
bookTrips(launchIds: [ID]!): TripUpdateResponse!
# if false, cancellation failed -- check errors
cancelTrip(launchId: ID!): TripUpdateResponse!
login(email: String): String # login token
}
type Query {
launches: [Launch]!
launch(id: ID!): Launch
# Queries for the current user
me: User
}
and index.js is
const { ApolloServer } = require('apollo-server');
const typeDefs = require('./schema');
const server = new ApolloServer({ typeDefs });
server.listen().then(({ url }) => {
console.log(`🚀 Server ready at ${url}`);
});
Not sure where the error lies as I was simply copying code from the tutorial....thanks for any clues.
- Ngôn ngữ chính
- TypeScript
- Star
- 1.2k
- Fork
- 808
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apollographql/fullstack-tutorial
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
investigate
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
-
tutorial links are broken Đang mởdocumentation
apollographql/fullstack-tutorial#285 · 3 bình luận · 1 người được giao ·
-
investigate
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
apollographql/fullstack-tutorial#255 · 2 reaction ·
-
enhancement
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
apollographql/fullstack-tutorial#254 · 2 bình luận ·
Tất cả issue của apollographql/fullstack-tutorial
Issue tương tự
-
blocklist removal
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
MetaMask/eth-phishing-detect#296544 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
pastelsky/bundlephobia#1122 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
category/development priority/P2 scope/file-operations scope/testing type/enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Enatega Customer and Rider app: Add-ons price is not visible to customer after order is placed. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100