weird problem. my code is this ```const server = n...
# orm-help
y
weird problem. my code is this
Copy code
const server = new GraphQLServer({
    typeDefs: './src/schema.graphql',
    port: 8080,
    resolvers,
    context: {
        db: prisma,
    },
} as any)
. runs fine and I can get the playground up and running..... but on port 4000 NOT 8080. I have tried other ports but no cigar. I found this old issue https://github.com/prisma/graphql-yoga/issues/281
j
Might want to check your docker-compose
y
good advice. I have done axectly that running only prisma and mysql from docker compose and running yoga locally (ts-node src/index.ts) to ensure that it is not a port being remapped. Is it possible that docker has not teared down an old mapping ? hmmm i check
j
looking at our config, i see that out ports are defined in the docker-compose, not the index.ts
and also, there are two endpoints, prisma, and graphql, maybe they got confused?
y
how/where do you see my config?
j
places to look: .env files, docker-compose.yml
y
arhh. sorry I misread your comment. I have hardcoded all ports into index.ts. docker-compose only maps container ports to host ports. Therefore I do not run the yoga in a container while debugging this problem
j
.graphqlconfig.yml too
y
yeah. endpoint is defined there too but i have hardcoded it there as well
j
not sure then, maybe you need to restart the docker containers so that it picks up the new port
y
i restarted my computer. no cigar
j
that might not do it, docker might just 'suspend' the images, instead of restarting them
do a
docker ps
, then
docker kill <container name>
then in the same directory as your docker-compose file, run
docker-compose up -d
that's a good hard reset
y
no luck
z
Try to use a tool like Kitematic, it should help you with the docker containers.
j
maybe embrace port 4000
it seems to like being there
y
well I run linux. 🙂 I am not so sure that this is a docker thing.
j
Copy code
const options = {
  port: 8000,
  endpoint: '/graphql',
  subscriptions: '/subscriptions',
  playground: '/playground',
}

server.start(options, ({ port }) =>
  console.log(
    `Server started, listening on port ${port} for incoming requests.`,
  ),
)
The port is supposed to be passed into the
server.start
not passed into the
new GraphQLServer
y
Thanks Jared. You are right. Really stupid of me. My memory must have tricked me somehow, i thought that it was working at some stage 🙂 Perhaps GraphQLServer should throw an error or a warning when unknown args are passed.