Package Exports
- gatsby-source-appwrite
- gatsby-source-appwrite/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (gatsby-source-appwrite) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
gatsby-source-appwrite
![]() |
![]() |
Gatsby source plugin for building websites using Appwrite as a data source
How to install
npm install gatsby-source-appwrite node-appwriteAvailable 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": {}
}
