question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

API requests fail with: Invalid options provided to ApolloServer

See original GitHub issue

The last release seems to be broken. I was creating and starting my yoga server as follows:

const server = new GraphQLServer({
  typeDefs,
  resolvers,
  context: req => ({
    ...req,
    db: new Graphcool({
      schemaPath: './database/schema.graphql',
      endpoint: 'http://localhost:60000/api/database/dev',
      secret: 'mysecret123',
    }),
  }),
})
server.start(() => console.log('Server is running on http://localhost:4000'))

However, I was not able to access the API on http://localhost:4000, the Playground could not load the schema but failed with an internal server error and the message: Invalid options provided to ApolloServer:.

Rolling back to version 0.3.0 fixed the problem.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
kbrandwijkcommented, Dec 19, 2017

Fixed after all dependencies across all packages were updated to the same graphql version (0.12).

0reactions
Urigocommented, 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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

API requests fail with: Invalid options provided to ApolloServer
The last release seems to be broken. I was creating and starting my yoga server as follows: const server = new GraphQLServer({ typeDefs,...
Read more >
Error handling - Apollo GraphQL Docs
Apollo Server's variety of error codes enables requesting clients to respond ... The GraphQL operation includes an invalid value for a field argument....
Read more >
GraphQL | RedwoodJS Docs
GraphQL is a query language that enhances the exchange of data between clients (in Redwood's case, a React app) and servers (a Redwood...
Read more >
Apollo client: How to simply debug a 400 code error?
If you provide a link chain to ApolloClient, you don't provide the uri option. Here's what will be logged: [GraphQL error]: Message: Variable...
Read more >
Hygraph error codes
400, Bad request - Typically due to invalid query arguments. 401, Unauthorized - Usually no valid Permanent Auth Token was provided.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found