Getting error when first starting server in the tutorial
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 1/5
- Tempo stimato
- Meno di un'ora
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- javascript, node.js
Direzione di ricerca
Inizia da schema.js e analizza il template literal gql confrontandolo con le definizioni dei tipi mostrate nel tutorial; poi controlla index.js per confermare come viene caricato lo schema. Avvia il server e verifica che il tutorial si avvii senza il SyntaxError segnalato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 1.2k
- Fork
- 808
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di apollographql/fullstack-tutorial
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
-
investigate
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
-
tutorial links are broken Apertadocumentation
apollographql/fullstack-tutorial#285 · 3 commenti · 1 assegnatario ·
-
investigate
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
apollographql/fullstack-tutorial#255 · 2 reazioni ·
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
apollographql/fullstack-tutorial#254 · 2 commenti ·
Tutte le issue di apollographql/fullstack-tutorial
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
vercel-labs/just-bash#464 ·
-
looksLikeSlug() is ASCII-only, so non-Latin entity slugs (e.g. Korean) skip exact match and collapse Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
TanStack/tanstack.com#1293 ·