Relative Content

Tag Archive for javascriptexpressgraphqlapolloapollo-server

Apollo GraphQL query building with Express Server REST API

I’m implementing a step-by-step Apollo Tutorial on my project. I created a REST API on my localhost with Express, and everything worked fine until this part. I have no problem with my first client query getting all stocks but I’m getting “undefined” on my second query with argument in the Express server console and “INTERNAL_SERVER_ERROR” and “stacktrace”: [“Error: Cannot return null for non-nullable field Stock.id…] in Apollo Explorer or Apollo Server.

I’m getting response without any problem when i access it through my browser (ex: …localhost:5000/stock/2).