From af2bcdda0b9fae8cf253a1c8b53593bf0796e29b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Loren=20=F0=9F=A4=93?= <lorensr@gmail.com> Date: Tue, 21 Jul 2020 21:51:12 -0400 Subject: [PATCH 1/6] Remove data fetching --- README.md | 27 ------------- .../guide/graphql/toc/Chapters.graphql | 7 ---- .../guide/graphql/toc/Sections.graphql | 8 ---- .../graphql/guide/graphql/toc/schema.json | 1 - .../java/guide/graphql/toc/data/Apollo.kt | 13 ------- .../java/guide/graphql/toc/data/Resource.kt | 39 ------------------- .../toc/ui/chapters/ChaptersAdapter.kt | 25 +++--------- .../toc/ui/chapters/ChaptersFragment.kt | 35 +++-------------- .../toc/ui/sections/SectionsAdapter.kt | 23 ++--------- .../toc/ui/sections/SectionsFragment.kt | 38 +----------------- 10 files changed, 15 insertions(+), 201 deletions(-) delete mode 100644 README.md delete mode 100644 app/src/main/graphql/guide/graphql/toc/Chapters.graphql delete mode 100644 app/src/main/graphql/guide/graphql/toc/Sections.graphql delete mode 100644 app/src/main/graphql/guide/graphql/toc/schema.json delete mode 100644 app/src/main/java/guide/graphql/toc/data/Apollo.kt delete mode 100644 app/src/main/java/guide/graphql/toc/data/Resource.kt diff --git a/README.md b/README.md deleted file mode 100644 index 9c5efdc..0000000 --- a/README.md +++ /dev/null @@ -1,27 +0,0 @@ -## Supporting - -If you'd like to read the GraphQL Guide, and if you can afford to purchase it or if your company reimburses you for educational materials (most do 👍), we would value your support: [https://graphql.guide](https://graphql.guide). - -## Chapter 10: Android - -Numbered branches (`0` and up) have the most up-to-date code (often newer than the most recent published revision of the book). When code has changed between book revisions, a new code version is created, and each branch is tagged, with the naming format `[step]_[version]`. For instance, revision `r6` of the book was published with version `0.1.0` of this repo, so the tag for step 5 was [`5_0.1.0`](https://github.com/GraphQLGuide/guide-android/releases/tag/5_0.1.0). - -## Contributors - -[/GraphQLGuide/guide-android/graphs/contributors](https://github.com/GraphQLGuide/guide-android/graphs/contributors) - -Thank you to everyone who has contributed 😃🙌 - -## Contributing - -We welcome issues and PRs! For large changes, we recommend opening an issue first to get feedback before putting in the work of a PR. Minor things like typo fixes can go directly to PRs and will usually get a quick response 😊 - -When editing code that's part of the book, submit the PR to the corresponding step branch (eg branch `3` for step 3) instead of to `master`. - - - -*Setting the base branch to step `3`* - ---- - -[CHANGELOG](https://github.com/GraphQLGuide/guide-android/blob/master/CHANGELOG.md) diff --git a/app/src/main/graphql/guide/graphql/toc/Chapters.graphql b/app/src/main/graphql/guide/graphql/toc/Chapters.graphql deleted file mode 100644 index 34ba164..0000000 --- a/app/src/main/graphql/guide/graphql/toc/Chapters.graphql +++ /dev/null @@ -1,7 +0,0 @@ -query Chapters { - chapters { - id - number - title - } -} diff --git a/app/src/main/graphql/guide/graphql/toc/Sections.graphql b/app/src/main/graphql/guide/graphql/toc/Sections.graphql deleted file mode 100644 index 3f11642..0000000 --- a/app/src/main/graphql/guide/graphql/toc/Sections.graphql +++ /dev/null @@ -1,8 +0,0 @@ -query Sections($id: Int!) { - chapter(id: $id) { - sections { - number - title - } - } -} \ No newline at end of file diff --git a/app/src/main/graphql/guide/graphql/toc/schema.json b/app/src/main/graphql/guide/graphql/toc/schema.json deleted file mode 100644 index d6eafa5..0000000 --- a/app/src/main/graphql/guide/graphql/toc/schema.json +++ /dev/null @@ -1 +0,0 @@ -{"data":{"__schema":{"directives":[{"args":[{"defaultValue":null,"description":"Skipped when true.","name":"if","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}}}],"description":"Directs the executor to skip this field or fragment when the `if` argument is true.","locations":["FIELD","FRAGMENT_SPREAD","INLINE_FRAGMENT"],"name":"skip"},{"args":[{"defaultValue":null,"description":"Included when true.","name":"if","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}}}],"description":"Directs the executor to include this field or fragment only when the `if` argument is true.","locations":["FIELD","FRAGMENT_SPREAD","INLINE_FRAGMENT"],"name":"include"},{"args":[{"defaultValue":"\"No longer supported\"","description":"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted in [Markdown](https://daringfireball.net/projects/markdown/).","name":"reason","type":{"kind":"SCALAR","name":"String","ofType":null}}],"description":"Marks an element of a GraphQL schema as no longer supported.","locations":["FIELD_DEFINITION","ENUM_VALUE"],"name":"deprecated"}],"mutationType":{"name":"Mutation"},"queryType":{"name":"Query"},"subscriptionType":{"name":"Subscription"},"types":[{"description":"","enumValues":null,"fields":[{"args":[],"deprecationReason":null,"description":"A placeholder, please ignore","isDeprecated":false,"name":"xxx","type":{"kind":"SCALAR","name":"Int","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"lastCreatedAt","type":{"kind":"SCALAR","name":"Float","ofType":null}},{"defaultValue":null,"description":"","name":"limit","type":{"kind":"SCALAR","name":"Int","ofType":null}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"sections","type":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"Section","ofType":null}}}},{"args":[{"defaultValue":null,"description":"","name":"id","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"section","type":{"kind":"OBJECT","name":"Section","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"lastCreatedAt","type":{"kind":"SCALAR","name":"Float","ofType":null}},{"defaultValue":null,"description":"","name":"limit","type":{"kind":"SCALAR","name":"Int","ofType":null}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"chapters","type":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"Chapter","ofType":null}}}},{"args":[{"defaultValue":null,"description":"","name":"id","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"chapter","type":{"kind":"OBJECT","name":"Chapter","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"title","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"chapterByTitle","type":{"kind":"OBJECT","name":"Chapter","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"number","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"chapterByNumber","type":{"kind":"OBJECT","name":"Chapter","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"id","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"ObjID","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"user","type":{"kind":"OBJECT","name":"User","ofType":null}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"currentUser","type":{"kind":"OBJECT","name":"User","ofType":null}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"githubStars","type":{"kind":"SCALAR","name":"Int","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"limit","type":{"kind":"SCALAR","name":"Int","ofType":null}},{"defaultValue":null,"description":"","name":"page","type":{"kind":"SCALAR","name":"Int","ofType":null}},{"defaultValue":null,"description":"","name":"skip","type":{"kind":"SCALAR","name":"Int","ofType":null}},{"defaultValue":null,"description":"","name":"after","type":{"kind":"SCALAR","name":"ObjID","ofType":null}},{"defaultValue":null,"description":"","name":"orderBy","type":{"kind":"ENUM","name":"ReviewOrderBy","ofType":null}}],"deprecationReason":null,"description":"To paginate, use page, skip \u0026 limit, or after \u0026 limit","isDeprecated":false,"name":"reviews","type":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"Review","ofType":null}}}},{"args":[{"defaultValue":null,"description":"","name":"id","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"ObjID","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"review","type":{"kind":"OBJECT","name":"Review","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"urlToken","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"team","type":{"kind":"OBJECT","name":"Team","ofType":null}}],"inputFields":null,"interfaces":[],"kind":"OBJECT","name":"Query","possibleTypes":null},{"description":"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. ","enumValues":null,"fields":null,"inputFields":null,"interfaces":null,"kind":"SCALAR","name":"Int","possibleTypes":null},{"description":"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). ","enumValues":null,"fields":null,"inputFields":null,"interfaces":null,"kind":"SCALAR","name":"Float","possibleTypes":null},{"description":"","enumValues":null,"fields":[{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"id","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"chapterId","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"number","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"title","type":{"kind":"SCALAR","name":"String","ofType":null}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"content","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"views","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"package","type":{"kind":"ENUM","name":"Package","ofType":null}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"next","type":{"kind":"OBJECT","name":"Section","ofType":null}}],"inputFields":null,"interfaces":[],"kind":"OBJECT","name":"Section","possibleTypes":null},{"description":"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.","enumValues":null,"fields":null,"inputFields":null,"interfaces":null,"kind":"SCALAR","name":"String","possibleTypes":null},{"description":"","enumValues":[{"deprecationReason":null,"description":"","isDeprecated":false,"name":"BASIC"},{"deprecationReason":null,"description":"","isDeprecated":false,"name":"PRO"},{"deprecationReason":null,"description":"","isDeprecated":false,"name":"FULL"},{"deprecationReason":null,"description":"","isDeprecated":false,"name":"TRAINING"},{"deprecationReason":null,"description":"","isDeprecated":false,"name":"TEAM"}],"fields":null,"inputFields":null,"interfaces":null,"kind":"ENUM","name":"Package","possibleTypes":null},{"description":"extend type Subscription {\n sectionCreated: Section\n sectionUpdated: Section\n sectionRemoved: ObjID\n}","enumValues":null,"fields":[{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"id","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"number","type":{"kind":"SCALAR","name":"Float","ofType":null}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"title","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"args":[{"defaultValue":null,"description":"","name":"number","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"section","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"Section","ofType":null}}},{"args":[{"defaultValue":null,"description":"","name":"lastCreatedAt","type":{"kind":"SCALAR","name":"Float","ofType":null}},{"defaultValue":null,"description":"","name":"limit","type":{"kind":"SCALAR","name":"Int","ofType":null}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"sections","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"LIST","name":null,"ofType":{"kind":"OBJECT","name":"Section","ofType":null}}}}],"inputFields":null,"interfaces":[],"kind":"OBJECT","name":"Chapter","possibleTypes":null},{"description":"Id representation, based on Mongo Object Ids","enumValues":null,"fields":null,"inputFields":null,"interfaces":null,"kind":"SCALAR","name":"ObjID","possibleTypes":null},{"description":"extend type Subscription {\n chapterCreated: Chapter\n chapterUpdated: Chapter\n chapterRemoved: ObjID\n}","enumValues":null,"fields":[{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"id","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"ObjID","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"firstName","type":{"kind":"SCALAR","name":"String","ofType":null}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"lastName","type":{"kind":"SCALAR","name":"String","ofType":null}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"name","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"username","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"email","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"emailVerified","type":{"kind":"SCALAR","name":"Boolean","ofType":null}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"authId","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"photo","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"hasPurchased","type":{"kind":"ENUM","name":"Package","ofType":null}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"hasRead","type":{"kind":"LIST","name":null,"ofType":{"kind":"OBJECT","name":"Section","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"favoriteReviews","type":{"kind":"LIST","name":null,"ofType":{"kind":"OBJECT","name":"Review","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"shippingAddress","type":{"kind":"LIST","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"hasTshirt","type":{"kind":"SCALAR","name":"String","ofType":null}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"createdAt","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Float","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"updatedAt","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Float","ofType":null}}}],"inputFields":null,"interfaces":[],"kind":"OBJECT","name":"User","possibleTypes":null},{"description":"The `Boolean` scalar type represents `true` or `false`.","enumValues":null,"fields":null,"inputFields":null,"interfaces":null,"kind":"SCALAR","name":"Boolean","possibleTypes":null},{"description":"","enumValues":null,"fields":[{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"id","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"ObjID","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"author","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"User","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"text","type":{"kind":"SCALAR","name":"String","ofType":null}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"stars","type":{"kind":"SCALAR","name":"Int","ofType":null}},{"args":[],"deprecationReason":null,"description":"whether the current user has favorited this review","isDeprecated":false,"name":"favorited","type":{"kind":"SCALAR","name":"Boolean","ofType":null}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"createdAt","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Float","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"updatedAt","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Float","ofType":null}}}],"inputFields":null,"interfaces":[],"kind":"OBJECT","name":"Review","possibleTypes":null},{"description":"","enumValues":[{"deprecationReason":null,"description":"","isDeprecated":false,"name":"createdAt_ASC"},{"deprecationReason":null,"description":"","isDeprecated":false,"name":"createdAt_DESC"}],"fields":null,"inputFields":null,"interfaces":null,"kind":"ENUM","name":"ReviewOrderBy","possibleTypes":null},{"description":"","enumValues":null,"fields":[{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"id","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"ObjID","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"urlToken","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"members","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"LIST","name":null,"ofType":{"kind":"OBJECT","name":"User","ofType":null}}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"owner","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"User","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"name","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"totalSeats","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"createdAt","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Float","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"updatedAt","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Float","ofType":null}}}],"inputFields":null,"interfaces":[],"kind":"OBJECT","name":"Team","possibleTypes":null},{"description":"","enumValues":null,"fields":[{"args":[],"deprecationReason":null,"description":"A placeholder, please ignore","isDeprecated":false,"name":"xxx","type":{"kind":"SCALAR","name":"Int","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"input","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"INPUT_OBJECT","name":"CreateSectionInput","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"createSection","type":{"kind":"OBJECT","name":"Section","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"id","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"ObjID","ofType":null}}},{"defaultValue":null,"description":"","name":"input","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"INPUT_OBJECT","name":"UpdateSectionInput","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"updateSection","type":{"kind":"OBJECT","name":"Section","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"id","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"ObjID","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"removeSection","type":{"kind":"SCALAR","name":"Boolean","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"id","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"viewedSection","type":{"kind":"OBJECT","name":"Section","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"input","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"INPUT_OBJECT","name":"CreateChapterInput","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"createChapter","type":{"kind":"OBJECT","name":"Chapter","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"id","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}}},{"defaultValue":null,"description":"","name":"input","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"INPUT_OBJECT","name":"UpdateChapterInput","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"updateChapter","type":{"kind":"OBJECT","name":"Chapter","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"id","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"removeChapter","type":{"kind":"SCALAR","name":"Boolean","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"input","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"INPUT_OBJECT","name":"CreateUserInput","ofType":null}}},{"defaultValue":null,"description":"","name":"authSecret","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"createUser","type":{"kind":"OBJECT","name":"User","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"id","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"ObjID","ofType":null}}},{"defaultValue":null,"description":"","name":"input","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"INPUT_OBJECT","name":"UpdateUserInput","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"updateUser","type":{"kind":"OBJECT","name":"User","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"id","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"ObjID","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"removeUser","type":{"kind":"SCALAR","name":"Boolean","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"input","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"INPUT_OBJECT","name":"UpdateUserInput","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"updateMyData","type":{"kind":"OBJECT","name":"User","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"input","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"INPUT_OBJECT","name":"CreateReviewInput","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"createReview","type":{"kind":"OBJECT","name":"Review","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"id","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"ObjID","ofType":null}}},{"defaultValue":null,"description":"","name":"input","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"INPUT_OBJECT","name":"UpdateReviewInput","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"updateReview","type":{"kind":"OBJECT","name":"Review","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"id","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"ObjID","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"removeReview","type":{"kind":"SCALAR","name":"Boolean","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"id","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"ObjID","ofType":null}}},{"defaultValue":null,"description":"","name":"favorite","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"favoriteReview","type":{"kind":"OBJECT","name":"Review","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"input","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"INPUT_OBJECT","name":"ChargeInput","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"charge","type":{"kind":"SCALAR","name":"Boolean","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"stripeToken","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"associateToken","type":{"kind":"OBJECT","name":"User","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"product","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"ENUM","name":"Shirt","ofType":null}}},{"defaultValue":null,"description":"","name":"size","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"ENUM","name":"Size","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"orderTshirt","type":{"kind":"OBJECT","name":"User","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"urlToken","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"joinTeam","type":{"kind":"OBJECT","name":"Team","ofType":null}}],"inputFields":null,"interfaces":[],"kind":"OBJECT","name":"Mutation","possibleTypes":null},{"description":"","enumValues":null,"fields":null,"inputFields":[{"defaultValue":null,"description":"","name":"chapterId","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}}},{"defaultValue":null,"description":"","name":"number","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}}},{"defaultValue":null,"description":"","name":"title","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"defaultValue":null,"description":"","name":"content","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"defaultValue":null,"description":"","name":"views","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}}},{"defaultValue":null,"description":"","name":"belongsTo","type":{"kind":"ENUM","name":"Package","ofType":null}}],"interfaces":null,"kind":"INPUT_OBJECT","name":"CreateSectionInput","possibleTypes":null},{"description":"","enumValues":null,"fields":null,"inputFields":[{"defaultValue":null,"description":"","name":"chapterId","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}}},{"defaultValue":null,"description":"","name":"number","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}}},{"defaultValue":null,"description":"","name":"title","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"defaultValue":null,"description":"","name":"content","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"defaultValue":null,"description":"","name":"views","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}}},{"defaultValue":null,"description":"","name":"belongsTo","type":{"kind":"ENUM","name":"Package","ofType":null}}],"interfaces":null,"kind":"INPUT_OBJECT","name":"UpdateSectionInput","possibleTypes":null},{"description":"","enumValues":null,"fields":null,"inputFields":[{"defaultValue":null,"description":"","name":"number","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}}},{"defaultValue":null,"description":"","name":"title","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}}],"interfaces":null,"kind":"INPUT_OBJECT","name":"CreateChapterInput","possibleTypes":null},{"description":"","enumValues":null,"fields":null,"inputFields":[{"defaultValue":null,"description":"","name":"title","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}}],"interfaces":null,"kind":"INPUT_OBJECT","name":"UpdateChapterInput","possibleTypes":null},{"description":"","enumValues":null,"fields":null,"inputFields":[{"defaultValue":null,"description":"","name":"name","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"defaultValue":null,"description":"","name":"username","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"defaultValue":null,"description":"","name":"email","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"defaultValue":null,"description":"","name":"emailVerified","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}}},{"defaultValue":null,"description":"","name":"authId","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"defaultValue":null,"description":"","name":"photo","type":{"kind":"SCALAR","name":"String","ofType":null}}],"interfaces":null,"kind":"INPUT_OBJECT","name":"CreateUserInput","possibleTypes":null},{"description":"","enumValues":null,"fields":null,"inputFields":[{"defaultValue":null,"description":"","name":"firstName","type":{"kind":"SCALAR","name":"String","ofType":null}},{"defaultValue":null,"description":"","name":"lastName","type":{"kind":"SCALAR","name":"String","ofType":null}},{"defaultValue":null,"description":"","name":"photo","type":{"kind":"SCALAR","name":"String","ofType":null}}],"interfaces":null,"kind":"INPUT_OBJECT","name":"UpdateUserInput","possibleTypes":null},{"description":"","enumValues":null,"fields":null,"inputFields":[{"defaultValue":null,"description":"","name":"text","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"defaultValue":null,"description":"","name":"stars","type":{"kind":"SCALAR","name":"Int","ofType":null}}],"interfaces":null,"kind":"INPUT_OBJECT","name":"CreateReviewInput","possibleTypes":null},{"description":"","enumValues":null,"fields":null,"inputFields":[{"defaultValue":null,"description":"","name":"text","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"defaultValue":null,"description":"","name":"stars","type":{"kind":"SCALAR","name":"Int","ofType":null}}],"interfaces":null,"kind":"INPUT_OBJECT","name":"UpdateReviewInput","possibleTypes":null},{"description":"","enumValues":null,"fields":null,"inputFields":[{"defaultValue":null,"description":"","name":"package","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"defaultValue":null,"description":"","name":"stripeToken","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"defaultValue":null,"description":"","name":"teamLicenses","type":{"kind":"SCALAR","name":"Int","ofType":null}},{"defaultValue":null,"description":"","name":"email","type":{"kind":"SCALAR","name":"String","ofType":null}},{"defaultValue":null,"description":"","name":"addresses","type":{"kind":"INPUT_OBJECT","name":"Addresses","ofType":null}}],"interfaces":null,"kind":"INPUT_OBJECT","name":"ChargeInput","possibleTypes":null},{"description":"","enumValues":null,"fields":null,"inputFields":[{"defaultValue":null,"description":"","name":"billing_name","type":{"kind":"SCALAR","name":"String","ofType":null}},{"defaultValue":null,"description":"","name":"billing_address_country","type":{"kind":"SCALAR","name":"String","ofType":null}},{"defaultValue":null,"description":"","name":"billing_address_zip","type":{"kind":"SCALAR","name":"String","ofType":null}},{"defaultValue":null,"description":"","name":"billing_address_state","type":{"kind":"SCALAR","name":"String","ofType":null}},{"defaultValue":null,"description":"","name":"billing_address_line1","type":{"kind":"SCALAR","name":"String","ofType":null}},{"defaultValue":null,"description":"","name":"billing_address_city","type":{"kind":"SCALAR","name":"String","ofType":null}},{"defaultValue":null,"description":"","name":"billing_address_country_code","type":{"kind":"SCALAR","name":"String","ofType":null}},{"defaultValue":null,"description":"","name":"shipping_name","type":{"kind":"SCALAR","name":"String","ofType":null}},{"defaultValue":null,"description":"","name":"shipping_address_country","type":{"kind":"SCALAR","name":"String","ofType":null}},{"defaultValue":null,"description":"","name":"shipping_address_zip","type":{"kind":"SCALAR","name":"String","ofType":null}},{"defaultValue":null,"description":"","name":"shipping_address_state","type":{"kind":"SCALAR","name":"String","ofType":null}},{"defaultValue":null,"description":"","name":"shipping_address_line1","type":{"kind":"SCALAR","name":"String","ofType":null}},{"defaultValue":null,"description":"","name":"shipping_address_city","type":{"kind":"SCALAR","name":"String","ofType":null}},{"defaultValue":null,"description":"","name":"shipping_address_country_code","type":{"kind":"SCALAR","name":"String","ofType":null}}],"interfaces":null,"kind":"INPUT_OBJECT","name":"Addresses","possibleTypes":null},{"description":"","enumValues":[{"deprecationReason":null,"description":"","isDeprecated":false,"name":"GRAY"},{"deprecationReason":null,"description":"","isDeprecated":false,"name":"NAVY"},{"deprecationReason":null,"description":"","isDeprecated":false,"name":"CONTOURED"}],"fields":null,"inputFields":null,"interfaces":null,"kind":"ENUM","name":"Shirt","possibleTypes":null},{"description":"","enumValues":[{"deprecationReason":null,"description":"","isDeprecated":false,"name":"S"},{"deprecationReason":null,"description":"","isDeprecated":false,"name":"M"},{"deprecationReason":null,"description":"","isDeprecated":false,"name":"L"},{"deprecationReason":null,"description":"","isDeprecated":false,"name":"XL"},{"deprecationReason":null,"description":"","isDeprecated":false,"name":"XXL"}],"fields":null,"inputFields":null,"interfaces":null,"kind":"ENUM","name":"Size","possibleTypes":null},{"description":"","enumValues":null,"fields":[{"args":[],"deprecationReason":null,"description":"A placeholder, please ignore","isDeprecated":false,"name":"xxx","type":{"kind":"SCALAR","name":"Int","ofType":null}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"githubStars","type":{"kind":"SCALAR","name":"Int","ofType":null}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"reviewCreated","type":{"kind":"OBJECT","name":"Review","ofType":null}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"reviewUpdated","type":{"kind":"OBJECT","name":"Review","ofType":null}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"reviewDeleted","type":{"kind":"SCALAR","name":"ObjID","ofType":null}}],"inputFields":null,"interfaces":[],"kind":"OBJECT","name":"Subscription","possibleTypes":null},{"description":"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.","enumValues":null,"fields":[{"args":[],"deprecationReason":null,"description":"A list of all types supported by this server.","isDeprecated":false,"name":"types","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Type","ofType":null}}}}},{"args":[],"deprecationReason":null,"description":"The type that query operations will be rooted at.","isDeprecated":false,"name":"queryType","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Type","ofType":null}}},{"args":[],"deprecationReason":null,"description":"If this server supports mutation, the type that mutation operations will be rooted at.","isDeprecated":false,"name":"mutationType","type":{"kind":"OBJECT","name":"__Type","ofType":null}},{"args":[],"deprecationReason":null,"description":"If this server support subscription, the type that subscription operations will be rooted at.","isDeprecated":false,"name":"subscriptionType","type":{"kind":"OBJECT","name":"__Type","ofType":null}},{"args":[],"deprecationReason":null,"description":"A list of all directives supported by this server.","isDeprecated":false,"name":"directives","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Directive","ofType":null}}}}}],"inputFields":null,"interfaces":[],"kind":"OBJECT","name":"__Schema","possibleTypes":null},{"description":"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name and description, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.","enumValues":null,"fields":[{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"kind","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"ENUM","name":"__TypeKind","ofType":null}}},{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"name","type":{"kind":"SCALAR","name":"String","ofType":null}},{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"description","type":{"kind":"SCALAR","name":"String","ofType":null}},{"args":[{"defaultValue":"false","description":null,"name":"includeDeprecated","type":{"kind":"SCALAR","name":"Boolean","ofType":null}}],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"fields","type":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Field","ofType":null}}}},{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"interfaces","type":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Type","ofType":null}}}},{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"possibleTypes","type":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Type","ofType":null}}}},{"args":[{"defaultValue":"false","description":null,"name":"includeDeprecated","type":{"kind":"SCALAR","name":"Boolean","ofType":null}}],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"enumValues","type":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__EnumValue","ofType":null}}}},{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"inputFields","type":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__InputValue","ofType":null}}}},{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"ofType","type":{"kind":"OBJECT","name":"__Type","ofType":null}}],"inputFields":null,"interfaces":[],"kind":"OBJECT","name":"__Type","possibleTypes":null},{"description":"An enum describing what kind of type a given `__Type` is.","enumValues":[{"deprecationReason":null,"description":"Indicates this type is a scalar.","isDeprecated":false,"name":"SCALAR"},{"deprecationReason":null,"description":"Indicates this type is an object. `fields` and `interfaces` are valid fields.","isDeprecated":false,"name":"OBJECT"},{"deprecationReason":null,"description":"Indicates this type is an interface. `fields` and `possibleTypes` are valid fields.","isDeprecated":false,"name":"INTERFACE"},{"deprecationReason":null,"description":"Indicates this type is a union. `possibleTypes` is a valid field.","isDeprecated":false,"name":"UNION"},{"deprecationReason":null,"description":"Indicates this type is an enum. `enumValues` is a valid field.","isDeprecated":false,"name":"ENUM"},{"deprecationReason":null,"description":"Indicates this type is an input object. `inputFields` is a valid field.","isDeprecated":false,"name":"INPUT_OBJECT"},{"deprecationReason":null,"description":"Indicates this type is a list. `ofType` is a valid field.","isDeprecated":false,"name":"LIST"},{"deprecationReason":null,"description":"Indicates this type is a non-null. `ofType` is a valid field.","isDeprecated":false,"name":"NON_NULL"}],"fields":null,"inputFields":null,"interfaces":null,"kind":"ENUM","name":"__TypeKind","possibleTypes":null},{"description":"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.","enumValues":null,"fields":[{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"name","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"description","type":{"kind":"SCALAR","name":"String","ofType":null}},{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"args","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__InputValue","ofType":null}}}}},{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"type","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Type","ofType":null}}},{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"isDeprecated","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}}},{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"deprecationReason","type":{"kind":"SCALAR","name":"String","ofType":null}}],"inputFields":null,"interfaces":[],"kind":"OBJECT","name":"__Field","possibleTypes":null},{"description":"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.","enumValues":null,"fields":[{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"name","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"description","type":{"kind":"SCALAR","name":"String","ofType":null}},{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"type","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Type","ofType":null}}},{"args":[],"deprecationReason":null,"description":"A GraphQL-formatted string representing the default value for this input value.","isDeprecated":false,"name":"defaultValue","type":{"kind":"SCALAR","name":"String","ofType":null}}],"inputFields":null,"interfaces":[],"kind":"OBJECT","name":"__InputValue","possibleTypes":null},{"description":"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.","enumValues":null,"fields":[{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"name","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"description","type":{"kind":"SCALAR","name":"String","ofType":null}},{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"isDeprecated","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}}},{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"deprecationReason","type":{"kind":"SCALAR","name":"String","ofType":null}}],"inputFields":null,"interfaces":[],"kind":"OBJECT","name":"__EnumValue","possibleTypes":null},{"description":"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.","enumValues":null,"fields":[{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"name","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"description","type":{"kind":"SCALAR","name":"String","ofType":null}},{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"locations","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"ENUM","name":"__DirectiveLocation","ofType":null}}}}},{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"args","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__InputValue","ofType":null}}}}},{"args":[],"deprecationReason":"Use `locations`.","description":null,"isDeprecated":true,"name":"onOperation","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}}},{"args":[],"deprecationReason":"Use `locations`.","description":null,"isDeprecated":true,"name":"onFragment","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}}},{"args":[],"deprecationReason":"Use `locations`.","description":null,"isDeprecated":true,"name":"onField","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}}}],"inputFields":null,"interfaces":[],"kind":"OBJECT","name":"__Directive","possibleTypes":null},{"description":"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.","enumValues":[{"deprecationReason":null,"description":"Location adjacent to a query operation.","isDeprecated":false,"name":"QUERY"},{"deprecationReason":null,"description":"Location adjacent to a mutation operation.","isDeprecated":false,"name":"MUTATION"},{"deprecationReason":null,"description":"Location adjacent to a subscription operation.","isDeprecated":false,"name":"SUBSCRIPTION"},{"deprecationReason":null,"description":"Location adjacent to a field.","isDeprecated":false,"name":"FIELD"},{"deprecationReason":null,"description":"Location adjacent to a fragment definition.","isDeprecated":false,"name":"FRAGMENT_DEFINITION"},{"deprecationReason":null,"description":"Location adjacent to a fragment spread.","isDeprecated":false,"name":"FRAGMENT_SPREAD"},{"deprecationReason":null,"description":"Location adjacent to an inline fragment.","isDeprecated":false,"name":"INLINE_FRAGMENT"},{"deprecationReason":null,"description":"Location adjacent to a schema definition.","isDeprecated":false,"name":"SCHEMA"},{"deprecationReason":null,"description":"Location adjacent to a scalar definition.","isDeprecated":false,"name":"SCALAR"},{"deprecationReason":null,"description":"Location adjacent to an object type definition.","isDeprecated":false,"name":"OBJECT"},{"deprecationReason":null,"description":"Location adjacent to a field definition.","isDeprecated":false,"name":"FIELD_DEFINITION"},{"deprecationReason":null,"description":"Location adjacent to an argument definition.","isDeprecated":false,"name":"ARGUMENT_DEFINITION"},{"deprecationReason":null,"description":"Location adjacent to an interface definition.","isDeprecated":false,"name":"INTERFACE"},{"deprecationReason":null,"description":"Location adjacent to a union definition.","isDeprecated":false,"name":"UNION"},{"deprecationReason":null,"description":"Location adjacent to an enum definition.","isDeprecated":false,"name":"ENUM"},{"deprecationReason":null,"description":"Location adjacent to an enum value definition.","isDeprecated":false,"name":"ENUM_VALUE"},{"deprecationReason":null,"description":"Location adjacent to an input object type definition.","isDeprecated":false,"name":"INPUT_OBJECT"},{"deprecationReason":null,"description":"Location adjacent to an input object field definition.","isDeprecated":false,"name":"INPUT_FIELD_DEFINITION"}],"fields":null,"inputFields":null,"interfaces":null,"kind":"ENUM","name":"__DirectiveLocation","possibleTypes":null}]}}} diff --git a/app/src/main/java/guide/graphql/toc/data/Apollo.kt b/app/src/main/java/guide/graphql/toc/data/Apollo.kt deleted file mode 100644 index e12866c..0000000 --- a/app/src/main/java/guide/graphql/toc/data/Apollo.kt +++ /dev/null @@ -1,13 +0,0 @@ -package guide.graphql.toc.data - -import com.apollographql.apollo.ApolloClient -import com.apollographql.apollo.cache.normalized.lru.EvictionPolicy -import com.apollographql.apollo.cache.normalized.lru.LruNormalizedCacheFactory - -val cacheFactory = - LruNormalizedCacheFactory(EvictionPolicy.builder().maxSizeBytes(10 * 1024 * 1024).build()) - -val apolloClient: ApolloClient = ApolloClient.builder() - .serverUrl("https://api.graphql.guide/graphql") - .normalizedCache(cacheFactory) - .build() \ No newline at end of file diff --git a/app/src/main/java/guide/graphql/toc/data/Resource.kt b/app/src/main/java/guide/graphql/toc/data/Resource.kt deleted file mode 100644 index b3de23b..0000000 --- a/app/src/main/java/guide/graphql/toc/data/Resource.kt +++ /dev/null @@ -1,39 +0,0 @@ -package guide.graphql.toc.data - -//https://github.com/android/architecture-components-samples/blob/master/GithubBrowserSample/app/src/main/java/com/android/example/github/vo/Resource.kt -/** - * Wrapper for a result object with loading, success and error states - */ -data class Resource<out T>(val status: Status, val data: T?, val message: String?) { - companion object { - fun <T> success(data: T?): Resource<T> { - return Resource( - Status.SUCCESS, - data, - null - ) - } - - fun <T> error(msg: String, data: T?): Resource<T> { - return Resource( - Status.ERROR, - data, - msg - ) - } - - fun <T> loading(data: T?): Resource<T> { - return Resource( - Status.LOADING, - data, - null - ) - } - } -} - -enum class Status { - SUCCESS, - ERROR, - LOADING -} \ No newline at end of file diff --git a/app/src/main/java/guide/graphql/toc/ui/chapters/ChaptersAdapter.kt b/app/src/main/java/guide/graphql/toc/ui/chapters/ChaptersAdapter.kt index 3139822..180a71a 100644 --- a/app/src/main/java/guide/graphql/toc/ui/chapters/ChaptersAdapter.kt +++ b/app/src/main/java/guide/graphql/toc/ui/chapters/ChaptersAdapter.kt @@ -2,23 +2,20 @@ package guide.graphql.toc.ui.chapters import android.content.Context import android.view.LayoutInflater -import android.view.View import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView -import guide.graphql.toc.ChaptersQuery -import guide.graphql.toc.R import guide.graphql.toc.databinding.ChapterBinding class ChaptersAdapter( private val context: Context, - private var chapters: List<ChaptersQuery.Chapter> = listOf(), - private val onItemClicked: ((ChaptersQuery.Chapter) -> Unit) + private var chapters: List<String> = listOf(), + private val onItemClicked: ((String) -> Unit) ) : RecyclerView.Adapter<ChaptersAdapter.ViewHolder>() { class ViewHolder(val binding: ChapterBinding) : RecyclerView.ViewHolder(binding.root) - fun updateChapters(chapters: List<ChaptersQuery.Chapter>) { + fun updateChapters(chapters: List<String>) { this.chapters = chapters notifyDataSetChanged() } @@ -34,20 +31,8 @@ class ChaptersAdapter( override fun onBindViewHolder(holder: ViewHolder, position: Int) { val chapter = chapters[position] - val header = - if (chapter.number == null) chapter.title else context.getString( - R.string.chapter_number, - chapter.number.toInt().toString() - ) - - holder.binding.chapterHeader.text = header - if (chapter.number == null) { - holder.binding.chapterSubheader.visibility = View.GONE - - } else { - holder.binding.chapterSubheader.text = chapter.title - holder.binding.chapterSubheader.visibility = View.VISIBLE - } + + holder.binding.chapterHeader.text = chapter holder.binding.root.setOnClickListener { onItemClicked.invoke(chapter) diff --git a/app/src/main/java/guide/graphql/toc/ui/chapters/ChaptersFragment.kt b/app/src/main/java/guide/graphql/toc/ui/chapters/ChaptersFragment.kt index eeba4db..2b57dfb 100644 --- a/app/src/main/java/guide/graphql/toc/ui/chapters/ChaptersFragment.kt +++ b/app/src/main/java/guide/graphql/toc/ui/chapters/ChaptersFragment.kt @@ -6,25 +6,17 @@ import android.view.View import android.view.ViewGroup import android.widget.Toast import androidx.fragment.app.Fragment -import androidx.lifecycle.lifecycleScope import androidx.navigation.fragment.findNavController import androidx.recyclerview.widget.DividerItemDecoration import androidx.recyclerview.widget.LinearLayoutManager -import com.apollographql.apollo.coroutines.toDeferred -import com.apollographql.apollo.exception.ApolloException import com.google.android.material.transition.MaterialSharedAxis -import guide.graphql.toc.ChaptersQuery import guide.graphql.toc.R -import guide.graphql.toc.data.apolloClient import guide.graphql.toc.databinding.ChaptersFragmentBinding class ChaptersFragment : Fragment() { private var _binding: ChaptersFragmentBinding? = null - // This property is only valid between onCreateView and - // onDestroyView. private val binding get() = _binding!! - override fun onCreateView( inflater: LayoutInflater, container: ViewGroup?, @@ -53,12 +45,12 @@ class ChaptersFragment : Fragment() { ) { chapter -> findNavController().navigate( ChaptersFragmentDirections.viewSections( - chapterId = chapter.id, - chapterNumber = chapter.number?.toInt() ?: -1, - chapterTitle = if (chapter.number == null) chapter.title else getString( + chapterId = 10, + chapterNumber = 10, + chapterTitle = getString( R.string.chapter_title, - chapter.number.toInt().toString(), - chapter.title + "10", + "Android Dev" ) ) ) @@ -71,22 +63,7 @@ class ChaptersFragment : Fragment() { binding.chapters.addItemDecoration(itemDivider) binding.chapters.adapter = adapter - lifecycleScope.launchWhenStarted { - try { - val response = apolloClient.query( - ChaptersQuery() - ).toDeferred().await() - if (response.hasErrors()) { - throw Exception("Response has errors") - } - val chapters = response.data?.chapters ?: throw Exception("Data is null") - adapter.updateChapters(chapters) - } catch (e: ApolloException) { - showErrorMessage("GraphQL request failed") - } catch (e: Exception) { - showErrorMessage(e.message.orEmpty()) - } - } + adapter.updateChapters(listOf("Android Dev")) } override fun onDestroyView() { diff --git a/app/src/main/java/guide/graphql/toc/ui/sections/SectionsAdapter.kt b/app/src/main/java/guide/graphql/toc/ui/sections/SectionsAdapter.kt index f0a9c88..1e5853e 100644 --- a/app/src/main/java/guide/graphql/toc/ui/sections/SectionsAdapter.kt +++ b/app/src/main/java/guide/graphql/toc/ui/sections/SectionsAdapter.kt @@ -5,25 +5,18 @@ import android.view.LayoutInflater import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView import guide.graphql.toc.R -import guide.graphql.toc.SectionsQuery import guide.graphql.toc.databinding.SectionBinding class SectionsAdapter( private val context: Context, - private val chapterNumber: Int, - private var sections: List<SectionsQuery.Section?> = listOf() + private val chapterNumber: Int ) : RecyclerView.Adapter<SectionsAdapter.ViewHolder>() { - fun updateSections(sections: List<SectionsQuery.Section?>) { - this.sections = sections - notifyDataSetChanged() - } - class ViewHolder(val binding: SectionBinding) : RecyclerView.ViewHolder(binding.root) override fun getItemCount(): Int { - return sections.size + return 0 } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { @@ -31,15 +24,5 @@ class SectionsAdapter( return ViewHolder(binding) } - override fun onBindViewHolder(holder: ViewHolder, position: Int) { - val section = sections[position] - section?.let { - holder.binding.sectionTitle.text = context.getString( - R.string.section_title, - chapterNumber.toString(), - section.number.toString(), - section.title - ) - } - } + override fun onBindViewHolder(holder: ViewHolder, position: Int) {} } \ No newline at end of file diff --git a/app/src/main/java/guide/graphql/toc/ui/sections/SectionsFragment.kt b/app/src/main/java/guide/graphql/toc/ui/sections/SectionsFragment.kt index f9138a4..243e7d5 100644 --- a/app/src/main/java/guide/graphql/toc/ui/sections/SectionsFragment.kt +++ b/app/src/main/java/guide/graphql/toc/ui/sections/SectionsFragment.kt @@ -5,26 +5,16 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.fragment.app.Fragment -import androidx.lifecycle.lifecycleScope import androidx.navigation.fragment.navArgs import androidx.recyclerview.widget.DividerItemDecoration import androidx.recyclerview.widget.LinearLayoutManager -import com.apollographql.apollo.coroutines.toDeferred -import com.apollographql.apollo.exception.ApolloException import com.google.android.material.transition.MaterialSharedAxis -import guide.graphql.toc.SectionsQuery -import guide.graphql.toc.data.apolloClient import guide.graphql.toc.databinding.SectionsFragmentBinding class SectionsFragment : Fragment() { - - private var _binding: SectionsFragmentBinding? = null - // This property is only valid between onCreateView and - // onDestroyView. private val binding get() = _binding!! - private val args: SectionsFragmentArgs by navArgs() override fun onCreateView( @@ -62,33 +52,7 @@ class SectionsFragment : Fragment() { binding.sections.addItemDecoration(itemDivider) binding.sections.adapter = adapter - lifecycleScope.launchWhenStarted { - binding.spinner.visibility = View.VISIBLE - binding.error.visibility = View.GONE - try { - val response = apolloClient.query( - SectionsQuery(id = args.chapterId) - ).toDeferred().await() - - if (response.hasErrors()) { - throw Exception("Response has errors") - } - - val sections = response.data?.chapter?.sections ?: throw Exception("Data is null") - - if (sections.size > 1) { - adapter.updateSections(sections) - binding.spinner.visibility = View.GONE - binding.error.visibility = View.GONE - } else { - throw Exception("No sections") - } - } catch (e: ApolloException) { - showErrorMessage("GraphQL request failed") - } catch (e: Exception) { - showErrorMessage(e.message.orEmpty()) - } - } + showErrorMessage("No sections") } override fun onDestroyView() { From f0d9379499dc9ebb7dc03c2ed010d284bd894776 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Loren=20=F0=9F=A4=93?= <lorensr@gmail.com> Date: Wed, 22 Jul 2020 01:14:41 -0400 Subject: [PATCH 2/6] Starter app --- app/build.gradle.kts | 11 +---------- .../guide/graphql/toc/ui/chapters/ChaptersAdapter.kt | 3 +-- .../guide/graphql/toc/ui/sections/SectionsAdapter.kt | 3 +-- build.gradle.kts | 2 +- 4 files changed, 4 insertions(+), 15 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 0a0c85d..c2b8ce9 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -2,7 +2,6 @@ plugins { id("com.android.application") id("kotlin-android") id("androidx.navigation.safeargs.kotlin") - id("com.apollographql.apollo").version("2.2.2") } android { @@ -16,7 +15,7 @@ android { versionCode = 1 versionName = "1.0" } - + buildFeatures { viewBinding = true } @@ -44,12 +43,4 @@ dependencies { implementation("androidx.navigation:navigation-fragment-ktx:2.3.0") implementation("androidx.navigation:navigation-ui-ktx:2.3.0") implementation("com.google.android.material:material:1.3.0-alpha01") - implementation("com.apollographql.apollo:apollo-runtime:2.2.2") - implementation("com.apollographql.apollo:apollo-coroutines-support:2.2.2") - implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.2.0") - } - -apollo { - generateKotlinModels.set(true) -} \ No newline at end of file diff --git a/app/src/main/java/guide/graphql/toc/ui/chapters/ChaptersAdapter.kt b/app/src/main/java/guide/graphql/toc/ui/chapters/ChaptersAdapter.kt index 180a71a..b5b1136 100644 --- a/app/src/main/java/guide/graphql/toc/ui/chapters/ChaptersAdapter.kt +++ b/app/src/main/java/guide/graphql/toc/ui/chapters/ChaptersAdapter.kt @@ -10,8 +10,7 @@ class ChaptersAdapter( private val context: Context, private var chapters: List<String> = listOf(), private val onItemClicked: ((String) -> Unit) -) : - RecyclerView.Adapter<ChaptersAdapter.ViewHolder>() { +) : RecyclerView.Adapter<ChaptersAdapter.ViewHolder>() { class ViewHolder(val binding: ChapterBinding) : RecyclerView.ViewHolder(binding.root) diff --git a/app/src/main/java/guide/graphql/toc/ui/sections/SectionsAdapter.kt b/app/src/main/java/guide/graphql/toc/ui/sections/SectionsAdapter.kt index 1e5853e..826e21f 100644 --- a/app/src/main/java/guide/graphql/toc/ui/sections/SectionsAdapter.kt +++ b/app/src/main/java/guide/graphql/toc/ui/sections/SectionsAdapter.kt @@ -10,8 +10,7 @@ import guide.graphql.toc.databinding.SectionBinding class SectionsAdapter( private val context: Context, private val chapterNumber: Int -) : - RecyclerView.Adapter<SectionsAdapter.ViewHolder>() { +) : RecyclerView.Adapter<SectionsAdapter.ViewHolder>() { class ViewHolder(val binding: SectionBinding) : RecyclerView.ViewHolder(binding.root) diff --git a/build.gradle.kts b/build.gradle.kts index 1140e17..7c32110 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,7 +5,7 @@ buildscript { } dependencies { - classpath("com.android.tools.build:gradle:4.1.0-beta03") + classpath("com.android.tools.build:gradle:4.1.0-beta04") classpath("androidx.navigation:navigation-safe-args-gradle-plugin:2.3.0") classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.72") } From da3c1465bb8284012722676bdd87ee25ddd48100 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Loren=20=F0=9F=A4=93?= <lorensr@gmail.com> Date: Thu, 23 Jul 2020 02:19:23 -0400 Subject: [PATCH 3/6] Add Apollo Android and Guide schema --- app/build.gradle.kts | 7 +++++++ app/src/main/graphql/guide/graphql/toc/schema.json | 1 + 2 files changed, 8 insertions(+) create mode 100644 app/src/main/graphql/guide/graphql/toc/schema.json diff --git a/app/build.gradle.kts b/app/build.gradle.kts index c2b8ce9..2d51675 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -2,6 +2,11 @@ plugins { id("com.android.application") id("kotlin-android") id("androidx.navigation.safeargs.kotlin") + id("com.apollographql.apollo").version("2.2.2") +} + +apollo { + generateKotlinModels.set(true) } android { @@ -43,4 +48,6 @@ dependencies { implementation("androidx.navigation:navigation-fragment-ktx:2.3.0") implementation("androidx.navigation:navigation-ui-ktx:2.3.0") implementation("com.google.android.material:material:1.3.0-alpha01") + implementation("com.apollographql.apollo:apollo-runtime:2.2.2") + implementation("com.apollographql.apollo:apollo-coroutines-support:2.2.2") } diff --git a/app/src/main/graphql/guide/graphql/toc/schema.json b/app/src/main/graphql/guide/graphql/toc/schema.json new file mode 100644 index 0000000..6d61cd9 --- /dev/null +++ b/app/src/main/graphql/guide/graphql/toc/schema.json @@ -0,0 +1 @@ +{"data":{"__schema":{"directives":[{"args":[{"defaultValue":null,"description":"Skipped when true.","name":"if","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}}}],"description":"Directs the executor to skip this field or fragment when the `if` argument is true.","locations":["FIELD","FRAGMENT_SPREAD","INLINE_FRAGMENT"],"name":"skip"},{"args":[{"defaultValue":null,"description":"Included when true.","name":"if","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}}}],"description":"Directs the executor to include this field or fragment only when the `if` argument is true.","locations":["FIELD","FRAGMENT_SPREAD","INLINE_FRAGMENT"],"name":"include"},{"args":[{"defaultValue":"\"No longer supported\"","description":"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted in [Markdown](https://daringfireball.net/projects/markdown/).","name":"reason","type":{"kind":"SCALAR","name":"String","ofType":null}}],"description":"Marks an element of a GraphQL schema as no longer supported.","locations":["FIELD_DEFINITION","ENUM_VALUE"],"name":"deprecated"}],"mutationType":{"name":"Mutation"},"queryType":{"name":"Query"},"subscriptionType":{"name":"Subscription"},"types":[{"description":"","enumValues":null,"fields":[{"args":[],"deprecationReason":null,"description":"A placeholder, please ignore","isDeprecated":false,"name":"xxx","type":{"kind":"SCALAR","name":"Int","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"lastCreatedAt","type":{"kind":"SCALAR","name":"Float","ofType":null}},{"defaultValue":null,"description":"","name":"limit","type":{"kind":"SCALAR","name":"Int","ofType":null}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"sections","type":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"Section","ofType":null}}}},{"args":[{"defaultValue":null,"description":"","name":"id","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"section","type":{"kind":"OBJECT","name":"Section","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"lastCreatedAt","type":{"kind":"SCALAR","name":"Float","ofType":null}},{"defaultValue":null,"description":"","name":"limit","type":{"kind":"SCALAR","name":"Int","ofType":null}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"chapters","type":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"Chapter","ofType":null}}}},{"args":[{"defaultValue":null,"description":"","name":"id","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"chapter","type":{"kind":"OBJECT","name":"Chapter","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"title","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"chapterByTitle","type":{"kind":"OBJECT","name":"Chapter","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"number","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"chapterByNumber","type":{"kind":"OBJECT","name":"Chapter","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"id","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"ObjID","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"user","type":{"kind":"OBJECT","name":"User","ofType":null}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"currentUser","type":{"kind":"OBJECT","name":"User","ofType":null}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"githubStars","type":{"kind":"SCALAR","name":"Int","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"limit","type":{"kind":"SCALAR","name":"Int","ofType":null}},{"defaultValue":null,"description":"","name":"page","type":{"kind":"SCALAR","name":"Int","ofType":null}},{"defaultValue":null,"description":"","name":"skip","type":{"kind":"SCALAR","name":"Int","ofType":null}},{"defaultValue":null,"description":"","name":"after","type":{"kind":"SCALAR","name":"ObjID","ofType":null}},{"defaultValue":null,"description":"","name":"orderBy","type":{"kind":"ENUM","name":"ReviewOrderBy","ofType":null}}],"deprecationReason":null,"description":"To paginate, use page, skip \u0026 limit, or after \u0026 limit","isDeprecated":false,"name":"reviews","type":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"Review","ofType":null}}}},{"args":[{"defaultValue":null,"description":"","name":"id","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"ObjID","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"review","type":{"kind":"OBJECT","name":"Review","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"urlToken","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"team","type":{"kind":"OBJECT","name":"Team","ofType":null}}],"inputFields":null,"interfaces":[],"kind":"OBJECT","name":"Query","possibleTypes":null},{"description":"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. ","enumValues":null,"fields":null,"inputFields":null,"interfaces":null,"kind":"SCALAR","name":"Int","possibleTypes":null},{"description":"The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). ","enumValues":null,"fields":null,"inputFields":null,"interfaces":null,"kind":"SCALAR","name":"Float","possibleTypes":null},{"description":"","enumValues":null,"fields":[{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"id","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"chapterId","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"number","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"title","type":{"kind":"SCALAR","name":"String","ofType":null}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"content","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"views","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"package","type":{"kind":"ENUM","name":"Package","ofType":null}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"next","type":{"kind":"OBJECT","name":"Section","ofType":null}}],"inputFields":null,"interfaces":[],"kind":"OBJECT","name":"Section","possibleTypes":null},{"description":"The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.","enumValues":null,"fields":null,"inputFields":null,"interfaces":null,"kind":"SCALAR","name":"String","possibleTypes":null},{"description":"","enumValues":[{"deprecationReason":null,"description":"","isDeprecated":false,"name":"BASIC"},{"deprecationReason":null,"description":"","isDeprecated":false,"name":"PRO"},{"deprecationReason":null,"description":"","isDeprecated":false,"name":"FULL"},{"deprecationReason":null,"description":"","isDeprecated":false,"name":"TRAINING"},{"deprecationReason":null,"description":"","isDeprecated":false,"name":"TEAM"}],"fields":null,"inputFields":null,"interfaces":null,"kind":"ENUM","name":"Package","possibleTypes":null},{"description":"extend type Subscription {\n sectionCreated: Section\n sectionUpdated: Section\n sectionRemoved: ObjID\n}","enumValues":null,"fields":[{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"id","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"number","type":{"kind":"SCALAR","name":"Float","ofType":null}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"title","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"args":[{"defaultValue":null,"description":"","name":"number","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"section","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"Section","ofType":null}}},{"args":[{"defaultValue":null,"description":"","name":"lastCreatedAt","type":{"kind":"SCALAR","name":"Float","ofType":null}},{"defaultValue":null,"description":"","name":"limit","type":{"kind":"SCALAR","name":"Int","ofType":null}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"sections","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"Section","ofType":null}}}}}],"inputFields":null,"interfaces":[],"kind":"OBJECT","name":"Chapter","possibleTypes":null},{"description":"Id representation, based on Mongo Object Ids","enumValues":null,"fields":null,"inputFields":null,"interfaces":null,"kind":"SCALAR","name":"ObjID","possibleTypes":null},{"description":"extend type Subscription {\n chapterCreated: Chapter\n chapterUpdated: Chapter\n chapterRemoved: ObjID\n}","enumValues":null,"fields":[{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"id","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"ObjID","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"firstName","type":{"kind":"SCALAR","name":"String","ofType":null}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"lastName","type":{"kind":"SCALAR","name":"String","ofType":null}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"name","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"username","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"email","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"emailVerified","type":{"kind":"SCALAR","name":"Boolean","ofType":null}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"authId","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"photo","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"hasPurchased","type":{"kind":"ENUM","name":"Package","ofType":null}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"hasRead","type":{"kind":"LIST","name":null,"ofType":{"kind":"OBJECT","name":"Section","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"favoriteReviews","type":{"kind":"LIST","name":null,"ofType":{"kind":"OBJECT","name":"Review","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"shippingAddress","type":{"kind":"LIST","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"hasTshirt","type":{"kind":"SCALAR","name":"String","ofType":null}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"createdAt","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Float","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"updatedAt","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Float","ofType":null}}}],"inputFields":null,"interfaces":[],"kind":"OBJECT","name":"User","possibleTypes":null},{"description":"The `Boolean` scalar type represents `true` or `false`.","enumValues":null,"fields":null,"inputFields":null,"interfaces":null,"kind":"SCALAR","name":"Boolean","possibleTypes":null},{"description":"","enumValues":null,"fields":[{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"id","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"ObjID","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"author","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"User","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"text","type":{"kind":"SCALAR","name":"String","ofType":null}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"stars","type":{"kind":"SCALAR","name":"Int","ofType":null}},{"args":[],"deprecationReason":null,"description":"whether the current user has favorited this review","isDeprecated":false,"name":"favorited","type":{"kind":"SCALAR","name":"Boolean","ofType":null}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"createdAt","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Float","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"updatedAt","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Float","ofType":null}}}],"inputFields":null,"interfaces":[],"kind":"OBJECT","name":"Review","possibleTypes":null},{"description":"","enumValues":[{"deprecationReason":null,"description":"","isDeprecated":false,"name":"createdAt_ASC"},{"deprecationReason":null,"description":"","isDeprecated":false,"name":"createdAt_DESC"}],"fields":null,"inputFields":null,"interfaces":null,"kind":"ENUM","name":"ReviewOrderBy","possibleTypes":null},{"description":"","enumValues":null,"fields":[{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"id","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"ObjID","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"urlToken","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"members","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"LIST","name":null,"ofType":{"kind":"OBJECT","name":"User","ofType":null}}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"owner","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"User","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"name","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"totalSeats","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"createdAt","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Float","ofType":null}}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"updatedAt","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Float","ofType":null}}}],"inputFields":null,"interfaces":[],"kind":"OBJECT","name":"Team","possibleTypes":null},{"description":"","enumValues":null,"fields":[{"args":[],"deprecationReason":null,"description":"A placeholder, please ignore","isDeprecated":false,"name":"xxx","type":{"kind":"SCALAR","name":"Int","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"input","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"INPUT_OBJECT","name":"CreateSectionInput","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"createSection","type":{"kind":"OBJECT","name":"Section","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"id","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"ObjID","ofType":null}}},{"defaultValue":null,"description":"","name":"input","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"INPUT_OBJECT","name":"UpdateSectionInput","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"updateSection","type":{"kind":"OBJECT","name":"Section","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"id","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"ObjID","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"removeSection","type":{"kind":"SCALAR","name":"Boolean","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"id","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"viewedSection","type":{"kind":"OBJECT","name":"Section","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"input","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"INPUT_OBJECT","name":"CreateChapterInput","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"createChapter","type":{"kind":"OBJECT","name":"Chapter","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"id","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}}},{"defaultValue":null,"description":"","name":"input","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"INPUT_OBJECT","name":"UpdateChapterInput","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"updateChapter","type":{"kind":"OBJECT","name":"Chapter","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"id","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"removeChapter","type":{"kind":"SCALAR","name":"Boolean","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"input","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"INPUT_OBJECT","name":"CreateUserInput","ofType":null}}},{"defaultValue":null,"description":"","name":"authSecret","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"createUser","type":{"kind":"OBJECT","name":"User","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"id","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"ObjID","ofType":null}}},{"defaultValue":null,"description":"","name":"input","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"INPUT_OBJECT","name":"UpdateUserInput","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"updateUser","type":{"kind":"OBJECT","name":"User","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"id","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"ObjID","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"removeUser","type":{"kind":"SCALAR","name":"Boolean","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"input","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"INPUT_OBJECT","name":"UpdateUserInput","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"updateMyData","type":{"kind":"OBJECT","name":"User","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"token","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"unsubscribe","type":{"kind":"SCALAR","name":"Boolean","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"input","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"INPUT_OBJECT","name":"CreateReviewInput","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"createReview","type":{"kind":"OBJECT","name":"Review","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"id","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"ObjID","ofType":null}}},{"defaultValue":null,"description":"","name":"input","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"INPUT_OBJECT","name":"UpdateReviewInput","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"updateReview","type":{"kind":"OBJECT","name":"Review","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"id","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"ObjID","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"removeReview","type":{"kind":"SCALAR","name":"Boolean","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"id","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"ObjID","ofType":null}}},{"defaultValue":null,"description":"","name":"favorite","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"favoriteReview","type":{"kind":"OBJECT","name":"Review","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"input","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"INPUT_OBJECT","name":"ChargeInput","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"charge","type":{"kind":"SCALAR","name":"Boolean","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"stripeToken","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"associateToken","type":{"kind":"OBJECT","name":"User","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"product","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"ENUM","name":"Shirt","ofType":null}}},{"defaultValue":null,"description":"","name":"size","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"ENUM","name":"Size","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"orderTshirt","type":{"kind":"OBJECT","name":"User","ofType":null}},{"args":[{"defaultValue":null,"description":"","name":"urlToken","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}}],"deprecationReason":null,"description":"","isDeprecated":false,"name":"joinTeam","type":{"kind":"OBJECT","name":"Team","ofType":null}}],"inputFields":null,"interfaces":[],"kind":"OBJECT","name":"Mutation","possibleTypes":null},{"description":"","enumValues":null,"fields":null,"inputFields":[{"defaultValue":null,"description":"","name":"chapterId","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}}},{"defaultValue":null,"description":"","name":"number","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}}},{"defaultValue":null,"description":"","name":"title","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"defaultValue":null,"description":"","name":"content","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"defaultValue":null,"description":"","name":"views","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}}},{"defaultValue":null,"description":"","name":"belongsTo","type":{"kind":"ENUM","name":"Package","ofType":null}}],"interfaces":null,"kind":"INPUT_OBJECT","name":"CreateSectionInput","possibleTypes":null},{"description":"","enumValues":null,"fields":null,"inputFields":[{"defaultValue":null,"description":"","name":"chapterId","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}}},{"defaultValue":null,"description":"","name":"number","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}}},{"defaultValue":null,"description":"","name":"title","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"defaultValue":null,"description":"","name":"content","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"defaultValue":null,"description":"","name":"views","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}}},{"defaultValue":null,"description":"","name":"belongsTo","type":{"kind":"ENUM","name":"Package","ofType":null}}],"interfaces":null,"kind":"INPUT_OBJECT","name":"UpdateSectionInput","possibleTypes":null},{"description":"","enumValues":null,"fields":null,"inputFields":[{"defaultValue":null,"description":"","name":"number","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Int","ofType":null}}},{"defaultValue":null,"description":"","name":"title","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}}],"interfaces":null,"kind":"INPUT_OBJECT","name":"CreateChapterInput","possibleTypes":null},{"description":"","enumValues":null,"fields":null,"inputFields":[{"defaultValue":null,"description":"","name":"title","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}}],"interfaces":null,"kind":"INPUT_OBJECT","name":"UpdateChapterInput","possibleTypes":null},{"description":"","enumValues":null,"fields":null,"inputFields":[{"defaultValue":null,"description":"","name":"name","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"defaultValue":null,"description":"","name":"username","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"defaultValue":null,"description":"","name":"email","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"defaultValue":null,"description":"","name":"emailVerified","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}}},{"defaultValue":null,"description":"","name":"authId","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"defaultValue":null,"description":"","name":"photo","type":{"kind":"SCALAR","name":"String","ofType":null}}],"interfaces":null,"kind":"INPUT_OBJECT","name":"CreateUserInput","possibleTypes":null},{"description":"","enumValues":null,"fields":null,"inputFields":[{"defaultValue":null,"description":"","name":"firstName","type":{"kind":"SCALAR","name":"String","ofType":null}},{"defaultValue":null,"description":"","name":"lastName","type":{"kind":"SCALAR","name":"String","ofType":null}},{"defaultValue":null,"description":"","name":"photo","type":{"kind":"SCALAR","name":"String","ofType":null}}],"interfaces":null,"kind":"INPUT_OBJECT","name":"UpdateUserInput","possibleTypes":null},{"description":"","enumValues":null,"fields":null,"inputFields":[{"defaultValue":null,"description":"","name":"text","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"defaultValue":null,"description":"","name":"stars","type":{"kind":"SCALAR","name":"Int","ofType":null}}],"interfaces":null,"kind":"INPUT_OBJECT","name":"CreateReviewInput","possibleTypes":null},{"description":"","enumValues":null,"fields":null,"inputFields":[{"defaultValue":null,"description":"","name":"text","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"defaultValue":null,"description":"","name":"stars","type":{"kind":"SCALAR","name":"Int","ofType":null}}],"interfaces":null,"kind":"INPUT_OBJECT","name":"UpdateReviewInput","possibleTypes":null},{"description":"","enumValues":null,"fields":null,"inputFields":[{"defaultValue":null,"description":"","name":"package","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"defaultValue":null,"description":"","name":"stripeToken","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"defaultValue":null,"description":"","name":"teamLicenses","type":{"kind":"SCALAR","name":"Int","ofType":null}},{"defaultValue":null,"description":"","name":"email","type":{"kind":"SCALAR","name":"String","ofType":null}},{"defaultValue":null,"description":"","name":"addresses","type":{"kind":"INPUT_OBJECT","name":"Addresses","ofType":null}}],"interfaces":null,"kind":"INPUT_OBJECT","name":"ChargeInput","possibleTypes":null},{"description":"","enumValues":null,"fields":null,"inputFields":[{"defaultValue":null,"description":"","name":"billing_name","type":{"kind":"SCALAR","name":"String","ofType":null}},{"defaultValue":null,"description":"","name":"billing_address_country","type":{"kind":"SCALAR","name":"String","ofType":null}},{"defaultValue":null,"description":"","name":"billing_address_zip","type":{"kind":"SCALAR","name":"String","ofType":null}},{"defaultValue":null,"description":"","name":"billing_address_state","type":{"kind":"SCALAR","name":"String","ofType":null}},{"defaultValue":null,"description":"","name":"billing_address_line1","type":{"kind":"SCALAR","name":"String","ofType":null}},{"defaultValue":null,"description":"","name":"billing_address_city","type":{"kind":"SCALAR","name":"String","ofType":null}},{"defaultValue":null,"description":"","name":"billing_address_country_code","type":{"kind":"SCALAR","name":"String","ofType":null}},{"defaultValue":null,"description":"","name":"shipping_name","type":{"kind":"SCALAR","name":"String","ofType":null}},{"defaultValue":null,"description":"","name":"shipping_address_country","type":{"kind":"SCALAR","name":"String","ofType":null}},{"defaultValue":null,"description":"","name":"shipping_address_zip","type":{"kind":"SCALAR","name":"String","ofType":null}},{"defaultValue":null,"description":"","name":"shipping_address_state","type":{"kind":"SCALAR","name":"String","ofType":null}},{"defaultValue":null,"description":"","name":"shipping_address_line1","type":{"kind":"SCALAR","name":"String","ofType":null}},{"defaultValue":null,"description":"","name":"shipping_address_city","type":{"kind":"SCALAR","name":"String","ofType":null}},{"defaultValue":null,"description":"","name":"shipping_address_country_code","type":{"kind":"SCALAR","name":"String","ofType":null}}],"interfaces":null,"kind":"INPUT_OBJECT","name":"Addresses","possibleTypes":null},{"description":"","enumValues":[{"deprecationReason":null,"description":"","isDeprecated":false,"name":"GRAY"},{"deprecationReason":null,"description":"","isDeprecated":false,"name":"NAVY"},{"deprecationReason":null,"description":"","isDeprecated":false,"name":"CONTOURED"}],"fields":null,"inputFields":null,"interfaces":null,"kind":"ENUM","name":"Shirt","possibleTypes":null},{"description":"","enumValues":[{"deprecationReason":null,"description":"","isDeprecated":false,"name":"S"},{"deprecationReason":null,"description":"","isDeprecated":false,"name":"M"},{"deprecationReason":null,"description":"","isDeprecated":false,"name":"L"},{"deprecationReason":null,"description":"","isDeprecated":false,"name":"XL"},{"deprecationReason":null,"description":"","isDeprecated":false,"name":"XXL"}],"fields":null,"inputFields":null,"interfaces":null,"kind":"ENUM","name":"Size","possibleTypes":null},{"description":"","enumValues":null,"fields":[{"args":[],"deprecationReason":null,"description":"A placeholder, please ignore","isDeprecated":false,"name":"xxx","type":{"kind":"SCALAR","name":"Int","ofType":null}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"githubStars","type":{"kind":"SCALAR","name":"Int","ofType":null}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"reviewCreated","type":{"kind":"OBJECT","name":"Review","ofType":null}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"reviewUpdated","type":{"kind":"OBJECT","name":"Review","ofType":null}},{"args":[],"deprecationReason":null,"description":"","isDeprecated":false,"name":"reviewDeleted","type":{"kind":"SCALAR","name":"ObjID","ofType":null}}],"inputFields":null,"interfaces":[],"kind":"OBJECT","name":"Subscription","possibleTypes":null},{"description":"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.","enumValues":null,"fields":[{"args":[],"deprecationReason":null,"description":"A list of all types supported by this server.","isDeprecated":false,"name":"types","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Type","ofType":null}}}}},{"args":[],"deprecationReason":null,"description":"The type that query operations will be rooted at.","isDeprecated":false,"name":"queryType","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Type","ofType":null}}},{"args":[],"deprecationReason":null,"description":"If this server supports mutation, the type that mutation operations will be rooted at.","isDeprecated":false,"name":"mutationType","type":{"kind":"OBJECT","name":"__Type","ofType":null}},{"args":[],"deprecationReason":null,"description":"If this server support subscription, the type that subscription operations will be rooted at.","isDeprecated":false,"name":"subscriptionType","type":{"kind":"OBJECT","name":"__Type","ofType":null}},{"args":[],"deprecationReason":null,"description":"A list of all directives supported by this server.","isDeprecated":false,"name":"directives","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Directive","ofType":null}}}}}],"inputFields":null,"interfaces":[],"kind":"OBJECT","name":"__Schema","possibleTypes":null},{"description":"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name and description, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.","enumValues":null,"fields":[{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"kind","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"ENUM","name":"__TypeKind","ofType":null}}},{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"name","type":{"kind":"SCALAR","name":"String","ofType":null}},{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"description","type":{"kind":"SCALAR","name":"String","ofType":null}},{"args":[{"defaultValue":"false","description":null,"name":"includeDeprecated","type":{"kind":"SCALAR","name":"Boolean","ofType":null}}],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"fields","type":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Field","ofType":null}}}},{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"interfaces","type":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Type","ofType":null}}}},{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"possibleTypes","type":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Type","ofType":null}}}},{"args":[{"defaultValue":"false","description":null,"name":"includeDeprecated","type":{"kind":"SCALAR","name":"Boolean","ofType":null}}],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"enumValues","type":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__EnumValue","ofType":null}}}},{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"inputFields","type":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__InputValue","ofType":null}}}},{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"ofType","type":{"kind":"OBJECT","name":"__Type","ofType":null}}],"inputFields":null,"interfaces":[],"kind":"OBJECT","name":"__Type","possibleTypes":null},{"description":"An enum describing what kind of type a given `__Type` is.","enumValues":[{"deprecationReason":null,"description":"Indicates this type is a scalar.","isDeprecated":false,"name":"SCALAR"},{"deprecationReason":null,"description":"Indicates this type is an object. `fields` and `interfaces` are valid fields.","isDeprecated":false,"name":"OBJECT"},{"deprecationReason":null,"description":"Indicates this type is an interface. `fields` and `possibleTypes` are valid fields.","isDeprecated":false,"name":"INTERFACE"},{"deprecationReason":null,"description":"Indicates this type is a union. `possibleTypes` is a valid field.","isDeprecated":false,"name":"UNION"},{"deprecationReason":null,"description":"Indicates this type is an enum. `enumValues` is a valid field.","isDeprecated":false,"name":"ENUM"},{"deprecationReason":null,"description":"Indicates this type is an input object. `inputFields` is a valid field.","isDeprecated":false,"name":"INPUT_OBJECT"},{"deprecationReason":null,"description":"Indicates this type is a list. `ofType` is a valid field.","isDeprecated":false,"name":"LIST"},{"deprecationReason":null,"description":"Indicates this type is a non-null. `ofType` is a valid field.","isDeprecated":false,"name":"NON_NULL"}],"fields":null,"inputFields":null,"interfaces":null,"kind":"ENUM","name":"__TypeKind","possibleTypes":null},{"description":"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.","enumValues":null,"fields":[{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"name","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"description","type":{"kind":"SCALAR","name":"String","ofType":null}},{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"args","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__InputValue","ofType":null}}}}},{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"type","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Type","ofType":null}}},{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"isDeprecated","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}}},{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"deprecationReason","type":{"kind":"SCALAR","name":"String","ofType":null}}],"inputFields":null,"interfaces":[],"kind":"OBJECT","name":"__Field","possibleTypes":null},{"description":"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.","enumValues":null,"fields":[{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"name","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"description","type":{"kind":"SCALAR","name":"String","ofType":null}},{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"type","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__Type","ofType":null}}},{"args":[],"deprecationReason":null,"description":"A GraphQL-formatted string representing the default value for this input value.","isDeprecated":false,"name":"defaultValue","type":{"kind":"SCALAR","name":"String","ofType":null}}],"inputFields":null,"interfaces":[],"kind":"OBJECT","name":"__InputValue","possibleTypes":null},{"description":"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.","enumValues":null,"fields":[{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"name","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"description","type":{"kind":"SCALAR","name":"String","ofType":null}},{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"isDeprecated","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}}},{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"deprecationReason","type":{"kind":"SCALAR","name":"String","ofType":null}}],"inputFields":null,"interfaces":[],"kind":"OBJECT","name":"__EnumValue","possibleTypes":null},{"description":"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.","enumValues":null,"fields":[{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"name","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"String","ofType":null}}},{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"description","type":{"kind":"SCALAR","name":"String","ofType":null}},{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"locations","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"ENUM","name":"__DirectiveLocation","ofType":null}}}}},{"args":[],"deprecationReason":null,"description":null,"isDeprecated":false,"name":"args","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"LIST","name":null,"ofType":{"kind":"NON_NULL","name":null,"ofType":{"kind":"OBJECT","name":"__InputValue","ofType":null}}}}},{"args":[],"deprecationReason":"Use `locations`.","description":null,"isDeprecated":true,"name":"onOperation","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}}},{"args":[],"deprecationReason":"Use `locations`.","description":null,"isDeprecated":true,"name":"onFragment","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}}},{"args":[],"deprecationReason":"Use `locations`.","description":null,"isDeprecated":true,"name":"onField","type":{"kind":"NON_NULL","name":null,"ofType":{"kind":"SCALAR","name":"Boolean","ofType":null}}}],"inputFields":null,"interfaces":[],"kind":"OBJECT","name":"__Directive","possibleTypes":null},{"description":"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.","enumValues":[{"deprecationReason":null,"description":"Location adjacent to a query operation.","isDeprecated":false,"name":"QUERY"},{"deprecationReason":null,"description":"Location adjacent to a mutation operation.","isDeprecated":false,"name":"MUTATION"},{"deprecationReason":null,"description":"Location adjacent to a subscription operation.","isDeprecated":false,"name":"SUBSCRIPTION"},{"deprecationReason":null,"description":"Location adjacent to a field.","isDeprecated":false,"name":"FIELD"},{"deprecationReason":null,"description":"Location adjacent to a fragment definition.","isDeprecated":false,"name":"FRAGMENT_DEFINITION"},{"deprecationReason":null,"description":"Location adjacent to a fragment spread.","isDeprecated":false,"name":"FRAGMENT_SPREAD"},{"deprecationReason":null,"description":"Location adjacent to an inline fragment.","isDeprecated":false,"name":"INLINE_FRAGMENT"},{"deprecationReason":null,"description":"Location adjacent to a schema definition.","isDeprecated":false,"name":"SCHEMA"},{"deprecationReason":null,"description":"Location adjacent to a scalar definition.","isDeprecated":false,"name":"SCALAR"},{"deprecationReason":null,"description":"Location adjacent to an object type definition.","isDeprecated":false,"name":"OBJECT"},{"deprecationReason":null,"description":"Location adjacent to a field definition.","isDeprecated":false,"name":"FIELD_DEFINITION"},{"deprecationReason":null,"description":"Location adjacent to an argument definition.","isDeprecated":false,"name":"ARGUMENT_DEFINITION"},{"deprecationReason":null,"description":"Location adjacent to an interface definition.","isDeprecated":false,"name":"INTERFACE"},{"deprecationReason":null,"description":"Location adjacent to a union definition.","isDeprecated":false,"name":"UNION"},{"deprecationReason":null,"description":"Location adjacent to an enum definition.","isDeprecated":false,"name":"ENUM"},{"deprecationReason":null,"description":"Location adjacent to an enum value definition.","isDeprecated":false,"name":"ENUM_VALUE"},{"deprecationReason":null,"description":"Location adjacent to an input object type definition.","isDeprecated":false,"name":"INPUT_OBJECT"},{"deprecationReason":null,"description":"Location adjacent to an input object field definition.","isDeprecated":false,"name":"INPUT_FIELD_DEFINITION"}],"fields":null,"inputFields":null,"interfaces":null,"kind":"ENUM","name":"__DirectiveLocation","possibleTypes":null}]}}} From af56096276327f7ba988a4ee563e670579caefb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Loren=20=F0=9F=A4=93?= <lorensr@gmail.com> Date: Fri, 24 Jul 2020 02:02:37 -0400 Subject: [PATCH 4/6] Add Chapters query --- .../guide/graphql/toc/Chapters.graphql | 7 ++++ .../java/guide/graphql/toc/data/Apollo.kt | 11 ++++++ .../toc/ui/chapters/ChaptersAdapter.kt | 25 ++++++++++--- .../toc/ui/chapters/ChaptersFragment.kt | 36 +++++++++++++++---- 4 files changed, 67 insertions(+), 12 deletions(-) create mode 100644 app/src/main/graphql/guide/graphql/toc/Chapters.graphql create mode 100644 app/src/main/java/guide/graphql/toc/data/Apollo.kt diff --git a/app/src/main/graphql/guide/graphql/toc/Chapters.graphql b/app/src/main/graphql/guide/graphql/toc/Chapters.graphql new file mode 100644 index 0000000..fe4f4c3 --- /dev/null +++ b/app/src/main/graphql/guide/graphql/toc/Chapters.graphql @@ -0,0 +1,7 @@ +query Chapters { + chapters { + id + number + title + } +} \ No newline at end of file diff --git a/app/src/main/java/guide/graphql/toc/data/Apollo.kt b/app/src/main/java/guide/graphql/toc/data/Apollo.kt new file mode 100644 index 0000000..6a91dc6 --- /dev/null +++ b/app/src/main/java/guide/graphql/toc/data/Apollo.kt @@ -0,0 +1,11 @@ +package guide.graphql.toc.data + +import com.apollographql.apollo.ApolloClient + +object Apollo { + val client: ApolloClient by lazy { + ApolloClient.builder() + .serverUrl("https://api.graphql.guide/graphql") + .build() + } +} \ No newline at end of file diff --git a/app/src/main/java/guide/graphql/toc/ui/chapters/ChaptersAdapter.kt b/app/src/main/java/guide/graphql/toc/ui/chapters/ChaptersAdapter.kt index b5b1136..26b2404 100644 --- a/app/src/main/java/guide/graphql/toc/ui/chapters/ChaptersAdapter.kt +++ b/app/src/main/java/guide/graphql/toc/ui/chapters/ChaptersAdapter.kt @@ -2,19 +2,22 @@ package guide.graphql.toc.ui.chapters import android.content.Context import android.view.LayoutInflater +import android.view.View import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView +import guide.graphql.toc.ChaptersQuery +import guide.graphql.toc.R import guide.graphql.toc.databinding.ChapterBinding class ChaptersAdapter( private val context: Context, - private var chapters: List<String> = listOf(), - private val onItemClicked: ((String) -> Unit) + private var chapters: List<ChaptersQuery.Chapter> = listOf(), + private val onItemClicked: ((ChaptersQuery.Chapter) -> Unit) ) : RecyclerView.Adapter<ChaptersAdapter.ViewHolder>() { class ViewHolder(val binding: ChapterBinding) : RecyclerView.ViewHolder(binding.root) - fun updateChapters(chapters: List<String>) { + fun updateChapters(chapters: List<ChaptersQuery.Chapter>) { this.chapters = chapters notifyDataSetChanged() } @@ -30,8 +33,20 @@ class ChaptersAdapter( override fun onBindViewHolder(holder: ViewHolder, position: Int) { val chapter = chapters[position] - - holder.binding.chapterHeader.text = chapter + val header = + if (chapter.number == null) chapter.title else context.getString( + R.string.chapter_number, + chapter.number.toInt().toString() + ) + + holder.binding.chapterHeader.text = header + if (chapter.number == null) { + holder.binding.chapterSubheader.visibility = View.GONE + + } else { + holder.binding.chapterSubheader.text = chapter.title + holder.binding.chapterSubheader.visibility = View.VISIBLE + } holder.binding.root.setOnClickListener { onItemClicked.invoke(chapter) diff --git a/app/src/main/java/guide/graphql/toc/ui/chapters/ChaptersFragment.kt b/app/src/main/java/guide/graphql/toc/ui/chapters/ChaptersFragment.kt index 2b57dfb..3049eaf 100644 --- a/app/src/main/java/guide/graphql/toc/ui/chapters/ChaptersFragment.kt +++ b/app/src/main/java/guide/graphql/toc/ui/chapters/ChaptersFragment.kt @@ -6,11 +6,16 @@ import android.view.View import android.view.ViewGroup import android.widget.Toast import androidx.fragment.app.Fragment +import androidx.lifecycle.lifecycleScope import androidx.navigation.fragment.findNavController import androidx.recyclerview.widget.DividerItemDecoration import androidx.recyclerview.widget.LinearLayoutManager +import com.apollographql.apollo.coroutines.toDeferred +import com.apollographql.apollo.exception.ApolloException import com.google.android.material.transition.MaterialSharedAxis +import guide.graphql.toc.ChaptersQuery import guide.graphql.toc.R +import guide.graphql.toc.data.Apollo import guide.graphql.toc.databinding.ChaptersFragmentBinding class ChaptersFragment : Fragment() { @@ -45,12 +50,12 @@ class ChaptersFragment : Fragment() { ) { chapter -> findNavController().navigate( ChaptersFragmentDirections.viewSections( - chapterId = 10, - chapterNumber = 10, - chapterTitle = getString( + chapterId = chapter.id, + chapterNumber = chapter.number?.toInt() ?: -1, + chapterTitle = if (chapter.number == null) chapter.title else getString( R.string.chapter_title, - "10", - "Android Dev" + chapter.number.toInt().toString(), + chapter.title ) ) ) @@ -58,12 +63,29 @@ class ChaptersFragment : Fragment() { val layoutManager = LinearLayoutManager(requireContext()) binding.chapters.layoutManager = layoutManager - + val itemDivider = DividerItemDecoration(requireContext(), layoutManager.orientation) binding.chapters.addItemDecoration(itemDivider) binding.chapters.adapter = adapter - adapter.updateChapters(listOf("Android Dev")) + lifecycleScope.launchWhenStarted { + try { + val response = Apollo.client.query( + ChaptersQuery() + ).toDeferred().await() + + if (response.hasErrors()) { + throw Exception(response.errors?.get(0)?.message) + } + + val chapters = response.data?.chapters ?: throw Exception("Data is null") + adapter.updateChapters(chapters) + } catch (e: ApolloException) { + showErrorMessage("GraphQL request failed") + } catch (e: Exception) { + showErrorMessage(e.message.orEmpty()) + } + } } override fun onDestroyView() { From 83b54733230206ad0d19f011c2b81cb420ea7114 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Loren=20=F0=9F=A4=93?= <lorensr@gmail.com> Date: Mon, 27 Jul 2020 02:08:14 -0400 Subject: [PATCH 5/6] Add Sections query --- .../guide/graphql/toc/Sections.graphql | 8 +++++ .../toc/ui/sections/SectionsAdapter.kt | 23 +++++++++++-- .../toc/ui/sections/SectionsFragment.kt | 33 ++++++++++++++++++- 3 files changed, 60 insertions(+), 4 deletions(-) create mode 100644 app/src/main/graphql/guide/graphql/toc/Sections.graphql diff --git a/app/src/main/graphql/guide/graphql/toc/Sections.graphql b/app/src/main/graphql/guide/graphql/toc/Sections.graphql new file mode 100644 index 0000000..3f11642 --- /dev/null +++ b/app/src/main/graphql/guide/graphql/toc/Sections.graphql @@ -0,0 +1,8 @@ +query Sections($id: Int!) { + chapter(id: $id) { + sections { + number + title + } + } +} \ No newline at end of file diff --git a/app/src/main/java/guide/graphql/toc/ui/sections/SectionsAdapter.kt b/app/src/main/java/guide/graphql/toc/ui/sections/SectionsAdapter.kt index 826e21f..94259e1 100644 --- a/app/src/main/java/guide/graphql/toc/ui/sections/SectionsAdapter.kt +++ b/app/src/main/java/guide/graphql/toc/ui/sections/SectionsAdapter.kt @@ -5,17 +5,24 @@ import android.view.LayoutInflater import android.view.ViewGroup import androidx.recyclerview.widget.RecyclerView import guide.graphql.toc.R +import guide.graphql.toc.SectionsQuery import guide.graphql.toc.databinding.SectionBinding class SectionsAdapter( private val context: Context, - private val chapterNumber: Int + private val chapterNumber: Int, + private var sections: List<SectionsQuery.Section> = listOf() ) : RecyclerView.Adapter<SectionsAdapter.ViewHolder>() { + fun updateSections(sections: List<SectionsQuery.Section>) { + this.sections = sections + notifyDataSetChanged() + } + class ViewHolder(val binding: SectionBinding) : RecyclerView.ViewHolder(binding.root) override fun getItemCount(): Int { - return 0 + return sections.size } override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { @@ -23,5 +30,15 @@ class SectionsAdapter( return ViewHolder(binding) } - override fun onBindViewHolder(holder: ViewHolder, position: Int) {} + override fun onBindViewHolder(holder: ViewHolder, position: Int) { + val section = sections[position] + section.let { + holder.binding.sectionTitle.text = context.getString( + R.string.section_title, + chapterNumber.toString(), + section.number.toString(), + section.title + ) + } + } } \ No newline at end of file diff --git a/app/src/main/java/guide/graphql/toc/ui/sections/SectionsFragment.kt b/app/src/main/java/guide/graphql/toc/ui/sections/SectionsFragment.kt index 243e7d5..e8d8f84 100644 --- a/app/src/main/java/guide/graphql/toc/ui/sections/SectionsFragment.kt +++ b/app/src/main/java/guide/graphql/toc/ui/sections/SectionsFragment.kt @@ -5,10 +5,15 @@ import android.view.LayoutInflater import android.view.View import android.view.ViewGroup import androidx.fragment.app.Fragment +import androidx.lifecycle.lifecycleScope import androidx.navigation.fragment.navArgs import androidx.recyclerview.widget.DividerItemDecoration import androidx.recyclerview.widget.LinearLayoutManager +import com.apollographql.apollo.coroutines.toDeferred +import com.apollographql.apollo.exception.ApolloException import com.google.android.material.transition.MaterialSharedAxis +import guide.graphql.toc.SectionsQuery +import guide.graphql.toc.data.Apollo import guide.graphql.toc.databinding.SectionsFragmentBinding class SectionsFragment : Fragment() { @@ -52,7 +57,33 @@ class SectionsFragment : Fragment() { binding.sections.addItemDecoration(itemDivider) binding.sections.adapter = adapter - showErrorMessage("No sections") + lifecycleScope.launchWhenStarted { + binding.spinner.visibility = View.VISIBLE + binding.error.visibility = View.GONE + try { + val response = Apollo.client.query( + SectionsQuery(id = args.chapterId) + ).toDeferred().await() + + if (response.hasErrors()) { + throw Exception("Response has errors") + } + + val sections = response.data?.chapter?.sections ?: throw Exception("Data is null") + + if (sections.size > 1) { + adapter.updateSections(sections) + binding.spinner.visibility = View.GONE + binding.error.visibility = View.GONE + } else { + throw Exception("No sections") + } + } catch (e: ApolloException) { + showErrorMessage("GraphQL request failed") + } catch (e: Exception) { + showErrorMessage(e.message.orEmpty()) + } + } } override fun onDestroyView() { From d81ba4f2dce096009428e5f9be80a41ad6270fdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Loren=20=F0=9F=A4=93?= <lorensr@gmail.com> Date: Fri, 31 Jul 2020 16:30:14 -0400 Subject: [PATCH 6/6] Add caching --- app/src/main/java/guide/graphql/toc/data/Apollo.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/guide/graphql/toc/data/Apollo.kt b/app/src/main/java/guide/graphql/toc/data/Apollo.kt index 6a91dc6..612bbcd 100644 --- a/app/src/main/java/guide/graphql/toc/data/Apollo.kt +++ b/app/src/main/java/guide/graphql/toc/data/Apollo.kt @@ -1,11 +1,17 @@ package guide.graphql.toc.data import com.apollographql.apollo.ApolloClient +import com.apollographql.apollo.cache.normalized.lru.EvictionPolicy +import com.apollographql.apollo.cache.normalized.lru.LruNormalizedCacheFactory object Apollo { val client: ApolloClient by lazy { + val cacheFactory = + LruNormalizedCacheFactory(EvictionPolicy.builder().maxSizeBytes(10 * 1024 * 1024).build()) + ApolloClient.builder() .serverUrl("https://api.graphql.guide/graphql") + .normalizedCache(cacheFactory) .build() } -} \ No newline at end of file +}