-
Notifications
You must be signed in to change notification settings - Fork 7
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
Graphql when running gridsome develop
#11
Comments
Hi, so just to check are you able to query the `id` field? Just to check
that data actually comes in.
…On Tue, 31 Mar 2020, 07:53 Gianfrancø Palumbo, ***@***.***> wrote:
ERROR Failed to compile with 1 errors 06:46:55
error in ./src/pages/Index.vue?vue&type=custom&index=0&blockType=page-query
Module build failed (from ./node_modules/gridsome/lib/plugins/vue-components/lib/loaders/page-query.js):
Error: Cannot query field "name" on type "FireTopics".
GraphQL request:119:9
118 | id
119 | name
| ^
120 | image (width: 300, height: 200)
gridsome info
System:
OS: macOS 10.15.3
CPU: (4) x64 Intel(R) Core(TM) i5-7267U CPU @ 3.10GHz
Binaries:
Node: 13.11.0 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.13.7 - /usr/local/bin/npm
Browsers:
Chrome: 80.0.3987.149
Firefox: 74.0
Safari: 13.0.5
npmPackages:
gridsome: ^0.7.12 => 0.7.13
gridsome-plugin-tailwindcss: ^2.2.30 => 2.2.43
gridsome-source-firestore: ^1.1.12 => 1.1.12
I didn't change the gridsome.config.js file and I created the collections
on Firestore:
[image: Screenshot 2020-03-31 at 06 52 41]
<https://user-images.githubusercontent.com/899175/77991593-41e49780-731c-11ea-9f80-7d097ea21728.png>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#11>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABSVMWTWBVJFK2A7KNF423TRKGAM7ANCNFSM4LXID5BA>
.
|
yes. in that case works. I have remove all the other fields in all the templates as in the As soon as I add the
Same error in the GraphQL Playground http://localhost:8080/___explore: {
"error": {
"errors": [
{
"message": "Cannot query field \"name\" on type \"FireTopics\".",
"stringified": "Cannot query field \"name\" on type \"FireTopics\".\n\nGraphQL request:6:9\n5 | id\n6 | name\n | ^\n7 | }"
}
]
}
} for query Topics {
allFireTopics {
edges {
node {
id
name
# image (width: 300, height: 200)
# path
# posts: belongsTo {
# count: totalCount
# }
}
}
}
} |
What about the other fields, if you ignore name and try image, does that field work? |
okay.. i don't what the hell happened. but not the world is spinning the right way and it works 😂 cheers. for the troubleshooting & nice OSS library :) |
Actually it looks like it's related to the data on Firestore. Could you please provide an example of what fields (and its type) should each Document have for?
|
Authors Posts Tags Topics |
Have you been able to solve this? Can you close it if you did? |
Found the issue from above. The code doesn't handle an empty post collection. So if there are no posts found, it errors on pulling the records. Additionally, you need to have the status (String) field in the posts collection set to '1' to return the posts within the collection, as filtered within the gridsome.config.js. Grateful for the work @u12206050 - experimenting with incorporating gridsome and firebase on a new project. Appreciate the work on providing a template! |
I didn't change the
gridsome.config.js
file and I created the collections on Firestore:The text was updated successfully, but these errors were encountered: