-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
id: googleapis | ||
title: Google APIs | ||
--- | ||
|
||
Many of Google APIs are accessible using gRPC. The proto | ||
definition of those APIs are [published on GitHub](https://github.com/googleapis/googleapis), | ||
and can be used with Rejoiner to create a GraphQL gateway to Google APIs. This | ||
gateway server can be hosted on the Google Could Platform allowing all | ||
roundtrips to take place within the high-speed Google network. | ||
|
||
Calls can be made using the standard Query annotation. | ||
|
||
``` | ||
@Query("getDocument") | ||
ListenableFuture<Document> getDocument( | ||
GetDocumentRequest request, FirestoreClient client) { | ||
return apiFutureToListenableFuture(client.getDocumentCallable().futureCall(request)); | ||
} | ||
``` | ||
|
||
[Java clients](https://github.com/GoogleCloudPlatform/google-cloud-java) are | ||
published for some of these APIs, which helps with authentication and other | ||
concerns. | ||
|
||
The `GaxSchemaModule` provides additional support to automatically generate | ||
queries and mutations based on RPCs in these services. | ||
|
||
``` | ||
@Namespace("firestore") | ||
public final class FirestoreSchemaModule extends GaxSchemaModule { | ||
@Override | ||
protected void configureSchema() { | ||
addQueryList( | ||
serviceToFields(FirestoreClient.class, ImmutableList.of("getDocument", "listDocuments"))); | ||
addMutationList( | ||
serviceToFields( | ||
FirestoreClient.class, | ||
ImmutableList.of("createDocument", "updateDocument", "deleteDocument"))); | ||
} | ||
} | ||
``` | ||
|
||
|
||
Additional fields can be added to types defined in these APIs. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
"examples" | ||
], | ||
"Advanced": [ | ||
"googleapis", | ||
"relay", | ||
"fieldmasks", | ||
"implementation" | ||
|