Community Plugin
View plugin on GitHubgatsby-source-appwrite
Gatsby source plugin for building websites using Appwrite as a data source
How to install
npm install gatsby-source-appwrite node-appwrite
Available options
appwriteEndpoint
- the url of your endpointappwriteProject
- appwrite project idappwriteApiKey
- api key of your appwrite project, with correct access rights
Examples of usage
// gatsby-config.js
module.exports = {
plugins: [
{
resolve: `gatsby-source-appwrite`,
options: {
appwriteEndpoint: "http://localhost/v1",
appwriteProject: "my-project",
appwriteApiKey: "my-api-key",
types: [
{
type: "Todo",
query: (databases) => databases.listDocuments("my-database-id", "my-collection-id"),
},
],
types: [
{
type: "Movies",
query: (databases) =>
databases.listDocuments("my-database-id", "my-collection-id", [
Query.equal("title", "Avatar"),
]),
},
],
},
},
],
};
How to query for data
query MyQuery {
appwriteTodo {
id
databaseId
name
}
}
Will result with:
{
"data": {
"appwriteTodo": {
"id": "4fb16cb4-916f-5bca-baee-e7763936d272",
"databaseId": "6359a5cdc905610fb81e",
"name": "Hey Hey"
}
},
"extensions": {}
}