├── app
├── .gitignore
├── src
│ ├── main
│ │ ├── res
│ │ │ ├── values
│ │ │ │ ├── dimens.xml
│ │ │ │ ├── strings.xml
│ │ │ │ ├── colors.xml
│ │ │ │ └── styles.xml
│ │ │ ├── mipmap-hdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ ├── ic_thumb_up_white_24dp.png
│ │ │ │ └── ic_thumb_down_white_24dp.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ ├── ic_thumb_up_white_24dp.png
│ │ │ │ └── ic_thumbs_up_down_white_24dp.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ ├── ic_thumb_up_white_24dp.png
│ │ │ │ └── ic_thumbs_up_down_white_24dp.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ ├── ic_thumb_up_white_24dp.png
│ │ │ │ └── ic_thumb_down_white_24dp.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ ├── ic_launcher.png
│ │ │ │ ├── ic_launcher_round.png
│ │ │ │ ├── ic_thumb_up_white_24dp.png
│ │ │ │ └── ic_thumbs_up_down_white_24dp.png
│ │ │ ├── raw
│ │ │ │ └── awsconfiguration.json
│ │ │ ├── menu
│ │ │ │ └── menu_add_events.xml
│ │ │ └── layout
│ │ │ │ ├── content_events.xml
│ │ │ │ ├── event_list_view.xml
│ │ │ │ ├── activity_events.xml
│ │ │ │ ├── activity_add_event.xml
│ │ │ │ └── activity_view_event.xml
│ │ ├── java
│ │ │ └── com
│ │ │ │ └── amazonaws
│ │ │ │ └── demo
│ │ │ │ └── appsync
│ │ │ │ ├── ClientFactory.java
│ │ │ │ ├── EventsAdapter.java
│ │ │ │ ├── ListEventsActivity.java
│ │ │ │ ├── AddEventActivity.java
│ │ │ │ └── ViewEventActivity.java
│ │ ├── AndroidManifest.xml
│ │ └── graphql
│ │ │ └── com
│ │ │ └── amazonaws
│ │ │ └── demo
│ │ │ └── appsync
│ │ │ ├── events.graphql
│ │ │ └── schema.json
│ ├── test
│ │ └── java
│ │ │ └── com
│ │ │ └── amazonaws
│ │ │ └── demo
│ │ │ └── appsync
│ │ │ └── ExampleUnitTest.java
│ └── androidTest
│ │ └── java
│ │ └── com
│ │ └── amazonaws
│ │ └── demo
│ │ └── appsync
│ │ └── ExampleInstrumentedTest.java
├── proguard-rules.pro
└── build.gradle
├── settings.gradle
├── media
└── event_details.png
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── .gitignore
├── .github
└── PULL_REQUEST_TEMPLATE.md
├── gradle.properties
├── LICENSE
├── gradlew.bat
├── README.md
└── gradlew
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 | 16dp
3 |
4 |
--------------------------------------------------------------------------------
/media/event_details.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-mobile-appsync-events-starter-android/HEAD/media/event_details.png
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-mobile-appsync-events-starter-android/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | EventsGraphQL
3 | Save
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-mobile-appsync-events-starter-android/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-mobile-appsync-events-starter-android/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-mobile-appsync-events-starter-android/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .idea
2 | *.iml
3 | .gradle
4 | /local.properties
5 | /.idea/workspace.xml
6 | /.idea/libraries
7 | .DS_Store
8 | /build
9 | /captures
10 | .externalNativeBuild
11 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-mobile-appsync-events-starter-android/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-mobile-appsync-events-starter-android/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-mobile-appsync-events-starter-android/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-mobile-appsync-events-starter-android/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-mobile-appsync-events-starter-android/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-mobile-appsync-events-starter-android/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_thumb_up_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-mobile-appsync-events-starter-android/HEAD/app/src/main/res/mipmap-hdpi/ic_thumb_up_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_thumb_up_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-mobile-appsync-events-starter-android/HEAD/app/src/main/res/mipmap-mdpi/ic_thumb_up_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-mobile-appsync-events-starter-android/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_thumb_down_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-mobile-appsync-events-starter-android/HEAD/app/src/main/res/mipmap-hdpi/ic_thumb_down_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_thumb_up_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-mobile-appsync-events-starter-android/HEAD/app/src/main/res/mipmap-xhdpi/ic_thumb_up_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_thumb_up_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-mobile-appsync-events-starter-android/HEAD/app/src/main/res/mipmap-xxhdpi/ic_thumb_up_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_thumb_down_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-mobile-appsync-events-starter-android/HEAD/app/src/main/res/mipmap-xxhdpi/ic_thumb_down_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_thumb_up_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-mobile-appsync-events-starter-android/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_thumb_up_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_thumbs_up_down_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-mobile-appsync-events-starter-android/HEAD/app/src/main/res/mipmap-mdpi/ic_thumbs_up_down_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_thumbs_up_down_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-mobile-appsync-events-starter-android/HEAD/app/src/main/res/mipmap-xhdpi/ic_thumbs_up_down_white_24dp.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_thumbs_up_down_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/amazon-archives/aws-mobile-appsync-events-starter-android/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_thumbs_up_down_white_24dp.png
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | *Issue #, if available:*
2 |
3 | *Description of changes:*
4 |
5 |
6 | By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #3F51B5
6 |
7 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Mon Mar 09 19:22:08 IST 2020
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
7 |
--------------------------------------------------------------------------------
/app/src/main/res/raw/awsconfiguration.json:
--------------------------------------------------------------------------------
1 | {
2 | "UserAgent": "aws-amplify-cli/0.1.0",
3 | "Version": "1.0",
4 | "IdentityManager": {
5 | "Default": {}
6 | },
7 | "AppSync": {
8 | "Default": {
9 | "ApiUrl": "https://abcdefghijklmnop.appsync-api.us-west-2.amazonaws.com/graphql",
10 | "Region": "us-west-2",
11 | "AuthMode": "API_KEY",
12 | "ApiKey": "xxx-xxxxxxxxxxxxxxxx"
13 | }
14 | }
15 | }
--------------------------------------------------------------------------------
/app/src/test/java/com/amazonaws/demo/appsync/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.amazonaws.demo.appsync;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() throws Exception {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/app/src/main/res/menu/menu_add_events.xml:
--------------------------------------------------------------------------------
1 |
13 |
--------------------------------------------------------------------------------
/app/src/main/java/com/amazonaws/demo/appsync/ClientFactory.java:
--------------------------------------------------------------------------------
1 | package com.amazonaws.demo.appsync;
2 |
3 | import android.content.Context;
4 |
5 | import com.amazonaws.mobile.config.AWSConfiguration;
6 | import com.amazonaws.mobileconnectors.appsync.AWSAppSyncClient;
7 |
8 | class ClientFactory {
9 | private static volatile AWSAppSyncClient client;
10 |
11 | synchronized static AWSAppSyncClient getInstance(Context context) {
12 | if (client == null) {
13 | AWSConfiguration awsConfig = new AWSConfiguration(context);
14 |
15 | client = AWSAppSyncClient.builder()
16 | .context(context)
17 | .awsConfiguration(awsConfig)
18 | .build();
19 | }
20 | return client;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | org.gradle.jvmargs=-Xmx1536m
13 |
14 | # When configured, Gradle will run in incubating parallel mode.
15 | # This option should only be used with decoupled projects. More details, visit
16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
17 | # org.gradle.parallel=true
18 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/content_events.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/amazonaws/demo/appsync/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.amazonaws.demo.appsync;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumentation test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() throws Exception {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.amazonaws.deepdish.postsgraphql", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2 |
3 | Permission is hereby granted, free of charge, to any person obtaining a copy of
4 | this software and associated documentation files (the "Software"), to deal in
5 | the Software without restriction, including without limitation the rights to
6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
7 | the Software, and to permit persons to whom the Software is furnished to do so.
8 |
9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
10 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
11 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
12 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
13 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
14 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
15 |
--------------------------------------------------------------------------------
/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/saligram/Library/Android/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
19 | # Uncomment this to preserve the line number information for
20 | # debugging stack traces.
21 | #-keepattributes SourceFile,LineNumberTable
22 |
23 | # If you keep the line number information, uncomment this to
24 | # hide the original source file name.
25 | #-renamesourcefileattribute SourceFile
26 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/event_list_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
16 |
22 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
18 |
19 |
20 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/app/src/main/graphql/com/amazonaws/demo/appsync/events.graphql:
--------------------------------------------------------------------------------
1 | mutation AddEvent($name: String!, $when: String!, $where: String!, $description: String!){
2 | createEvent(name:$name, when:$when, where:$where, description:$description){
3 | ...Event
4 | }
5 | }
6 |
7 | mutation DeleteEvent($id: ID!) {
8 | deleteEvent(id: $id) {
9 | id
10 | description
11 | name
12 | }
13 | }
14 |
15 | mutation CommentOnEvent($eventId: ID!, $content: String!, $createdAt: String!) {
16 | commentOnEvent(eventId:$eventId, content:$content, createdAt:$createdAt) {
17 | eventId
18 | content
19 | commentId
20 | createdAt
21 | }
22 | }
23 |
24 | query GetEvent($id:ID!) {
25 | getEvent(id:$id) {
26 | ...Event
27 | }
28 | }
29 |
30 | query ListEvents($limit: Int, $nextToken: String) {
31 | listEvents(limit: $limit, nextToken: $nextToken) {
32 | items {
33 | ...Event
34 | }
35 | nextToken
36 | }
37 | }
38 |
39 | subscription NewCommentOnEvent($eventId: String!) {
40 | subscribeToEventComments(eventId: $eventId) {
41 | eventId
42 | commentId
43 | content
44 | createdAt
45 | }
46 | }
47 |
48 | fragment Event on Event {
49 | id
50 | description
51 | name
52 | when
53 | where
54 | comments {
55 | items {
56 | eventId
57 | commentId
58 | content
59 | createdAt
60 | }
61 | }
62 | }
63 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 | apply plugin: 'com.amazonaws.appsync'
3 |
4 | android {
5 | compileSdkVersion 26
6 | buildToolsVersion '27.0.3'
7 | defaultConfig {
8 | applicationId "com.amazonaws.deepdish.postsgraphql"
9 | minSdkVersion 15
10 | targetSdkVersion 26
11 | versionCode 1
12 | versionName "1.0"
13 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
14 | }
15 | buildTypes {
16 | release {
17 | minifyEnabled false
18 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
19 | }
20 | }
21 | }
22 |
23 | dependencies {
24 | implementation fileTree(dir: 'libs', include: ['*.jar'])
25 | androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
26 | exclude group: 'com.android.support', module: 'support-annotations'
27 | exclude group: 'com.google.code.findbugs', module: 'jsr305'
28 | })
29 | implementation 'com.android.support:appcompat-v7:26.1.0'
30 | implementation 'com.android.support.constraint:constraint-layout:1.1.2'
31 | implementation 'com.android.support:design:26.1.0'
32 |
33 | implementation "com.amazonaws:aws-android-sdk-appsync:$awsVersion"
34 |
35 | implementation 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.0'
36 | implementation 'org.eclipse.paho:org.eclipse.paho.android.service:1.1.1'
37 |
38 | testImplementation 'junit:junit:4.12'
39 | }
40 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_events.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
17 |
18 |
29 |
30 |
31 |
32 |
36 |
37 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/app/src/main/java/com/amazonaws/demo/appsync/EventsAdapter.java:
--------------------------------------------------------------------------------
1 | package com.amazonaws.demo.appsync;
2 |
3 | import android.content.Context;
4 | import android.view.LayoutInflater;
5 | import android.view.View;
6 | import android.view.ViewGroup;
7 | import android.widget.BaseAdapter;
8 | import android.widget.TextView;
9 |
10 | import java.util.List;
11 |
12 | public class EventsAdapter extends BaseAdapter {
13 |
14 | private LayoutInflater mInflater;
15 | private List events;
16 |
17 | EventsAdapter(Context context, List events){
18 | this.events = events;
19 | mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
20 | }
21 |
22 | public void setEvents(List posts){
23 | this.events = posts;
24 | }
25 |
26 | @Override
27 | public int getCount() {
28 | return events.size();
29 | }
30 |
31 | @Override
32 | public Object getItem(int i) {
33 | return events.get(i);
34 | }
35 |
36 | @Override
37 | public long getItemId(int i) {
38 | return i;
39 | }
40 |
41 | @Override
42 | public View getView(int i, View convertView, ViewGroup parent) {
43 | final ViewHolder holder;
44 | if (convertView == null) {
45 | convertView = mInflater.inflate(R.layout.event_list_view, parent, false);
46 | holder = new ViewHolder();
47 | holder.nameTextView = (TextView) convertView.findViewById(R.id.eventTitle);
48 | holder.timeTextView = (TextView) convertView.findViewById(R.id.eventAuthor);
49 | holder.whereTextView = (TextView) convertView.findViewById(R.id.eventWhere);
50 |
51 | convertView.setTag(holder);
52 | } else {
53 | holder = (ViewHolder) convertView.getTag();
54 | }
55 |
56 | final ListEventsQuery.Item post = (ListEventsQuery.Item) getItem(i);
57 |
58 | holder.nameTextView.setText("Name: " + post.fragments().event().name());
59 | holder.timeTextView.setText("Time: " + post.fragments().event().when());
60 | holder.whereTextView.setText("Where: " + post.fragments().event().where());
61 |
62 | convertView.setOnClickListener(new View.OnClickListener() {
63 | @Override
64 | public void onClick(View view) {
65 | ViewEventActivity.startActivity(view.getContext(), post.fragments().event());
66 | }
67 | });
68 |
69 | return convertView;
70 | }
71 |
72 | private static class ViewHolder {
73 | TextView nameTextView;
74 | TextView timeTextView;
75 | TextView whereTextView;
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_add_event.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
13 |
18 |
23 |
24 |
29 |
34 |
39 |
40 |
45 |
50 |
55 |
56 |
61 |
66 |
71 |
72 |
73 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/activity_view_event.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
17 |
18 |
24 |
25 |
26 |
31 |
32 |
38 |
39 |
40 |
45 |
46 |
52 |
53 |
54 |
59 |
60 |
65 |
66 |
72 |
73 |
78 |
79 |
84 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/app/src/main/java/com/amazonaws/demo/appsync/ListEventsActivity.java:
--------------------------------------------------------------------------------
1 | package com.amazonaws.demo.appsync;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.support.design.widget.FloatingActionButton;
6 | import android.support.v7.app.AppCompatActivity;
7 | import android.support.v7.widget.Toolbar;
8 | import android.util.Log;
9 | import android.view.View;
10 | import android.widget.ListView;
11 |
12 | import com.amazonaws.mobileconnectors.appsync.AWSAppSyncClient;
13 | import com.amazonaws.mobileconnectors.appsync.fetcher.AppSyncResponseFetchers;
14 | import com.apollographql.apollo.GraphQLCall;
15 | import com.apollographql.apollo.api.Response;
16 | import com.apollographql.apollo.exception.ApolloException;
17 |
18 | import java.util.ArrayList;
19 | import java.util.List;
20 |
21 | import javax.annotation.Nonnull;
22 |
23 | public class ListEventsActivity extends AppCompatActivity {
24 |
25 | private static final String TAG = ListEventsActivity.class.getSimpleName();
26 |
27 | private AWSAppSyncClient mAWSAppSyncClient;
28 |
29 | private List events = new ArrayList<>();
30 | private EventsAdapter adapter;
31 |
32 | @Override
33 | protected void onCreate(Bundle savedInstanceState) {
34 | super.onCreate(savedInstanceState);
35 | setContentView(R.layout.activity_events);
36 | Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
37 | setSupportActionBar(toolbar);
38 |
39 | FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
40 | fab.setOnClickListener(new View.OnClickListener() {
41 | @Override
42 | public void onClick(View view) {
43 | Intent intent = new Intent(ListEventsActivity.this, AddEventActivity.class);
44 | startActivity(intent);
45 | }
46 | });
47 |
48 | FloatingActionButton fabRefresh = (FloatingActionButton) findViewById(R.id.refresh);
49 | fabRefresh.setOnClickListener(new View.OnClickListener() {
50 | @Override
51 | public void onClick(View view) {
52 | query();
53 | }
54 | });
55 |
56 | adapter = new EventsAdapter(this, events);
57 | ListView mListView = (ListView) findViewById(R.id.postsList);
58 | mListView.setAdapter(adapter);
59 | }
60 |
61 | @Override
62 | protected void onResume() {
63 | super.onResume();
64 | query();
65 | }
66 |
67 | private void query() {
68 | if (mAWSAppSyncClient == null) {
69 | mAWSAppSyncClient = ClientFactory.getInstance(this);
70 | }
71 | mAWSAppSyncClient.query(ListEventsQuery.builder().build())
72 | .responseFetcher(AppSyncResponseFetchers.CACHE_AND_NETWORK)
73 | .enqueue(eventsCallback);
74 | }
75 |
76 | private GraphQLCall.Callback eventsCallback = new GraphQLCall.Callback() {
77 | @Override
78 | public void onResponse(@Nonnull Response response) {
79 | if (response.data() != null) {
80 | events = response.data().listEvents().items();
81 | } else {
82 | events = new ArrayList<>();
83 | }
84 | adapter.setEvents(events);
85 | runOnUiThread(new Runnable() {
86 | @Override
87 | public void run() {
88 | Log.d(TAG, "Notifying data set changed");
89 | adapter.notifyDataSetChanged();
90 | }
91 | });
92 | }
93 |
94 | @Override
95 | public void onFailure(@Nonnull ApolloException e) {
96 | Log.e(TAG, "Failed to make events api call", e);
97 | Log.e(TAG, e.getMessage());
98 | }
99 | };
100 |
101 | }
102 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | AWS Mobile App Sync Starter App for Android
2 |
3 | # Introduction
4 |
5 | This is a Starter application for using the Sample app in the AWS AppSync console when building your GraphQL API. The Sample app creates a GraphQL schema and provisions Amazon DynamoDB resources, then connects them appropriately with Resolvers. The application demonstrates GraphQL Mutations, Queries, and Offline support using AWS AppSync. You can use this for learning purposes or adapt either the application or the GraphQL Schema to meet your needs.
6 |
7 |
8 |
9 | ## Features
10 |
11 | - GraphQL Mutations
12 | - Create new events
13 | - Create comments on existing events
14 | - GraphQL Queries
15 | - Get all events
16 | - Get an event by Id
17 | - Authorization
18 | - The app uses API Key as the authorization mechanism
19 |
20 | ## AWS Setup
21 |
22 | 1. Navigate to the AWS AppSync console using the URL: http://console.aws.amazon.com/appsync/home
23 |
24 | 2. Click on `Create API` and select the `Event App` under the `sample project` in the bottom pane, and select `Start`. Enter a API name of your choice. Click `Create`.
25 |
26 | ## Android Setup
27 |
28 | 1. Clone this repository:
29 |
30 | ```
31 | git clone https://github.com/aws-samples/aws-mobile-appsync-events-starter-android.git
32 | ```
33 |
34 | 2. Open Android Studio, choose `Import project` navigate to the repository folder that was cloned and select open.
35 |
36 | 3. Ensure that the project's `build.gradle` has the following dependency in the build script:
37 |
38 | ```bash
39 | classpath 'com.amazonaws:aws-android-sdk-appsync-gradle-plugin:2.7.+'
40 | ```
41 |
42 | 4. Ensure that the app's build.gradle has the appsync plugin and dependencies on the appsync and paho libraries. For example:
43 |
44 | ```bash
45 | apply plugin: 'com.android.application'
46 | apply plugin: 'com.amazonaws.appsync'
47 | android {
48 | // Typical items
49 | }
50 | dependencies {
51 | // Typical dependencies
52 | implementation 'com.amazonaws:aws-android-sdk-appsync:2.7.+'
53 | implementation 'org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.0'
54 | implementation 'org.eclipse.paho:org.eclipse.paho.android.service:1.1.1'
55 | }
56 | ```
57 |
58 | 5. Ensure that the AndroidManifest.xml has the appropriate permissions setup and has the calls and offline state. Also, add a `` entry under `` for `MqttService` to use subscriptions:
59 |
60 | ```xml
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 | ```
77 |
78 |
79 | 6. Inside Android Studio, choose the menu `Tools > Android > Sync Project with Gradle Files` to ensure gradle is up to date and wait until this completes.
80 |
81 | 7. Wait until the progress bar at the top has completed deploying your resources. Then from the integration page of your GraphQL API (you can click the name you entered in the left hand navigation).
82 |
83 | On this same page, select `Android` at the bottom to download your `awsconfiguration.json` configuration file by clicking the **Download Config** button. Replace the `awsconfiguration.json` file in the `src/main/res/raw` folder of your app with the file you just downloaded.
84 |
85 | ## Application walkthrough
86 |
87 | ### Generated code
88 |
89 | Java code is generated from a schema file (`./app/src/main/graphql/com/amazonaws/demo/appsync/schema.json`) and a .graphql file (`/app/src/main/graphql/com/amazonaws/demo/appsync/events.graphql`) based on your API. The generated source is in the `./app/build/generated/source/appsync` folder of this project after a build is completed.
90 |
91 | If you update your schema in the future, you should use the [AWS Amplify CLI](https://aws-amplify.github.io/) codegen feature to automatically download and update your queries, mutations, subscriptions and the schema. For a tutorial of this, [click here](https://github.com/aws-amplify/amplify-cli/blob/master/native_guide.md).
92 |
93 | ### ListEventsActivity.java (Query)
94 |
95 | - The `ListEventsActivity.java` file lists all the events accessible to the user. It returns data from the offline cache first if available and later fetches it from remote to update the local cache.
96 |
97 | ### ViewEventActivity.java (Mutation, Query, Subscription)
98 |
99 | - The `ViewEventActivity.java` file lists information about an event and allows new comments to be added. New comments to the event are added while the user is viewing the event via subscriptions.
100 |
101 | ### AddEventActivity.java (Mutation)
102 |
103 | - The `AddEventActivity.java` file creates a new event using the details entered on screen.
104 |
105 | ## Getting Help
106 |
107 | We use [AppSync Android SDK GitHub issues](https://github.com/awslabs/aws-mobile-appsync-sdk-android/issues) for tracking questions, bugs, and feature requests.
108 |
109 | ## License
110 |
111 | This sample code is made available under the MIT-0 license. See the LICENSE file.
112 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/app/src/main/java/com/amazonaws/demo/appsync/AddEventActivity.java:
--------------------------------------------------------------------------------
1 | package com.amazonaws.demo.appsync;
2 |
3 | import android.content.Context;
4 | import android.net.ConnectivityManager;
5 | import android.net.NetworkInfo;
6 | import android.os.Bundle;
7 | import android.support.v7.app.AppCompatActivity;
8 | import android.util.Log;
9 | import android.view.Menu;
10 | import android.view.MenuItem;
11 | import android.widget.EditText;
12 | import android.widget.Toast;
13 |
14 | import com.amazonaws.demo.appsync.fragment.Event;
15 | import com.amazonaws.mobileconnectors.appsync.AWSAppSyncClient;
16 | import com.amazonaws.mobileconnectors.appsync.fetcher.AppSyncResponseFetchers;
17 | import com.apollographql.apollo.GraphQLCall;
18 | import com.apollographql.apollo.api.Error;
19 | import com.apollographql.apollo.api.Response;
20 | import com.apollographql.apollo.exception.ApolloException;
21 |
22 | import java.util.ArrayList;
23 | import java.util.List;
24 | import java.util.UUID;
25 |
26 | import javax.annotation.Nonnull;
27 |
28 | public class AddEventActivity extends AppCompatActivity {
29 |
30 | private static final String TAG = AddEventActivity.class.getSimpleName();
31 |
32 | private EditText name;
33 | private EditText time;
34 | private EditText where;
35 | private EditText description;
36 |
37 | @Override
38 | protected void onCreate(Bundle savedInstanceState) {
39 | super.onCreate(savedInstanceState);
40 | setContentView(R.layout.activity_add_event);
41 | name = (EditText)findViewById(R.id.name);
42 | time = (EditText)findViewById(R.id.time);
43 | where = (EditText)findViewById(R.id.where);
44 | description = (EditText)findViewById(R.id.description);
45 |
46 | name.setText("Lunch");
47 | time.setText("12:30 pm");
48 | where.setText("Desk");
49 | description.setText("Grab a burger.");
50 | }
51 |
52 | @Override
53 | public boolean onCreateOptionsMenu(Menu menu) {
54 | // Inflate the menu; this adds items to the action bar if it is present.
55 | getMenuInflater().inflate(R.menu.menu_add_events, menu);
56 | return true;
57 | }
58 |
59 | @Override
60 | public boolean onOptionsItemSelected(MenuItem item) {
61 | int id = item.getItemId();
62 |
63 | //noinspection SimplifiableIfStatement
64 | if (id == R.id.action_save) {
65 | save();
66 | return true;
67 | }
68 |
69 | return super.onOptionsItemSelected(item);
70 | }
71 |
72 | private void save() {
73 | String nameString = name.getText().toString();
74 | String timeString = time.getText().toString();
75 | String upsString = where.getText().toString();
76 | String descriptionString = description.getText().toString();
77 |
78 | // Get the client instance
79 | AWSAppSyncClient awsAppSyncClient = ClientFactory.getInstance(this.getApplicationContext());
80 |
81 | // Create the mutation request
82 | AddEventMutation addEventMutation = AddEventMutation.builder()
83 | .name(nameString)
84 | .when(timeString)
85 | .where(upsString)
86 | .description(descriptionString)
87 | .build();
88 |
89 | // Enqueue the request (This will execute the request)
90 | awsAppSyncClient.mutate(addEventMutation).refetchQueries(ListEventsQuery.builder().build()).enqueue(addEventsCallback);
91 |
92 | // Add to event list while offline or before request returns
93 | List items = new ArrayList<>();
94 | String tempID = UUID.randomUUID().toString();
95 | Event event = new Event("Event", tempID, descriptionString, nameString, timeString, upsString, new Event.Comments("Comment", items));
96 | addEventOffline(new ListEventsQuery.Item("Event", new ListEventsQuery.Item.Fragments(event)));
97 |
98 | // Close the add event when offline otherwise allow callback to close
99 | ConnectivityManager cm =
100 | (ConnectivityManager) getApplicationContext().getSystemService(Context.CONNECTIVITY_SERVICE);
101 |
102 | NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
103 | boolean isConnected = activeNetwork != null &&
104 | activeNetwork.isConnectedOrConnecting();
105 |
106 | if (!isConnected) {
107 | finish();
108 | }
109 | }
110 |
111 | private GraphQLCall.Callback addEventsCallback = new GraphQLCall.Callback() {
112 | @Override
113 | public void onResponse(@Nonnull final Response response) {
114 | if (response.hasErrors()) {
115 | runOnUiThread(new Runnable() {
116 | @Override
117 | public void run() {
118 | Toast.makeText(getApplicationContext(), "Could not save", Toast.LENGTH_SHORT).show();
119 | Log.e(TAG, "Error: " + response.toString());
120 |
121 | for (Error err : response.errors()) {
122 | Log.e(TAG, "Error: " + err.message());
123 | }
124 | finish();
125 | }
126 | });
127 | } else {
128 | runOnUiThread(new Runnable() {
129 | @Override
130 | public void run() {
131 | Toast.makeText(getApplicationContext(), "Saved", Toast.LENGTH_SHORT).show();
132 | Log.d(TAG, "Add event succeeded");
133 | finish();
134 | }
135 | });
136 | }
137 | }
138 |
139 | @Override
140 | public void onFailure(@Nonnull ApolloException e) {
141 | Log.e(TAG, "Failed to make posts api call", e);
142 | Log.e(TAG, e.getMessage());
143 | }
144 | };
145 |
146 | private void addEventOffline(final ListEventsQuery.Item pendingItem) {
147 | final AWSAppSyncClient awsAppSyncClient = ClientFactory.getInstance(this);
148 | final ListEventsQuery listEventsQuery = ListEventsQuery.builder().build();
149 |
150 | awsAppSyncClient.query(listEventsQuery)
151 | .responseFetcher(AppSyncResponseFetchers.CACHE_ONLY)
152 | .enqueue(new GraphQLCall.Callback() {
153 | @Override
154 | public void onResponse(@Nonnull Response response) {
155 | List items = new ArrayList<>();
156 | if (response.data() != null) {
157 | items.addAll(response.data().listEvents().items());
158 | }
159 |
160 | items.add(pendingItem);
161 | ListEventsQuery.Data data = new ListEventsQuery.Data(new ListEventsQuery.ListEvents("EventConnection", items, null));
162 | awsAppSyncClient.getStore().write(listEventsQuery, data).enqueue(null);
163 | }
164 |
165 | @Override
166 | public void onFailure(@Nonnull ApolloException e) {
167 | Log.e(TAG, "Failed to update event query list.", e);
168 | }
169 | });
170 | }
171 | }
172 |
--------------------------------------------------------------------------------
/app/src/main/java/com/amazonaws/demo/appsync/ViewEventActivity.java:
--------------------------------------------------------------------------------
1 | package com.amazonaws.demo.appsync;
2 |
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.os.Bundle;
6 | import android.support.v7.app.AppCompatActivity;
7 | import android.util.Log;
8 | import android.view.View;
9 | import android.view.inputmethod.InputMethodManager;
10 | import android.widget.EditText;
11 | import android.widget.TextView;
12 | import android.widget.Toast;
13 |
14 | import com.amazonaws.demo.appsync.fragment.Event;
15 | import com.amazonaws.mobileconnectors.appsync.AppSyncSubscriptionCall;
16 | import com.amazonaws.mobileconnectors.appsync.fetcher.AppSyncResponseFetchers;
17 | import com.apollographql.apollo.GraphQLCall;
18 | import com.apollographql.apollo.api.Response;
19 | import com.apollographql.apollo.exception.ApolloException;
20 |
21 | import java.util.Date;
22 | import java.util.LinkedList;
23 | import java.util.List;
24 |
25 | import javax.annotation.Nonnull;
26 |
27 | public class ViewEventActivity extends AppCompatActivity {
28 | public static final String TAG = ViewEventActivity.class.getSimpleName();
29 |
30 | private static Event event;
31 | private TextView comments;
32 | private EditText newComment;
33 | private AppSyncSubscriptionCall subscriptionWatcher;
34 |
35 | public static void startActivity(final Context context, Event e) {
36 | event = e;
37 | Intent intent = new Intent(context, ViewEventActivity.class);
38 | context.startActivity(intent);
39 | }
40 |
41 | @Override
42 | protected void onCreate(Bundle savedInstanceState) {
43 | super.onCreate(savedInstanceState);
44 | setContentView(R.layout.activity_view_event);
45 |
46 | TextView name = (TextView) findViewById(R.id.viewName);
47 | TextView time = (TextView) findViewById(R.id.viewTime);
48 | TextView where = (TextView) findViewById(R.id.viewWhere);
49 | TextView description = (TextView) findViewById(R.id.viewDescription);
50 | comments = (TextView) findViewById(R.id.comments);
51 | newComment = (EditText) findViewById(R.id.new_comment);
52 |
53 | name.setText(event.name());
54 | time.setText(event.when());
55 | where.setText(event.where());
56 | description.setText(event.description());
57 |
58 | refreshEvent(true);
59 | startSubscription();
60 | }
61 |
62 | @Override
63 | protected void onStop() {
64 | super.onStop();
65 |
66 | if (subscriptionWatcher != null) {
67 | subscriptionWatcher.cancel();
68 | }
69 | }
70 |
71 | private void startSubscription() {
72 | NewCommentOnEventSubscription subscription = NewCommentOnEventSubscription.builder().eventId(event.id()).build();
73 |
74 | subscriptionWatcher = ClientFactory.getInstance(this.getApplicationContext()).subscribe(subscription);
75 | subscriptionWatcher.execute(subscriptionCallback);
76 | }
77 |
78 | private AppSyncSubscriptionCall.Callback subscriptionCallback = new AppSyncSubscriptionCall.Callback() {
79 | @Override
80 | public void onResponse(final @Nonnull Response response) {
81 | runOnUiThread(new Runnable() {
82 | @Override
83 | public void run() {
84 | Toast.makeText(ViewEventActivity.this, response.data().subscribeToEventComments().eventId().substring(0, 5) + response.data().subscribeToEventComments().content(), Toast.LENGTH_LONG).show();
85 | Log.e(TAG, "Subscription response: " + response.data().toString());
86 | NewCommentOnEventSubscription.SubscribeToEventComments comment = response.data().subscribeToEventComments();
87 |
88 | // UI only write
89 | addComment(comment.content());
90 |
91 | // Cache write
92 | addCommentToCache(comment);
93 |
94 | // Show changes from in cache
95 | refreshEvent(true);
96 | }
97 | });
98 | }
99 |
100 | @Override
101 | public void onFailure(final @Nonnull ApolloException e) {
102 | Log.e(TAG, "Subscription failure", e);
103 | }
104 |
105 | @Override
106 | public void onCompleted() {
107 | Log.d(TAG, "Subscription completed");
108 | }
109 | };
110 |
111 | /**
112 | * Adds the new comment to the event in the cache.
113 | * @param comment
114 | */
115 | private void addCommentToCache(NewCommentOnEventSubscription.SubscribeToEventComments comment) {
116 | try {
117 | // Read the old event data
118 | GetEventQuery getEventQuery = GetEventQuery.builder().id(event.id()).build();
119 | GetEventQuery.Data readData = ClientFactory.getInstance(ViewEventActivity.this).getStore().read(getEventQuery).execute();
120 | Event event = readData.getEvent().fragments().event();
121 |
122 | // Create the new comment object
123 | Event.Item newComment = new Event.Item(
124 | comment.__typename(),
125 | comment.eventId(),
126 | comment.commentId(),
127 | comment.content(),
128 | comment.createdAt());
129 |
130 | // Create the new comment list attached to the event
131 | List items = new LinkedList<>(event.comments().items());
132 | items.add(0, newComment);
133 |
134 | // Create the new event data
135 | GetEventQuery.Data madeData = new GetEventQuery.Data(new GetEventQuery.GetEvent(readData.getEvent().__typename(), new GetEventQuery.GetEvent.Fragments(new Event(readData.getEvent().fragments().event().__typename(),
136 | event.id(),
137 | event.description(),
138 | event.name(),
139 | event.when(),
140 | event.where(),
141 | new Event.Comments(readData.getEvent().fragments().event().comments().__typename(), items)))));
142 |
143 | // Write the new event data
144 | ClientFactory.getInstance(ViewEventActivity.this).getStore().write(getEventQuery, madeData).execute();
145 | Log.d(TAG, "Wrote comment to database");
146 | } catch (ApolloException e) {
147 | Log.e(TAG, "Failed to update local database", e);
148 | }
149 | }
150 |
151 | /**
152 | * UI triggered method to add a comment. This will read the text box and submit a new comment.
153 | * @param view
154 | */
155 | public void addComment(View view) {
156 | InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
157 | imm.hideSoftInputFromWindow(newComment.getWindowToken(), 0);
158 |
159 | Toast.makeText(this, "Submitting comment", Toast.LENGTH_SHORT).show();
160 |
161 | CommentOnEventMutation comment = CommentOnEventMutation.builder().content(newComment.getText().toString())
162 | .createdAt(new Date().toString())
163 | .eventId(event.id())
164 | .build();
165 |
166 | ClientFactory.getInstance(view.getContext())
167 | .mutate(comment)
168 | .enqueue(addCommentCallback);
169 | }
170 |
171 | /**
172 | * Service response subscriptionCallback confirming receipt of new comment triggered by UI.
173 | */
174 | private GraphQLCall.Callback addCommentCallback = new GraphQLCall.Callback() {
175 | @Override
176 | public void onResponse(@Nonnull Response response) {
177 | Log.d(TAG, response.toString());
178 | runOnUiThread(new Runnable() {
179 | @Override
180 | public void run() {
181 | clearComment();
182 | }
183 | });
184 | }
185 |
186 | @Override
187 | public void onFailure(@Nonnull ApolloException e) {
188 | Log.e(TAG, "Failed to make comments mutation", e);
189 | Log.e(TAG, e.getMessage());
190 | }
191 | };
192 |
193 | /**
194 | * Refresh the event object to latest from service.
195 | */
196 | private void refreshEvent(final boolean cacheOnly) {
197 | GetEventQuery getEventQuery = GetEventQuery.builder().id(event.id()).build();
198 |
199 | ClientFactory.getInstance(getApplicationContext())
200 | .query(getEventQuery)
201 | .responseFetcher(cacheOnly ? AppSyncResponseFetchers.CACHE_ONLY : AppSyncResponseFetchers.CACHE_AND_NETWORK)
202 | .enqueue(refreshEventCallback);
203 | }
204 |
205 | private GraphQLCall.Callback refreshEventCallback = new GraphQLCall.Callback() {
206 | @Override
207 | public void onResponse(@Nonnull final Response response) {
208 | runOnUiThread(new Runnable() {
209 | @Override
210 | public void run() {
211 | if (response.errors().size() < 1) {
212 | event = response.data().getEvent().fragments().event();
213 | refreshComments();
214 | } else {
215 | Log.e(TAG, "Failed to get event.");
216 | }
217 | }
218 | });
219 | }
220 |
221 | @Override
222 | public void onFailure(@Nonnull ApolloException e) {
223 | Log.e(TAG, "Failed to get event.");
224 | }
225 | };
226 |
227 | /**
228 | * Triggered by subscriptions/programmatically
229 | * @param comment
230 | */
231 | private void addComment(final String comment) {
232 | comments.setText(comment + "\n-----------\n");
233 | }
234 |
235 | /**
236 | * Reads the comments from the event object and preps it for display.
237 | */
238 | private void refreshComments() {
239 | StringBuilder stringBuilder = new StringBuilder();
240 | for (Event.Item i : event.comments().items()) {
241 | stringBuilder.append(i.content() + "\n---------\n");
242 | }
243 | comments.setText(stringBuilder.toString());
244 | }
245 |
246 | private void clearComment() {
247 | newComment.setText("");
248 | }
249 |
250 | }
251 |
--------------------------------------------------------------------------------
/app/src/main/graphql/com/amazonaws/demo/appsync/schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "data": {
3 | "__schema": {
4 | "queryType": {
5 | "name": "Query"
6 | },
7 | "mutationType": {
8 | "name": "Mutation"
9 | },
10 | "subscriptionType": {
11 | "name": "Subscription"
12 | },
13 | "types": [
14 | {
15 | "kind": "OBJECT",
16 | "name": "Query",
17 | "description": null,
18 | "fields": [
19 | {
20 | "name": "getEvent",
21 | "description": " Get a single event by id.",
22 | "args": [
23 | {
24 | "name": "id",
25 | "description": null,
26 | "type": {
27 | "kind": "NON_NULL",
28 | "name": null,
29 | "ofType": {
30 | "kind": "SCALAR",
31 | "name": "ID",
32 | "ofType": null
33 | }
34 | },
35 | "defaultValue": null
36 | }
37 | ],
38 | "type": {
39 | "kind": "OBJECT",
40 | "name": "Event",
41 | "ofType": null
42 | },
43 | "isDeprecated": false,
44 | "deprecationReason": null
45 | },
46 | {
47 | "name": "listEvents",
48 | "description": " Paginate through events.",
49 | "args": [
50 | {
51 | "name": "filter",
52 | "description": null,
53 | "type": {
54 | "kind": "INPUT_OBJECT",
55 | "name": "TableEventFilterInput",
56 | "ofType": null
57 | },
58 | "defaultValue": null
59 | },
60 | {
61 | "name": "limit",
62 | "description": null,
63 | "type": {
64 | "kind": "SCALAR",
65 | "name": "Int",
66 | "ofType": null
67 | },
68 | "defaultValue": null
69 | },
70 | {
71 | "name": "nextToken",
72 | "description": null,
73 | "type": {
74 | "kind": "SCALAR",
75 | "name": "String",
76 | "ofType": null
77 | },
78 | "defaultValue": null
79 | }
80 | ],
81 | "type": {
82 | "kind": "OBJECT",
83 | "name": "EventConnection",
84 | "ofType": null
85 | },
86 | "isDeprecated": false,
87 | "deprecationReason": null
88 | }
89 | ],
90 | "inputFields": null,
91 | "interfaces": [],
92 | "enumValues": null,
93 | "possibleTypes": null
94 | },
95 | {
96 | "kind": "OBJECT",
97 | "name": "Event",
98 | "description": null,
99 | "fields": [
100 | {
101 | "name": "id",
102 | "description": null,
103 | "args": [],
104 | "type": {
105 | "kind": "NON_NULL",
106 | "name": null,
107 | "ofType": {
108 | "kind": "SCALAR",
109 | "name": "ID",
110 | "ofType": null
111 | }
112 | },
113 | "isDeprecated": false,
114 | "deprecationReason": null
115 | },
116 | {
117 | "name": "name",
118 | "description": null,
119 | "args": [],
120 | "type": {
121 | "kind": "SCALAR",
122 | "name": "String",
123 | "ofType": null
124 | },
125 | "isDeprecated": false,
126 | "deprecationReason": null
127 | },
128 | {
129 | "name": "where",
130 | "description": null,
131 | "args": [],
132 | "type": {
133 | "kind": "SCALAR",
134 | "name": "String",
135 | "ofType": null
136 | },
137 | "isDeprecated": false,
138 | "deprecationReason": null
139 | },
140 | {
141 | "name": "when",
142 | "description": null,
143 | "args": [],
144 | "type": {
145 | "kind": "SCALAR",
146 | "name": "String",
147 | "ofType": null
148 | },
149 | "isDeprecated": false,
150 | "deprecationReason": null
151 | },
152 | {
153 | "name": "description",
154 | "description": null,
155 | "args": [],
156 | "type": {
157 | "kind": "SCALAR",
158 | "name": "String",
159 | "ofType": null
160 | },
161 | "isDeprecated": false,
162 | "deprecationReason": null
163 | },
164 | {
165 | "name": "comments",
166 | "description": " Paginate through all comments belonging to an individual post.",
167 | "args": [
168 | {
169 | "name": "limit",
170 | "description": null,
171 | "type": {
172 | "kind": "SCALAR",
173 | "name": "Int",
174 | "ofType": null
175 | },
176 | "defaultValue": null
177 | },
178 | {
179 | "name": "nextToken",
180 | "description": null,
181 | "type": {
182 | "kind": "SCALAR",
183 | "name": "String",
184 | "ofType": null
185 | },
186 | "defaultValue": null
187 | }
188 | ],
189 | "type": {
190 | "kind": "OBJECT",
191 | "name": "CommentConnection",
192 | "ofType": null
193 | },
194 | "isDeprecated": false,
195 | "deprecationReason": null
196 | }
197 | ],
198 | "inputFields": null,
199 | "interfaces": [],
200 | "enumValues": null,
201 | "possibleTypes": null
202 | },
203 | {
204 | "kind": "SCALAR",
205 | "name": "ID",
206 | "description": "Built-in ID",
207 | "fields": null,
208 | "inputFields": null,
209 | "interfaces": null,
210 | "enumValues": null,
211 | "possibleTypes": null
212 | },
213 | {
214 | "kind": "SCALAR",
215 | "name": "String",
216 | "description": "Built-in String",
217 | "fields": null,
218 | "inputFields": null,
219 | "interfaces": null,
220 | "enumValues": null,
221 | "possibleTypes": null
222 | },
223 | {
224 | "kind": "OBJECT",
225 | "name": "CommentConnection",
226 | "description": null,
227 | "fields": [
228 | {
229 | "name": "items",
230 | "description": null,
231 | "args": [],
232 | "type": {
233 | "kind": "LIST",
234 | "name": null,
235 | "ofType": {
236 | "kind": "OBJECT",
237 | "name": "Comment",
238 | "ofType": null
239 | }
240 | },
241 | "isDeprecated": false,
242 | "deprecationReason": null
243 | },
244 | {
245 | "name": "nextToken",
246 | "description": null,
247 | "args": [],
248 | "type": {
249 | "kind": "SCALAR",
250 | "name": "String",
251 | "ofType": null
252 | },
253 | "isDeprecated": false,
254 | "deprecationReason": null
255 | }
256 | ],
257 | "inputFields": null,
258 | "interfaces": [],
259 | "enumValues": null,
260 | "possibleTypes": null
261 | },
262 | {
263 | "kind": "OBJECT",
264 | "name": "Comment",
265 | "description": null,
266 | "fields": [
267 | {
268 | "name": "eventId",
269 | "description": " The id of the comment's parent event.",
270 | "args": [],
271 | "type": {
272 | "kind": "NON_NULL",
273 | "name": null,
274 | "ofType": {
275 | "kind": "SCALAR",
276 | "name": "ID",
277 | "ofType": null
278 | }
279 | },
280 | "isDeprecated": false,
281 | "deprecationReason": null
282 | },
283 | {
284 | "name": "commentId",
285 | "description": " A unique identifier for the comment.",
286 | "args": [],
287 | "type": {
288 | "kind": "NON_NULL",
289 | "name": null,
290 | "ofType": {
291 | "kind": "SCALAR",
292 | "name": "String",
293 | "ofType": null
294 | }
295 | },
296 | "isDeprecated": false,
297 | "deprecationReason": null
298 | },
299 | {
300 | "name": "content",
301 | "description": " The comment's content.",
302 | "args": [],
303 | "type": {
304 | "kind": "NON_NULL",
305 | "name": null,
306 | "ofType": {
307 | "kind": "SCALAR",
308 | "name": "String",
309 | "ofType": null
310 | }
311 | },
312 | "isDeprecated": false,
313 | "deprecationReason": null
314 | },
315 | {
316 | "name": "createdAt",
317 | "description": " The comment timestamp. This field is indexed to enable sorted pagination.",
318 | "args": [],
319 | "type": {
320 | "kind": "NON_NULL",
321 | "name": null,
322 | "ofType": {
323 | "kind": "SCALAR",
324 | "name": "String",
325 | "ofType": null
326 | }
327 | },
328 | "isDeprecated": false,
329 | "deprecationReason": null
330 | }
331 | ],
332 | "inputFields": null,
333 | "interfaces": [],
334 | "enumValues": null,
335 | "possibleTypes": null
336 | },
337 | {
338 | "kind": "SCALAR",
339 | "name": "Int",
340 | "description": "Built-in Int",
341 | "fields": null,
342 | "inputFields": null,
343 | "interfaces": null,
344 | "enumValues": null,
345 | "possibleTypes": null
346 | },
347 | {
348 | "kind": "OBJECT",
349 | "name": "EventConnection",
350 | "description": null,
351 | "fields": [
352 | {
353 | "name": "items",
354 | "description": null,
355 | "args": [],
356 | "type": {
357 | "kind": "LIST",
358 | "name": null,
359 | "ofType": {
360 | "kind": "OBJECT",
361 | "name": "Event",
362 | "ofType": null
363 | }
364 | },
365 | "isDeprecated": false,
366 | "deprecationReason": null
367 | },
368 | {
369 | "name": "nextToken",
370 | "description": null,
371 | "args": [],
372 | "type": {
373 | "kind": "SCALAR",
374 | "name": "String",
375 | "ofType": null
376 | },
377 | "isDeprecated": false,
378 | "deprecationReason": null
379 | }
380 | ],
381 | "inputFields": null,
382 | "interfaces": [],
383 | "enumValues": null,
384 | "possibleTypes": null
385 | },
386 | {
387 | "kind": "INPUT_OBJECT",
388 | "name": "TableEventFilterInput",
389 | "description": null,
390 | "fields": null,
391 | "inputFields": [
392 | {
393 | "name": "id",
394 | "description": null,
395 | "type": {
396 | "kind": "INPUT_OBJECT",
397 | "name": "TableIDFilterInput",
398 | "ofType": null
399 | },
400 | "defaultValue": null
401 | },
402 | {
403 | "name": "name",
404 | "description": null,
405 | "type": {
406 | "kind": "INPUT_OBJECT",
407 | "name": "TableStringFilterInput",
408 | "ofType": null
409 | },
410 | "defaultValue": null
411 | },
412 | {
413 | "name": "where",
414 | "description": null,
415 | "type": {
416 | "kind": "INPUT_OBJECT",
417 | "name": "TableStringFilterInput",
418 | "ofType": null
419 | },
420 | "defaultValue": null
421 | },
422 | {
423 | "name": "when",
424 | "description": null,
425 | "type": {
426 | "kind": "INPUT_OBJECT",
427 | "name": "TableStringFilterInput",
428 | "ofType": null
429 | },
430 | "defaultValue": null
431 | },
432 | {
433 | "name": "description",
434 | "description": null,
435 | "type": {
436 | "kind": "INPUT_OBJECT",
437 | "name": "TableStringFilterInput",
438 | "ofType": null
439 | },
440 | "defaultValue": null
441 | }
442 | ],
443 | "interfaces": null,
444 | "enumValues": null,
445 | "possibleTypes": null
446 | },
447 | {
448 | "kind": "INPUT_OBJECT",
449 | "name": "TableIDFilterInput",
450 | "description": null,
451 | "fields": null,
452 | "inputFields": [
453 | {
454 | "name": "ne",
455 | "description": null,
456 | "type": {
457 | "kind": "SCALAR",
458 | "name": "ID",
459 | "ofType": null
460 | },
461 | "defaultValue": null
462 | },
463 | {
464 | "name": "eq",
465 | "description": null,
466 | "type": {
467 | "kind": "SCALAR",
468 | "name": "ID",
469 | "ofType": null
470 | },
471 | "defaultValue": null
472 | },
473 | {
474 | "name": "le",
475 | "description": null,
476 | "type": {
477 | "kind": "SCALAR",
478 | "name": "ID",
479 | "ofType": null
480 | },
481 | "defaultValue": null
482 | },
483 | {
484 | "name": "lt",
485 | "description": null,
486 | "type": {
487 | "kind": "SCALAR",
488 | "name": "ID",
489 | "ofType": null
490 | },
491 | "defaultValue": null
492 | },
493 | {
494 | "name": "ge",
495 | "description": null,
496 | "type": {
497 | "kind": "SCALAR",
498 | "name": "ID",
499 | "ofType": null
500 | },
501 | "defaultValue": null
502 | },
503 | {
504 | "name": "gt",
505 | "description": null,
506 | "type": {
507 | "kind": "SCALAR",
508 | "name": "ID",
509 | "ofType": null
510 | },
511 | "defaultValue": null
512 | },
513 | {
514 | "name": "contains",
515 | "description": null,
516 | "type": {
517 | "kind": "SCALAR",
518 | "name": "ID",
519 | "ofType": null
520 | },
521 | "defaultValue": null
522 | },
523 | {
524 | "name": "notContains",
525 | "description": null,
526 | "type": {
527 | "kind": "SCALAR",
528 | "name": "ID",
529 | "ofType": null
530 | },
531 | "defaultValue": null
532 | },
533 | {
534 | "name": "between",
535 | "description": null,
536 | "type": {
537 | "kind": "LIST",
538 | "name": null,
539 | "ofType": {
540 | "kind": "SCALAR",
541 | "name": "ID",
542 | "ofType": null
543 | }
544 | },
545 | "defaultValue": null
546 | },
547 | {
548 | "name": "beginsWith",
549 | "description": null,
550 | "type": {
551 | "kind": "SCALAR",
552 | "name": "ID",
553 | "ofType": null
554 | },
555 | "defaultValue": null
556 | }
557 | ],
558 | "interfaces": null,
559 | "enumValues": null,
560 | "possibleTypes": null
561 | },
562 | {
563 | "kind": "INPUT_OBJECT",
564 | "name": "TableStringFilterInput",
565 | "description": null,
566 | "fields": null,
567 | "inputFields": [
568 | {
569 | "name": "ne",
570 | "description": null,
571 | "type": {
572 | "kind": "SCALAR",
573 | "name": "String",
574 | "ofType": null
575 | },
576 | "defaultValue": null
577 | },
578 | {
579 | "name": "eq",
580 | "description": null,
581 | "type": {
582 | "kind": "SCALAR",
583 | "name": "String",
584 | "ofType": null
585 | },
586 | "defaultValue": null
587 | },
588 | {
589 | "name": "le",
590 | "description": null,
591 | "type": {
592 | "kind": "SCALAR",
593 | "name": "String",
594 | "ofType": null
595 | },
596 | "defaultValue": null
597 | },
598 | {
599 | "name": "lt",
600 | "description": null,
601 | "type": {
602 | "kind": "SCALAR",
603 | "name": "String",
604 | "ofType": null
605 | },
606 | "defaultValue": null
607 | },
608 | {
609 | "name": "ge",
610 | "description": null,
611 | "type": {
612 | "kind": "SCALAR",
613 | "name": "String",
614 | "ofType": null
615 | },
616 | "defaultValue": null
617 | },
618 | {
619 | "name": "gt",
620 | "description": null,
621 | "type": {
622 | "kind": "SCALAR",
623 | "name": "String",
624 | "ofType": null
625 | },
626 | "defaultValue": null
627 | },
628 | {
629 | "name": "contains",
630 | "description": null,
631 | "type": {
632 | "kind": "SCALAR",
633 | "name": "String",
634 | "ofType": null
635 | },
636 | "defaultValue": null
637 | },
638 | {
639 | "name": "notContains",
640 | "description": null,
641 | "type": {
642 | "kind": "SCALAR",
643 | "name": "String",
644 | "ofType": null
645 | },
646 | "defaultValue": null
647 | },
648 | {
649 | "name": "between",
650 | "description": null,
651 | "type": {
652 | "kind": "LIST",
653 | "name": null,
654 | "ofType": {
655 | "kind": "SCALAR",
656 | "name": "String",
657 | "ofType": null
658 | }
659 | },
660 | "defaultValue": null
661 | },
662 | {
663 | "name": "beginsWith",
664 | "description": null,
665 | "type": {
666 | "kind": "SCALAR",
667 | "name": "String",
668 | "ofType": null
669 | },
670 | "defaultValue": null
671 | }
672 | ],
673 | "interfaces": null,
674 | "enumValues": null,
675 | "possibleTypes": null
676 | },
677 | {
678 | "kind": "OBJECT",
679 | "name": "Mutation",
680 | "description": null,
681 | "fields": [
682 | {
683 | "name": "createEvent",
684 | "description": " Create a single event.",
685 | "args": [
686 | {
687 | "name": "name",
688 | "description": null,
689 | "type": {
690 | "kind": "NON_NULL",
691 | "name": null,
692 | "ofType": {
693 | "kind": "SCALAR",
694 | "name": "String",
695 | "ofType": null
696 | }
697 | },
698 | "defaultValue": null
699 | },
700 | {
701 | "name": "when",
702 | "description": null,
703 | "type": {
704 | "kind": "NON_NULL",
705 | "name": null,
706 | "ofType": {
707 | "kind": "SCALAR",
708 | "name": "String",
709 | "ofType": null
710 | }
711 | },
712 | "defaultValue": null
713 | },
714 | {
715 | "name": "where",
716 | "description": null,
717 | "type": {
718 | "kind": "NON_NULL",
719 | "name": null,
720 | "ofType": {
721 | "kind": "SCALAR",
722 | "name": "String",
723 | "ofType": null
724 | }
725 | },
726 | "defaultValue": null
727 | },
728 | {
729 | "name": "description",
730 | "description": null,
731 | "type": {
732 | "kind": "NON_NULL",
733 | "name": null,
734 | "ofType": {
735 | "kind": "SCALAR",
736 | "name": "String",
737 | "ofType": null
738 | }
739 | },
740 | "defaultValue": null
741 | }
742 | ],
743 | "type": {
744 | "kind": "OBJECT",
745 | "name": "Event",
746 | "ofType": null
747 | },
748 | "isDeprecated": false,
749 | "deprecationReason": null
750 | },
751 | {
752 | "name": "deleteEvent",
753 | "description": " Delete a single event by id.",
754 | "args": [
755 | {
756 | "name": "id",
757 | "description": null,
758 | "type": {
759 | "kind": "NON_NULL",
760 | "name": null,
761 | "ofType": {
762 | "kind": "SCALAR",
763 | "name": "ID",
764 | "ofType": null
765 | }
766 | },
767 | "defaultValue": null
768 | }
769 | ],
770 | "type": {
771 | "kind": "OBJECT",
772 | "name": "Event",
773 | "ofType": null
774 | },
775 | "isDeprecated": false,
776 | "deprecationReason": null
777 | },
778 | {
779 | "name": "commentOnEvent",
780 | "description": " Comment on an event.",
781 | "args": [
782 | {
783 | "name": "eventId",
784 | "description": null,
785 | "type": {
786 | "kind": "NON_NULL",
787 | "name": null,
788 | "ofType": {
789 | "kind": "SCALAR",
790 | "name": "ID",
791 | "ofType": null
792 | }
793 | },
794 | "defaultValue": null
795 | },
796 | {
797 | "name": "content",
798 | "description": null,
799 | "type": {
800 | "kind": "NON_NULL",
801 | "name": null,
802 | "ofType": {
803 | "kind": "SCALAR",
804 | "name": "String",
805 | "ofType": null
806 | }
807 | },
808 | "defaultValue": null
809 | },
810 | {
811 | "name": "createdAt",
812 | "description": null,
813 | "type": {
814 | "kind": "NON_NULL",
815 | "name": null,
816 | "ofType": {
817 | "kind": "SCALAR",
818 | "name": "String",
819 | "ofType": null
820 | }
821 | },
822 | "defaultValue": null
823 | }
824 | ],
825 | "type": {
826 | "kind": "OBJECT",
827 | "name": "Comment",
828 | "ofType": null
829 | },
830 | "isDeprecated": false,
831 | "deprecationReason": null
832 | }
833 | ],
834 | "inputFields": null,
835 | "interfaces": [],
836 | "enumValues": null,
837 | "possibleTypes": null
838 | },
839 | {
840 | "kind": "OBJECT",
841 | "name": "Subscription",
842 | "description": null,
843 | "fields": [
844 | {
845 | "name": "subscribeToEventComments",
846 | "description": null,
847 | "args": [
848 | {
849 | "name": "eventId",
850 | "description": null,
851 | "type": {
852 | "kind": "NON_NULL",
853 | "name": null,
854 | "ofType": {
855 | "kind": "SCALAR",
856 | "name": "String",
857 | "ofType": null
858 | }
859 | },
860 | "defaultValue": null
861 | }
862 | ],
863 | "type": {
864 | "kind": "OBJECT",
865 | "name": "Comment",
866 | "ofType": null
867 | },
868 | "isDeprecated": false,
869 | "deprecationReason": null
870 | }
871 | ],
872 | "inputFields": null,
873 | "interfaces": [],
874 | "enumValues": null,
875 | "possibleTypes": null
876 | },
877 | {
878 | "kind": "INPUT_OBJECT",
879 | "name": "TableFloatFilterInput",
880 | "description": null,
881 | "fields": null,
882 | "inputFields": [
883 | {
884 | "name": "ne",
885 | "description": null,
886 | "type": {
887 | "kind": "SCALAR",
888 | "name": "Float",
889 | "ofType": null
890 | },
891 | "defaultValue": null
892 | },
893 | {
894 | "name": "eq",
895 | "description": null,
896 | "type": {
897 | "kind": "SCALAR",
898 | "name": "Float",
899 | "ofType": null
900 | },
901 | "defaultValue": null
902 | },
903 | {
904 | "name": "le",
905 | "description": null,
906 | "type": {
907 | "kind": "SCALAR",
908 | "name": "Float",
909 | "ofType": null
910 | },
911 | "defaultValue": null
912 | },
913 | {
914 | "name": "lt",
915 | "description": null,
916 | "type": {
917 | "kind": "SCALAR",
918 | "name": "Float",
919 | "ofType": null
920 | },
921 | "defaultValue": null
922 | },
923 | {
924 | "name": "ge",
925 | "description": null,
926 | "type": {
927 | "kind": "SCALAR",
928 | "name": "Float",
929 | "ofType": null
930 | },
931 | "defaultValue": null
932 | },
933 | {
934 | "name": "gt",
935 | "description": null,
936 | "type": {
937 | "kind": "SCALAR",
938 | "name": "Float",
939 | "ofType": null
940 | },
941 | "defaultValue": null
942 | },
943 | {
944 | "name": "contains",
945 | "description": null,
946 | "type": {
947 | "kind": "SCALAR",
948 | "name": "Float",
949 | "ofType": null
950 | },
951 | "defaultValue": null
952 | },
953 | {
954 | "name": "notContains",
955 | "description": null,
956 | "type": {
957 | "kind": "SCALAR",
958 | "name": "Float",
959 | "ofType": null
960 | },
961 | "defaultValue": null
962 | },
963 | {
964 | "name": "between",
965 | "description": null,
966 | "type": {
967 | "kind": "LIST",
968 | "name": null,
969 | "ofType": {
970 | "kind": "SCALAR",
971 | "name": "Float",
972 | "ofType": null
973 | }
974 | },
975 | "defaultValue": null
976 | }
977 | ],
978 | "interfaces": null,
979 | "enumValues": null,
980 | "possibleTypes": null
981 | },
982 | {
983 | "kind": "SCALAR",
984 | "name": "Float",
985 | "description": "Built-in Float",
986 | "fields": null,
987 | "inputFields": null,
988 | "interfaces": null,
989 | "enumValues": null,
990 | "possibleTypes": null
991 | },
992 | {
993 | "kind": "INPUT_OBJECT",
994 | "name": "TableIntFilterInput",
995 | "description": null,
996 | "fields": null,
997 | "inputFields": [
998 | {
999 | "name": "ne",
1000 | "description": null,
1001 | "type": {
1002 | "kind": "SCALAR",
1003 | "name": "Int",
1004 | "ofType": null
1005 | },
1006 | "defaultValue": null
1007 | },
1008 | {
1009 | "name": "eq",
1010 | "description": null,
1011 | "type": {
1012 | "kind": "SCALAR",
1013 | "name": "Int",
1014 | "ofType": null
1015 | },
1016 | "defaultValue": null
1017 | },
1018 | {
1019 | "name": "le",
1020 | "description": null,
1021 | "type": {
1022 | "kind": "SCALAR",
1023 | "name": "Int",
1024 | "ofType": null
1025 | },
1026 | "defaultValue": null
1027 | },
1028 | {
1029 | "name": "lt",
1030 | "description": null,
1031 | "type": {
1032 | "kind": "SCALAR",
1033 | "name": "Int",
1034 | "ofType": null
1035 | },
1036 | "defaultValue": null
1037 | },
1038 | {
1039 | "name": "ge",
1040 | "description": null,
1041 | "type": {
1042 | "kind": "SCALAR",
1043 | "name": "Int",
1044 | "ofType": null
1045 | },
1046 | "defaultValue": null
1047 | },
1048 | {
1049 | "name": "gt",
1050 | "description": null,
1051 | "type": {
1052 | "kind": "SCALAR",
1053 | "name": "Int",
1054 | "ofType": null
1055 | },
1056 | "defaultValue": null
1057 | },
1058 | {
1059 | "name": "contains",
1060 | "description": null,
1061 | "type": {
1062 | "kind": "SCALAR",
1063 | "name": "Int",
1064 | "ofType": null
1065 | },
1066 | "defaultValue": null
1067 | },
1068 | {
1069 | "name": "notContains",
1070 | "description": null,
1071 | "type": {
1072 | "kind": "SCALAR",
1073 | "name": "Int",
1074 | "ofType": null
1075 | },
1076 | "defaultValue": null
1077 | },
1078 | {
1079 | "name": "between",
1080 | "description": null,
1081 | "type": {
1082 | "kind": "LIST",
1083 | "name": null,
1084 | "ofType": {
1085 | "kind": "SCALAR",
1086 | "name": "Int",
1087 | "ofType": null
1088 | }
1089 | },
1090 | "defaultValue": null
1091 | }
1092 | ],
1093 | "interfaces": null,
1094 | "enumValues": null,
1095 | "possibleTypes": null
1096 | },
1097 | {
1098 | "kind": "INPUT_OBJECT",
1099 | "name": "TableBooleanFilterInput",
1100 | "description": null,
1101 | "fields": null,
1102 | "inputFields": [
1103 | {
1104 | "name": "ne",
1105 | "description": null,
1106 | "type": {
1107 | "kind": "SCALAR",
1108 | "name": "Boolean",
1109 | "ofType": null
1110 | },
1111 | "defaultValue": null
1112 | },
1113 | {
1114 | "name": "eq",
1115 | "description": null,
1116 | "type": {
1117 | "kind": "SCALAR",
1118 | "name": "Boolean",
1119 | "ofType": null
1120 | },
1121 | "defaultValue": null
1122 | }
1123 | ],
1124 | "interfaces": null,
1125 | "enumValues": null,
1126 | "possibleTypes": null
1127 | },
1128 | {
1129 | "kind": "SCALAR",
1130 | "name": "Boolean",
1131 | "description": "Built-in Boolean",
1132 | "fields": null,
1133 | "inputFields": null,
1134 | "interfaces": null,
1135 | "enumValues": null,
1136 | "possibleTypes": null
1137 | },
1138 | {
1139 | "kind": "OBJECT",
1140 | "name": "__Schema",
1141 | "description": "A GraphQL Introspection defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, the entry points for query, mutation, and subscription operations.",
1142 | "fields": [
1143 | {
1144 | "name": "types",
1145 | "description": "A list of all types supported by this server.",
1146 | "args": [],
1147 | "type": {
1148 | "kind": "NON_NULL",
1149 | "name": null,
1150 | "ofType": {
1151 | "kind": "LIST",
1152 | "name": null,
1153 | "ofType": {
1154 | "kind": "NON_NULL",
1155 | "name": null,
1156 | "ofType": {
1157 | "kind": "OBJECT",
1158 | "name": "__Type"
1159 | }
1160 | }
1161 | }
1162 | },
1163 | "isDeprecated": false,
1164 | "deprecationReason": null
1165 | },
1166 | {
1167 | "name": "queryType",
1168 | "description": "The type that query operations will be rooted at.",
1169 | "args": [],
1170 | "type": {
1171 | "kind": "NON_NULL",
1172 | "name": null,
1173 | "ofType": {
1174 | "kind": "OBJECT",
1175 | "name": "__Type",
1176 | "ofType": null
1177 | }
1178 | },
1179 | "isDeprecated": false,
1180 | "deprecationReason": null
1181 | },
1182 | {
1183 | "name": "mutationType",
1184 | "description": "If this server supports mutation, the type that mutation operations will be rooted at.",
1185 | "args": [],
1186 | "type": {
1187 | "kind": "OBJECT",
1188 | "name": "__Type",
1189 | "ofType": null
1190 | },
1191 | "isDeprecated": false,
1192 | "deprecationReason": null
1193 | },
1194 | {
1195 | "name": "directives",
1196 | "description": "'A list of all directives supported by this server.",
1197 | "args": [],
1198 | "type": {
1199 | "kind": "NON_NULL",
1200 | "name": null,
1201 | "ofType": {
1202 | "kind": "LIST",
1203 | "name": null,
1204 | "ofType": {
1205 | "kind": "NON_NULL",
1206 | "name": null,
1207 | "ofType": {
1208 | "kind": "OBJECT",
1209 | "name": "__Directive"
1210 | }
1211 | }
1212 | }
1213 | },
1214 | "isDeprecated": false,
1215 | "deprecationReason": null
1216 | },
1217 | {
1218 | "name": "subscriptionType",
1219 | "description": "'If this server support subscription, the type that subscription operations will be rooted at.",
1220 | "args": [],
1221 | "type": {
1222 | "kind": "OBJECT",
1223 | "name": "__Type",
1224 | "ofType": null
1225 | },
1226 | "isDeprecated": false,
1227 | "deprecationReason": null
1228 | }
1229 | ],
1230 | "inputFields": null,
1231 | "interfaces": [],
1232 | "enumValues": null,
1233 | "possibleTypes": null
1234 | },
1235 | {
1236 | "kind": "OBJECT",
1237 | "name": "__Type",
1238 | "description": null,
1239 | "fields": [
1240 | {
1241 | "name": "kind",
1242 | "description": null,
1243 | "args": [],
1244 | "type": {
1245 | "kind": "NON_NULL",
1246 | "name": null,
1247 | "ofType": {
1248 | "kind": "ENUM",
1249 | "name": "__TypeKind",
1250 | "ofType": null
1251 | }
1252 | },
1253 | "isDeprecated": false,
1254 | "deprecationReason": null
1255 | },
1256 | {
1257 | "name": "name",
1258 | "description": null,
1259 | "args": [],
1260 | "type": {
1261 | "kind": "SCALAR",
1262 | "name": "String",
1263 | "ofType": null
1264 | },
1265 | "isDeprecated": false,
1266 | "deprecationReason": null
1267 | },
1268 | {
1269 | "name": "description",
1270 | "description": null,
1271 | "args": [],
1272 | "type": {
1273 | "kind": "SCALAR",
1274 | "name": "String",
1275 | "ofType": null
1276 | },
1277 | "isDeprecated": false,
1278 | "deprecationReason": null
1279 | },
1280 | {
1281 | "name": "fields",
1282 | "description": null,
1283 | "args": [
1284 | {
1285 | "name": "includeDeprecated",
1286 | "description": null,
1287 | "type": {
1288 | "kind": "SCALAR",
1289 | "name": "Boolean",
1290 | "ofType": null
1291 | },
1292 | "defaultValue": "false"
1293 | }
1294 | ],
1295 | "type": {
1296 | "kind": "LIST",
1297 | "name": null,
1298 | "ofType": {
1299 | "kind": "NON_NULL",
1300 | "name": null,
1301 | "ofType": {
1302 | "kind": "OBJECT",
1303 | "name": "__Field",
1304 | "ofType": null
1305 | }
1306 | }
1307 | },
1308 | "isDeprecated": false,
1309 | "deprecationReason": null
1310 | },
1311 | {
1312 | "name": "interfaces",
1313 | "description": null,
1314 | "args": [],
1315 | "type": {
1316 | "kind": "LIST",
1317 | "name": null,
1318 | "ofType": {
1319 | "kind": "NON_NULL",
1320 | "name": null,
1321 | "ofType": {
1322 | "kind": "OBJECT",
1323 | "name": "__Type",
1324 | "ofType": null
1325 | }
1326 | }
1327 | },
1328 | "isDeprecated": false,
1329 | "deprecationReason": null
1330 | },
1331 | {
1332 | "name": "possibleTypes",
1333 | "description": null,
1334 | "args": [],
1335 | "type": {
1336 | "kind": "LIST",
1337 | "name": null,
1338 | "ofType": {
1339 | "kind": "NON_NULL",
1340 | "name": null,
1341 | "ofType": {
1342 | "kind": "OBJECT",
1343 | "name": "__Type",
1344 | "ofType": null
1345 | }
1346 | }
1347 | },
1348 | "isDeprecated": false,
1349 | "deprecationReason": null
1350 | },
1351 | {
1352 | "name": "enumValues",
1353 | "description": null,
1354 | "args": [
1355 | {
1356 | "name": "includeDeprecated",
1357 | "description": null,
1358 | "type": {
1359 | "kind": "SCALAR",
1360 | "name": "Boolean",
1361 | "ofType": null
1362 | },
1363 | "defaultValue": "false"
1364 | }
1365 | ],
1366 | "type": {
1367 | "kind": "LIST",
1368 | "name": null,
1369 | "ofType": {
1370 | "kind": "NON_NULL",
1371 | "name": null,
1372 | "ofType": {
1373 | "kind": "OBJECT",
1374 | "name": "__EnumValue",
1375 | "ofType": null
1376 | }
1377 | }
1378 | },
1379 | "isDeprecated": false,
1380 | "deprecationReason": null
1381 | },
1382 | {
1383 | "name": "inputFields",
1384 | "description": null,
1385 | "args": [],
1386 | "type": {
1387 | "kind": "LIST",
1388 | "name": null,
1389 | "ofType": {
1390 | "kind": "NON_NULL",
1391 | "name": null,
1392 | "ofType": {
1393 | "kind": "OBJECT",
1394 | "name": "__InputValue",
1395 | "ofType": null
1396 | }
1397 | }
1398 | },
1399 | "isDeprecated": false,
1400 | "deprecationReason": null
1401 | },
1402 | {
1403 | "name": "ofType",
1404 | "description": null,
1405 | "args": [],
1406 | "type": {
1407 | "kind": "OBJECT",
1408 | "name": "__Type",
1409 | "ofType": null
1410 | },
1411 | "isDeprecated": false,
1412 | "deprecationReason": null
1413 | }
1414 | ],
1415 | "inputFields": null,
1416 | "interfaces": [],
1417 | "enumValues": null,
1418 | "possibleTypes": null
1419 | },
1420 | {
1421 | "kind": "ENUM",
1422 | "name": "__TypeKind",
1423 | "description": "An enum describing what kind of type a given __Type is",
1424 | "fields": null,
1425 | "inputFields": null,
1426 | "interfaces": null,
1427 | "enumValues": [
1428 | {
1429 | "name": "SCALAR",
1430 | "description": "Indicates this type is a scalar.",
1431 | "isDeprecated": false,
1432 | "deprecationReason": null
1433 | },
1434 | {
1435 | "name": "OBJECT",
1436 | "description": "Indicates this type is an object. `fields` and `interfaces` are valid fields.",
1437 | "isDeprecated": false,
1438 | "deprecationReason": null
1439 | },
1440 | {
1441 | "name": "INTERFACE",
1442 | "description": "Indicates this type is an interface. `fields` and `possibleTypes` are valid fields.",
1443 | "isDeprecated": false,
1444 | "deprecationReason": null
1445 | },
1446 | {
1447 | "name": "UNION",
1448 | "description": "Indicates this type is a union. `possibleTypes` is a valid field.",
1449 | "isDeprecated": false,
1450 | "deprecationReason": null
1451 | },
1452 | {
1453 | "name": "ENUM",
1454 | "description": "Indicates this type is an enum. `enumValues` is a valid field.",
1455 | "isDeprecated": false,
1456 | "deprecationReason": null
1457 | },
1458 | {
1459 | "name": "INPUT_OBJECT",
1460 | "description": "Indicates this type is an input object. `inputFields` is a valid field.",
1461 | "isDeprecated": false,
1462 | "deprecationReason": null
1463 | },
1464 | {
1465 | "name": "LIST",
1466 | "description": "Indicates this type is a list. `ofType` is a valid field.",
1467 | "isDeprecated": false,
1468 | "deprecationReason": null
1469 | },
1470 | {
1471 | "name": "NON_NULL",
1472 | "description": "Indicates this type is a non-null. `ofType` is a valid field.",
1473 | "isDeprecated": false,
1474 | "deprecationReason": null
1475 | }
1476 | ],
1477 | "possibleTypes": null
1478 | },
1479 | {
1480 | "kind": "OBJECT",
1481 | "name": "__Field",
1482 | "description": null,
1483 | "fields": [
1484 | {
1485 | "name": "name",
1486 | "description": null,
1487 | "args": [],
1488 | "type": {
1489 | "kind": "NON_NULL",
1490 | "name": null,
1491 | "ofType": {
1492 | "kind": "SCALAR",
1493 | "name": "String",
1494 | "ofType": null
1495 | }
1496 | },
1497 | "isDeprecated": false,
1498 | "deprecationReason": null
1499 | },
1500 | {
1501 | "name": "description",
1502 | "description": null,
1503 | "args": [],
1504 | "type": {
1505 | "kind": "SCALAR",
1506 | "name": "String",
1507 | "ofType": null
1508 | },
1509 | "isDeprecated": false,
1510 | "deprecationReason": null
1511 | },
1512 | {
1513 | "name": "args",
1514 | "description": null,
1515 | "args": [],
1516 | "type": {
1517 | "kind": "NON_NULL",
1518 | "name": null,
1519 | "ofType": {
1520 | "kind": "LIST",
1521 | "name": null,
1522 | "ofType": {
1523 | "kind": "NON_NULL",
1524 | "name": null,
1525 | "ofType": {
1526 | "kind": "OBJECT",
1527 | "name": "__InputValue"
1528 | }
1529 | }
1530 | }
1531 | },
1532 | "isDeprecated": false,
1533 | "deprecationReason": null
1534 | },
1535 | {
1536 | "name": "type",
1537 | "description": null,
1538 | "args": [],
1539 | "type": {
1540 | "kind": "NON_NULL",
1541 | "name": null,
1542 | "ofType": {
1543 | "kind": "OBJECT",
1544 | "name": "__Type",
1545 | "ofType": null
1546 | }
1547 | },
1548 | "isDeprecated": false,
1549 | "deprecationReason": null
1550 | },
1551 | {
1552 | "name": "isDeprecated",
1553 | "description": null,
1554 | "args": [],
1555 | "type": {
1556 | "kind": "NON_NULL",
1557 | "name": null,
1558 | "ofType": {
1559 | "kind": "SCALAR",
1560 | "name": "Boolean",
1561 | "ofType": null
1562 | }
1563 | },
1564 | "isDeprecated": false,
1565 | "deprecationReason": null
1566 | },
1567 | {
1568 | "name": "deprecationReason",
1569 | "description": null,
1570 | "args": [],
1571 | "type": {
1572 | "kind": "SCALAR",
1573 | "name": "String",
1574 | "ofType": null
1575 | },
1576 | "isDeprecated": false,
1577 | "deprecationReason": null
1578 | }
1579 | ],
1580 | "inputFields": null,
1581 | "interfaces": [],
1582 | "enumValues": null,
1583 | "possibleTypes": null
1584 | },
1585 | {
1586 | "kind": "OBJECT",
1587 | "name": "__InputValue",
1588 | "description": null,
1589 | "fields": [
1590 | {
1591 | "name": "name",
1592 | "description": null,
1593 | "args": [],
1594 | "type": {
1595 | "kind": "NON_NULL",
1596 | "name": null,
1597 | "ofType": {
1598 | "kind": "SCALAR",
1599 | "name": "String",
1600 | "ofType": null
1601 | }
1602 | },
1603 | "isDeprecated": false,
1604 | "deprecationReason": null
1605 | },
1606 | {
1607 | "name": "description",
1608 | "description": null,
1609 | "args": [],
1610 | "type": {
1611 | "kind": "SCALAR",
1612 | "name": "String",
1613 | "ofType": null
1614 | },
1615 | "isDeprecated": false,
1616 | "deprecationReason": null
1617 | },
1618 | {
1619 | "name": "type",
1620 | "description": null,
1621 | "args": [],
1622 | "type": {
1623 | "kind": "NON_NULL",
1624 | "name": null,
1625 | "ofType": {
1626 | "kind": "OBJECT",
1627 | "name": "__Type",
1628 | "ofType": null
1629 | }
1630 | },
1631 | "isDeprecated": false,
1632 | "deprecationReason": null
1633 | },
1634 | {
1635 | "name": "defaultValue",
1636 | "description": null,
1637 | "args": [],
1638 | "type": {
1639 | "kind": "SCALAR",
1640 | "name": "String",
1641 | "ofType": null
1642 | },
1643 | "isDeprecated": false,
1644 | "deprecationReason": null
1645 | }
1646 | ],
1647 | "inputFields": null,
1648 | "interfaces": [],
1649 | "enumValues": null,
1650 | "possibleTypes": null
1651 | },
1652 | {
1653 | "kind": "OBJECT",
1654 | "name": "__EnumValue",
1655 | "description": null,
1656 | "fields": [
1657 | {
1658 | "name": "name",
1659 | "description": null,
1660 | "args": [],
1661 | "type": {
1662 | "kind": "NON_NULL",
1663 | "name": null,
1664 | "ofType": {
1665 | "kind": "SCALAR",
1666 | "name": "String",
1667 | "ofType": null
1668 | }
1669 | },
1670 | "isDeprecated": false,
1671 | "deprecationReason": null
1672 | },
1673 | {
1674 | "name": "description",
1675 | "description": null,
1676 | "args": [],
1677 | "type": {
1678 | "kind": "SCALAR",
1679 | "name": "String",
1680 | "ofType": null
1681 | },
1682 | "isDeprecated": false,
1683 | "deprecationReason": null
1684 | },
1685 | {
1686 | "name": "isDeprecated",
1687 | "description": null,
1688 | "args": [],
1689 | "type": {
1690 | "kind": "NON_NULL",
1691 | "name": null,
1692 | "ofType": {
1693 | "kind": "SCALAR",
1694 | "name": "Boolean",
1695 | "ofType": null
1696 | }
1697 | },
1698 | "isDeprecated": false,
1699 | "deprecationReason": null
1700 | },
1701 | {
1702 | "name": "deprecationReason",
1703 | "description": null,
1704 | "args": [],
1705 | "type": {
1706 | "kind": "SCALAR",
1707 | "name": "String",
1708 | "ofType": null
1709 | },
1710 | "isDeprecated": false,
1711 | "deprecationReason": null
1712 | }
1713 | ],
1714 | "inputFields": null,
1715 | "interfaces": [],
1716 | "enumValues": null,
1717 | "possibleTypes": null
1718 | },
1719 | {
1720 | "kind": "OBJECT",
1721 | "name": "__Directive",
1722 | "description": null,
1723 | "fields": [
1724 | {
1725 | "name": "name",
1726 | "description": null,
1727 | "args": [],
1728 | "type": {
1729 | "kind": "SCALAR",
1730 | "name": "String",
1731 | "ofType": null
1732 | },
1733 | "isDeprecated": false,
1734 | "deprecationReason": null
1735 | },
1736 | {
1737 | "name": "description",
1738 | "description": null,
1739 | "args": [],
1740 | "type": {
1741 | "kind": "SCALAR",
1742 | "name": "String",
1743 | "ofType": null
1744 | },
1745 | "isDeprecated": false,
1746 | "deprecationReason": null
1747 | },
1748 | {
1749 | "name": "locations",
1750 | "description": null,
1751 | "args": [],
1752 | "type": {
1753 | "kind": "LIST",
1754 | "name": null,
1755 | "ofType": {
1756 | "kind": "NON_NULL",
1757 | "name": null,
1758 | "ofType": {
1759 | "kind": "ENUM",
1760 | "name": "__DirectiveLocation",
1761 | "ofType": null
1762 | }
1763 | }
1764 | },
1765 | "isDeprecated": false,
1766 | "deprecationReason": null
1767 | },
1768 | {
1769 | "name": "args",
1770 | "description": null,
1771 | "args": [],
1772 | "type": {
1773 | "kind": "NON_NULL",
1774 | "name": null,
1775 | "ofType": {
1776 | "kind": "LIST",
1777 | "name": null,
1778 | "ofType": {
1779 | "kind": "NON_NULL",
1780 | "name": null,
1781 | "ofType": {
1782 | "kind": "OBJECT",
1783 | "name": "__InputValue"
1784 | }
1785 | }
1786 | }
1787 | },
1788 | "isDeprecated": false,
1789 | "deprecationReason": null
1790 | },
1791 | {
1792 | "name": "onOperation",
1793 | "description": null,
1794 | "args": [],
1795 | "type": {
1796 | "kind": "SCALAR",
1797 | "name": "Boolean",
1798 | "ofType": null
1799 | },
1800 | "isDeprecated": true,
1801 | "deprecationReason": "Use `locations`."
1802 | },
1803 | {
1804 | "name": "onFragment",
1805 | "description": null,
1806 | "args": [],
1807 | "type": {
1808 | "kind": "SCALAR",
1809 | "name": "Boolean",
1810 | "ofType": null
1811 | },
1812 | "isDeprecated": true,
1813 | "deprecationReason": "Use `locations`."
1814 | },
1815 | {
1816 | "name": "onField",
1817 | "description": null,
1818 | "args": [],
1819 | "type": {
1820 | "kind": "SCALAR",
1821 | "name": "Boolean",
1822 | "ofType": null
1823 | },
1824 | "isDeprecated": true,
1825 | "deprecationReason": "Use `locations`."
1826 | }
1827 | ],
1828 | "inputFields": null,
1829 | "interfaces": [],
1830 | "enumValues": null,
1831 | "possibleTypes": null
1832 | },
1833 | {
1834 | "kind": "ENUM",
1835 | "name": "__DirectiveLocation",
1836 | "description": "An enum describing valid locations where a directive can be placed",
1837 | "fields": null,
1838 | "inputFields": null,
1839 | "interfaces": null,
1840 | "enumValues": [
1841 | {
1842 | "name": "QUERY",
1843 | "description": "Indicates the directive is valid on queries.",
1844 | "isDeprecated": false,
1845 | "deprecationReason": null
1846 | },
1847 | {
1848 | "name": "MUTATION",
1849 | "description": "Indicates the directive is valid on mutations.",
1850 | "isDeprecated": false,
1851 | "deprecationReason": null
1852 | },
1853 | {
1854 | "name": "FIELD",
1855 | "description": "Indicates the directive is valid on fields.",
1856 | "isDeprecated": false,
1857 | "deprecationReason": null
1858 | },
1859 | {
1860 | "name": "FRAGMENT_DEFINITION",
1861 | "description": "Indicates the directive is valid on fragment definitions.",
1862 | "isDeprecated": false,
1863 | "deprecationReason": null
1864 | },
1865 | {
1866 | "name": "FRAGMENT_SPREAD",
1867 | "description": "Indicates the directive is valid on fragment spreads.",
1868 | "isDeprecated": false,
1869 | "deprecationReason": null
1870 | },
1871 | {
1872 | "name": "INLINE_FRAGMENT",
1873 | "description": "Indicates the directive is valid on inline fragments.",
1874 | "isDeprecated": false,
1875 | "deprecationReason": null
1876 | },
1877 | {
1878 | "name": "SCHEMA",
1879 | "description": "Indicates the directive is valid on a schema SDL definition.",
1880 | "isDeprecated": false,
1881 | "deprecationReason": null
1882 | },
1883 | {
1884 | "name": "SCALAR",
1885 | "description": "Indicates the directive is valid on a scalar SDL definition.",
1886 | "isDeprecated": false,
1887 | "deprecationReason": null
1888 | },
1889 | {
1890 | "name": "OBJECT",
1891 | "description": "Indicates the directive is valid on an object SDL definition.",
1892 | "isDeprecated": false,
1893 | "deprecationReason": null
1894 | },
1895 | {
1896 | "name": "FIELD_DEFINITION",
1897 | "description": "Indicates the directive is valid on a field SDL definition.",
1898 | "isDeprecated": false,
1899 | "deprecationReason": null
1900 | },
1901 | {
1902 | "name": "ARGUMENT_DEFINITION",
1903 | "description": "Indicates the directive is valid on a field argument SDL definition.",
1904 | "isDeprecated": false,
1905 | "deprecationReason": null
1906 | },
1907 | {
1908 | "name": "INTERFACE",
1909 | "description": "Indicates the directive is valid on an interface SDL definition.",
1910 | "isDeprecated": false,
1911 | "deprecationReason": null
1912 | },
1913 | {
1914 | "name": "UNION",
1915 | "description": "Indicates the directive is valid on an union SDL definition.",
1916 | "isDeprecated": false,
1917 | "deprecationReason": null
1918 | },
1919 | {
1920 | "name": "ENUM",
1921 | "description": "Indicates the directive is valid on an enum SDL definition.",
1922 | "isDeprecated": false,
1923 | "deprecationReason": null
1924 | },
1925 | {
1926 | "name": "ENUM_VALUE",
1927 | "description": "Indicates the directive is valid on an enum value SDL definition.",
1928 | "isDeprecated": false,
1929 | "deprecationReason": null
1930 | },
1931 | {
1932 | "name": "INPUT_OBJECT",
1933 | "description": "Indicates the directive is valid on an input object SDL definition.",
1934 | "isDeprecated": false,
1935 | "deprecationReason": null
1936 | },
1937 | {
1938 | "name": "INPUT_FIELD_DEFINITION",
1939 | "description": "Indicates the directive is valid on an input object field SDL definition.",
1940 | "isDeprecated": false,
1941 | "deprecationReason": null
1942 | }
1943 | ],
1944 | "possibleTypes": null
1945 | }
1946 | ],
1947 | "directives": [
1948 | {
1949 | "name": "include",
1950 | "description": "Directs the executor to include this field or fragment only when the `if` argument is true",
1951 | "args": [
1952 | {
1953 | "name": "if",
1954 | "description": "Included when true.",
1955 | "type": {
1956 | "kind": "NON_NULL",
1957 | "name": null,
1958 | "ofType": {
1959 | "kind": "SCALAR",
1960 | "name": "Boolean",
1961 | "ofType": null
1962 | }
1963 | },
1964 | "defaultValue": null
1965 | }
1966 | ],
1967 | "onOperation": false,
1968 | "onFragment": true,
1969 | "onField": true
1970 | },
1971 | {
1972 | "name": "skip",
1973 | "description": "Directs the executor to skip this field or fragment when the `if`'argument is true.",
1974 | "args": [
1975 | {
1976 | "name": "if",
1977 | "description": "Skipped when true.",
1978 | "type": {
1979 | "kind": "NON_NULL",
1980 | "name": null,
1981 | "ofType": {
1982 | "kind": "SCALAR",
1983 | "name": "Boolean",
1984 | "ofType": null
1985 | }
1986 | },
1987 | "defaultValue": null
1988 | }
1989 | ],
1990 | "onOperation": false,
1991 | "onFragment": true,
1992 | "onField": true
1993 | },
1994 | {
1995 | "name": "defer",
1996 | "description": "This directive allows results to be deferred during execution",
1997 | "args": [],
1998 | "onOperation": false,
1999 | "onFragment": false,
2000 | "onField": true
2001 | },
2002 | {
2003 | "name": "deprecated",
2004 | "description": null,
2005 | "args": [
2006 | {
2007 | "name": "reason",
2008 | "description": null,
2009 | "type": {
2010 | "kind": "SCALAR",
2011 | "name": "String",
2012 | "ofType": null
2013 | },
2014 | "defaultValue": "\"No longer supported\""
2015 | }
2016 | ],
2017 | "onOperation": false,
2018 | "onFragment": false,
2019 | "onField": false
2020 | },
2021 | {
2022 | "name": "aws_auth",
2023 | "description": "Directs the schema to enforce authorization on a field",
2024 | "args": [
2025 | {
2026 | "name": "cognito_groups",
2027 | "description": "List of cognito user pool groups which have access on this field",
2028 | "type": {
2029 | "kind": "LIST",
2030 | "name": null,
2031 | "ofType": {
2032 | "kind": "SCALAR",
2033 | "name": "String",
2034 | "ofType": null
2035 | }
2036 | },
2037 | "defaultValue": null
2038 | }
2039 | ],
2040 | "onOperation": false,
2041 | "onFragment": false,
2042 | "onField": false
2043 | },
2044 | {
2045 | "name": "aws_publish",
2046 | "description": "Tells the service which subscriptions will be published to when this mutation is called.",
2047 | "args": [
2048 | {
2049 | "name": "subscriptions",
2050 | "description": "List of subscriptions which will be published to when this mutation is called.",
2051 | "type": {
2052 | "kind": "LIST",
2053 | "name": null,
2054 | "ofType": {
2055 | "kind": "SCALAR",
2056 | "name": "String",
2057 | "ofType": null
2058 | }
2059 | },
2060 | "defaultValue": null
2061 | }
2062 | ],
2063 | "onOperation": false,
2064 | "onFragment": false,
2065 | "onField": false
2066 | },
2067 | {
2068 | "name": "aws_subscribe",
2069 | "description": "Tells the service which mutation triggers this subscription.",
2070 | "args": [
2071 | {
2072 | "name": "mutations",
2073 | "description": "List of mutations which will trigger this subscription when they are called.",
2074 | "type": {
2075 | "kind": "LIST",
2076 | "name": null,
2077 | "ofType": {
2078 | "kind": "SCALAR",
2079 | "name": "String",
2080 | "ofType": null
2081 | }
2082 | },
2083 | "defaultValue": null
2084 | }
2085 | ],
2086 | "onOperation": false,
2087 | "onFragment": false,
2088 | "onField": false
2089 | }
2090 | ]
2091 | }
2092 | }
2093 | }
--------------------------------------------------------------------------------