Unable to start server with mocks
See original GitHub issueI am trying to start yoga server with mocks. Just copy-pasting example from the docs doesn’t work:
import { GraphQLServer, MockList } from 'graphql-yoga'
const typeDefs = `
type Query {
hello(name: String): String!
listOfStrings: [String]
}
`
const mocks = {
Query: () => ({
hello: () => 'Hello World',
listOfStrings: () => new MockList([2, 6]),
}),
}
const server = new GraphQLServer({ typeDefs, mocks })
server.start()
And got an Error: No schema defined, at /node_modules/graphql-yoga/src/index.ts
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:5
Top Results From Across the Web
mock server failing to start · Issue #2 · pact-foundation/grunt-pact
I've been trying to follow along with your progress, but I'm having trouble getting things to execute successfully with the latest master.
Read more >Running MockServer
To run MockServer in Kubernetes the easiest way is to use the existing MockServer helm chart. This is available by using www.mock-server.com as...
Read more >While running a MOCK API server in Node.js, getting an error ...
I am getting "CANNOT GET/" error message while running a MOCK API server opening my localhost on port 3000 via my browser ...
Read more >mockserver-node | Yarn - Package Manager
Node module and grunt plugin to start and stop MockServer and MockServer proxy. Build status Dependency Status devDependency Status.
Read more >Requests to my mock servers aren't returning the expected ...
The path URL is incorrect. Make sure the path in the request URL matches with one of the saved examples for the mock...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@checkmatez @merelinguist I dont know if there is bug or feature, but you have to pass at least empty resolvers.
Hey 👋, It seems like this issue has been inactive for some time. In need for maintaining clear overview of the issues concerning the latest version of
graphql-yoga
we’ll close it. Feel free to reopen it at any time if you believe we should futher discuss its content. 🙂