Skip to content

Commit

Permalink
Merge pull request #13 from appwrite/feat-sdks-and-protocols-docs
Browse files Browse the repository at this point in the history
Feat sdks and protocols docs
  • Loading branch information
Vincent (Wen Yu) Ge authored Sep 17, 2023
2 parents b685485 + ca17379 commit c57cc2b
Show file tree
Hide file tree
Showing 24 changed files with 269 additions and 59 deletions.
4 changes: 2 additions & 2 deletions src/routes/docs/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
const isTutorial = pathname.includes('/tutorials/');
const isProduct = pathname.includes('/products/') || pathname.includes('/article');
const isTooling = pathname.includes('/tooling');
const isAdvanced = pathname.includes('/advanced/');
const isSelfHosting = pathname.includes('/self-hosting');
const isReference = pathname.includes('/reference');
if (isTutorial || isProduct || isAPIs || isSDKs || isQuickStarts || isTooling || isAdvanced) {
if (isTutorial || isProduct || isAPIs || isSDKs || isQuickStarts || isTooling || isSelfHosting) {
return 'two-side-navs';
} else if (isReference) {
return 'expanded';
Expand Down
6 changes: 3 additions & 3 deletions src/routes/docs/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@
<ul class="aw-grid-row-4">
<li>
<div class="aw-card is-full-color">
<h4 class="aw-sub-body-500 u-margin-block-start-8">Self-hosted</h4>
<h4 class="aw-sub-body-500 u-margin-block-start-8">Self hosted</h4>
<p class="aw-sub-body-400 u-margin-block-start-4">
Lorem ipsum dolor sit amet consectetur.
</p>
Expand All @@ -473,15 +473,15 @@
</li>
<li>
<div class="aw-card is-full-color">
<h4 class="aw-sub-body-500 u-margin-block-start-8">Superbase</h4>
<h4 class="aw-sub-body-500 u-margin-block-start-8">Supabase</h4>
<p class="aw-sub-body-400 u-margin-block-start-4">
Lorem ipsum dolor sit amet consectetur.
</p>
</div>
</li>
<li>
<div class="aw-card is-full-color">
<h4 class="aw-sub-body-500 u-margin-block-start-8">NHost</h4>
<h4 class="aw-sub-body-500 u-margin-block-start-8">Nhost</h4>
<p class="aw-sub-body-400 u-margin-block-start-4">
Lorem ipsum dolor sit amet consectetur.
</p>
Expand Down
24 changes: 12 additions & 12 deletions src/routes/docs/Sidebar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@
href: '/docs/products/migrations/supabase'
},
{
label: 'From NHost',
label: 'From Nhost',
href: '/docs/products/migrations/nhost'
},
{
Expand All @@ -328,44 +328,44 @@
},
{
label: 'Self-hosting',
href: '/docs/advanced/self-hosting',
href: '/docs/self-hosting',
icon: 'icon-server',
items: [
{
label: 'Install',
href: '/docs/advanced/self-hosting/install'
href: '/docs/self-hosting/install'
},
{
label: 'Email delivery',
href: '/docs/advanced/self-hosting/email'
href: '/docs/self-hosting/email'
},
{
label: 'SMS delivery',
href: '/docs/advanced/self-hosting/sms'
href: '/docs/self-hosting/sms'
},
{
label: 'Functions',
href: '/docs/advanced/self-hosting/functions'
href: '/docs/self-hosting/functions'
},
{
label: 'Storage',
href: '/docs/advanced/self-hosting/storage'
href: '/docs/self-hosting/storage'
},
{
label: 'TLS certificates',
href: '/docs/advanced/self-hosting/certificates'
label: 'TLS Certificates',
href: '/docs/self-hosting/tls-certificates'
},
{
label: 'Update',
href: '/docs/advanced/self-hosting/update'
href: '/docs/self-hosting/update'
},
{
label: 'Debug',
href: '/docs/advanced/self-hosting/debug'
href: '/docs/self-hosting/debug'
},
{
label: 'Production',
href: '/docs/advanced/self-hosting/production'
href: '/docs/self-hosting/production'
},
]
}
Expand Down
30 changes: 30 additions & 0 deletions src/routes/docs/apis/graphql/+page.markdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
layout: article
title: GraphQL
description:
difficulty: beginner
readtime: 10
---

Appwrite supports multiple protocols for accessing the server, including [REST](/docs/apis/rest), [GraphQL](/docs/apis/graphql), and [Realtime](/docs/apis/realtime). The GraphQL API allows you to query and mutate any resource type on your Appwrite server through the endpoint `/v1/graphql`. Every endpoint available through REST is available through GraphQL, except for OAuth.

{% info title="GraphQL Model Parameters" %}
In Appwrite's GraphQL API, all internal model parameters are prefixed with `_` instead of `$` because `$` is reserved by GraphQL.
{% /info %}

## Requests {% #requests %}
Although every query executes through the same endpoint, there are multiple ways to make a GraphQL request. All requests, however, share a common structure.

Name Type Description
query required string The GraphQL query to execute.
operationName optional string If the query contains several named operations, controls which one to execute.
variables optional object An object containing variable names and values for the query. Variables are made available to your query with the $ prefix.


For example, `$collectionId` in the REST API would be referenced as `_collectionId` in the GraphQL API.

### GET
You can execute a GraphQL query via a GET request, passing a query and optionally operationName and variables as query parameters.

### POST
There are multiple ways to make a GraphQL POST request, differentiated by content type.
Loading

0 comments on commit c57cc2b

Please sign in to comment.