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.

Tutorial Part Four - 'Multiple "root" queries found'

See original GitHub issue

Description

I was following along the fourth tutorial on the GatsbyJs site where I was querying data via GraphQL. My code was copied from the snippets provided in that section.

Steps to reproduce

Here’s my repo: https://github.com/davidbowes818/gatsby-four

When I run npm start I get the following on my localhost:
image

Expected result

The tutorial screenshots show the results from the GraphQL query being output to the page.

Actual result

There’s a compiler error stating that multiple root queries are found.

I have a static query defined in my Layout component (layout.js) and a query in my About page (pages/about.js) that are both attempting to render the site metadata’s title.

Environment

System: OS: Windows 10 10.0.18362 CPU: (4) x64 Intel® Core™ i5-2500K CPU @ 3.30GHz Binaries: Node: 12.10.0 - C:\Program Files\nodejs\node.EXE npm: 6.10.3 - C:\Program Files\nodejs\npm.CMD Browsers: Edge: 44.18362.449.0 npmPackages: gatsby: ^2.19.45 => 2.19.45 gatsby-plugin-emotion: ^4.2.1 => 4.2.1 gatsby-plugin-typography: ^2.4.1 => 2.4.1 gatsby-source-filesystem: ^2.2.2 => 2.2.2

Issue Analytics

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

github_iconTop GitHub Comments

5reactions
Js-Brechtcommented, Apr 3, 2020

You’re welcome.

Case sensitivity can definitely be an issue sometimes. I normally see it when somebody is moving from Windows to Linux, like when they deploy to something like Netlify (that’s generally because something in their code has the wrong case, which is a bit harder to catch). I guess it’s just one of the perils of working cross-platform 🙂 .

I’ll go ahead and close this as resolved. Feel free to comment again if you have more questions!

4reactions
Js-Brechtcommented, Apr 3, 2020

Can you also verify that the case of every segment in your current path matches the real case on the disk?

For example, if C:\Projects\tutorial-part-four\src\pages\my-files.js is actually C:\projects\tutorial-part-four\src\pages\my-files.js (see the different in projects), then Gatsby will have a problem with it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Multiple queries error in Gatsby "Multiple "root" queries found"
The solution is to query for all the data you need in a single query rather than splitting it across multiple, as the...
Read more >
ERROR #85910 GraphQL - Multiple "root" queries found
Hi, I'm new here. I've been running through the Gatsby.js tutorials and towards the end of tutorial part four I keep getting this...
Read more >
GraphQL Tutorial #15 - More on Root Queries - YouTube
DONATE :) - https://www.paypal.me/thenetninja----- COURSE LINKS:+ Course files - https://github.com/iamshaunjp/graphql-playlist+ Atom editor ...
Read more >
Resolvers - Apollo GraphQL Docs
We want to define resolvers for the numberSix and numberSeven fields of the root Query type so that they always return 6 and...
Read more >
Express Tutorial Part 4: Routes and controllers - MDN Web Docs
In this tutorial we'll set up routes (URL handling code) with "dummy" handler ... The two routes defined in our wiki route module...
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