You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error Cannot query field "allGuestbook" on type "Query"
This is the config:
{
resolve: `gatsby-source-faunadb`,
options: {
// The secret for the key you're using to connect to your Fauna database.
// You can generate on of these in the "Security" tab of your Fauna Console.
secret: "***",
// The name of the index you want to query
// You can create an index in the "Indexes" tab of your Fauna Console.
index: `guestbook-entries`,
// If your index requires arguments, you can specify them like this.
// You can omit this property if your index doesn't need any.
// arguments: ["bird"],
// This is the name under which your data will appear in Gatsby GraphQL queries
// The following will create queries called `allGuestbook` and `guestbook`.
type: "guestbook",
// If you need to limit the number of documents returned, you can specify a
// maximum number to read.
size: 100
},
The text was updated successfully, but these errors were encountered:
I just stumbled across the same error. For me it was because I was trying to query an empty index.
At that point Gatsby won't be able to infer the types and wont create a node in the schema for you.
To resolve the issue I think you can add the schema into gatsby-node.js:
exports.createSchemaCustomization = ({ actions }) => {
const { createTypes } = actions;
// Avoid build errors if no notifications exist
createTypes(`
type allFaunaNotification implements Node {
id: ID
message: String
nodes: String
}
`)
createTypes(`
type faunaNotification implements Node {
id: ID
message: String
}
`)
}
After following the instructions I get this:
This is the config:
The text was updated successfully, but these errors were encountered: