Skip to content
This repository was archived by the owner on Sep 29, 2023. It is now read-only.

Commit 71a9c57

Browse files
authored
Merge pull request #287 from appwrite/feat-graphql
Feat graphql
2 parents 0cca9dd + 872f232 commit 71a9c57

File tree

10 files changed

+1337
-135
lines changed

10 files changed

+1337
-135
lines changed

app/views/docs/authentication.phtml

Lines changed: 192 additions & 104 deletions
Large diffs are not rendered by default.

app/views/docs/databases.phtml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,27 @@ func main() async throws {
200200
} catch {
201201
print(error.localizedDescription)
202202
}
203+
}</code></pre>
204+
</div>
205+
</li>
206+
<li>
207+
<h3>GraphQL</h3>
208+
<div class="ide" data-lang="graphql" data-lang-label="GraphQL">
209+
<pre class="line-numbers"><code class="prism language-graphql" data-prism>mutation {
210+
databasesCreateDocument(
211+
databaseId: "[DATABASE_ID]",
212+
collectionId: "[COLLECTION_ID]",
213+
documentId: "[DOCUMENT_ID]",
214+
data: "{}"
215+
) {
216+
id
217+
collectionId
218+
databaseId
219+
createdAt
220+
updatedAt
221+
permissions
222+
data
223+
}
203224
}</code></pre>
204225
</div>
205226
</li>
@@ -322,6 +343,24 @@ func main() async throws{
322343
} catch {
323344
print(error.localizedDescription)
324345
}
346+
}</code></pre>
347+
</div>
348+
</li>
349+
<li>
350+
<h3>GraphQL</h3>
351+
<div class="ide" data-lang="graphql" data-lang-label="GraphQL">
352+
<pre class="line-numbers"><code class="prism language-graphql" data-prism>query {
353+
databasesListDocuments(
354+
databaseId: "[DATABASE_ID]",
355+
collectionId: "[COLLECTION_ID]"
356+
queries: ["equal(\"title\", [\"Avatar\"])"]
357+
) {
358+
total
359+
documents {
360+
id
361+
data
362+
}
363+
}
325364
}</code></pre>
326365
</div>
327366
</li>
@@ -509,6 +548,24 @@ func main() async throws {
509548
} catch {
510549
print(error.localizedDescription)
511550
}
551+
}</code></pre>
552+
</div>
553+
</li>
554+
<li>
555+
<h3>GraphQL</h3>
556+
<div class="ide" data-lang="graphql" data-lang-label="GraphQL">
557+
<pre class="line-numbers"><code class="prism language-graphql" data-prism>query {
558+
databasesListDocuments(
559+
databaseId: "[DATABASE_ID]",
560+
collectionId: "[COLLECTION_ID]"
561+
queries: ["equal(\"title\", [\"Avatar\", \"Lord of the Rings\"])", "greaterThan(\"year\", 1999)"]
562+
) {
563+
total
564+
documents {
565+
id
566+
data
567+
}
568+
}
512569
}</code></pre>
513570
</div>
514571
</li>
@@ -651,6 +708,24 @@ func main() async throws {
651708
} catch {
652709
print(error.localizedDescription)
653710
}
711+
}</code></pre>
712+
</div>
713+
</li>
714+
<li>
715+
<h3>GraphQL</h3>
716+
<div class="ide" data-lang="graphql" data-lang-label="GraphQL">
717+
<pre class="line-numbers"><code class="prism language-graphql" data-prism>query {
718+
databasesListDocuments(
719+
databaseId: "[DATABASE_ID]",
720+
collectionId: "[COLLECTION_ID]"
721+
queries: ["orderAsc(\"title\")"]
722+
) {
723+
total
724+
documents {
725+
id
726+
data
727+
}
728+
}
654729
}</code></pre>
655730
</div>
656731
</li>
@@ -760,6 +835,24 @@ func main() async throws {
760835
} catch {
761836
print(error.localizedDescription)
762837
}
838+
}</code></pre>
839+
</div>
840+
</li>
841+
<li>
842+
<h3>GraphQL</h3>
843+
<div class="ide" data-lang="graphql" data-lang-label="GraphQL">
844+
<pre class="line-numbers"><code class="prism language-graphql" data-prism>query {
845+
databasesListDocuments(
846+
databaseId: "[DATABASE_ID]",
847+
collectionId: "[COLLECTION_ID]"
848+
queries: ["orderAsc(\"title\")", "orderDesc(\"year\")"]
849+
) {
850+
total
851+
documents {
852+
id
853+
data
854+
}
855+
}
763856
}</code></pre>
764857
</div>
765858
</li>

app/views/docs/functions.phtml

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,26 @@ void main() async {
574574
final execution = await functions.createExecution(
575575
functionId: '[FUNCTION_ID]'
576576
);
577+
}</code></pre>
578+
</div>
579+
</li>
580+
<li>
581+
<h3>Android</h3>
582+
583+
<div class="ide margin-bottom" data-lang="kotlin" data-lang-label="Android SDK">
584+
<pre class="line-numbers"><code class="prism language-kotlin" data-prism>import io.appwrite.Client
585+
import io.appwrite.services.Functions
586+
587+
suspend fun main() {
588+
val client = Client(applicationContext)
589+
.setEndpoint("https://[HOSTNAME_OR_IP]/v1")
590+
.setProject("[PROJECT_ID]")
591+
592+
val functions = Functions(client)
593+
594+
val execution = functions.createExecution(
595+
functionId = "[FUNCTION_ID]"
596+
)
577597
}</code></pre>
578598
</div>
579599
</li>
@@ -597,22 +617,18 @@ func main() async throws {
597617
</div>
598618
</li>
599619
<li>
600-
<h3>Android</h3>
601-
602-
<div class="ide margin-bottom" data-lang="kotlin" data-lang-label="Android SDK">
603-
<pre class="line-numbers"><code class="prism language-kotlin" data-prism>import io.appwrite.Client
604-
import io.appwrite.services.Functions
605-
606-
suspend fun main() {
607-
val client = Client(applicationContext)
608-
.setEndpoint("https://[HOSTNAME_OR_IP]/v1")
609-
.setProject("[PROJECT_ID]")
610-
611-
val functions = Functions(client)
612-
613-
val execution = functions.createExecution(
614-
functionId = "[FUNCTION_ID]"
615-
)
620+
<h3>GraphQL</h3>
621+
622+
<div class="ide margin-bottom" data-lang="graphql" data-lang-label="GraphQL">
623+
<pre class="line-numbers"><code class="prism language-graphql" data-prism>mutation {
624+
functionsCreateExecution(functionId: "[FUNCTION_ID]") {
625+
id
626+
statusCode
627+
response
628+
stdout
629+
stderr
630+
duration
631+
}
616632
}</code></pre>
617633
</div>
618634
</li>

0 commit comments

Comments
 (0)