Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GraphQLServer Endpoint Option Doesn't Take #12

Closed
geirman opened this issue Nov 25, 2017 · 2 comments
Closed

GraphQLServer Endpoint Option Doesn't Take #12

geirman opened this issue Nov 25, 2017 · 2 comments

Comments

@geirman
Copy link

geirman commented Nov 25, 2017

Summary

When I pass in server options for endpoint, it doesn't seem to have any effect.

Code


const { GraphQLServer } = require('graphql-yoga')

const typeDefs = `
  type Query {
    hello(name: String): String!
  }
`

const resolvers = {
  Query: {
    hello: (_, { name }) => `Hello ${name || 'World'}`,
  },
}

const options = {
    port: 4000,
    endpoint: '/graphql',
}

const server = new GraphQLServer({ typeDefs, resolvers, options })
server.start(() => console.log(`Server is running on http://localhost:${options.port}${options.endpoint}`))

Expected Result

I expect to go to http://localhost:4000/graphql and see the playground

Actual Result

I get the playground at http://localhost:4000 (without the /graphql path)

@geirman
Copy link
Author

geirman commented Nov 25, 2017

Doh! Nevermind, I see the option is actually playgroundEndpoint. My bad!

@geirman geirman closed this as completed Nov 25, 2017
@Urigo
Copy link
Collaborator

Urigo commented Mar 29, 2022

Hey, @Urigo from The Guild here!

You might know us from projects such as graphql-code-generator, envelop or graphql-tools.

For a long time we thought that the Javascript ecosystem is still missing a lightweight cross-platform, but still highly customizable GraphQL Server.

In the past the awesome Prisma team took on that great challenge and now we are happy to announce that we are continuing them and just released GraphQL Yoga 2.0 - Build fast, extensible, and batteries-included (Subscriptions, Serverless, File uploads support) GraphQL APIs in Node.js 🚀

We have been working a long time on version 2.0 and have been using it in our clients projects for a few months now and shared a couple of alpha cycles here.
Thank you all for your feedback and suggestions, you made this release possible!

Please try Yoga out again, give us feedback and help us spread the word on the new release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants