├── 01-configuring-nuxt-and-amplify ├── .editorconfig ├── .gitignore ├── .prettierrc ├── README.md ├── assets │ ├── README.md │ └── css │ │ └── tailwind.css ├── components │ ├── Logo.vue │ └── README.md ├── jsconfig.json ├── layouts │ ├── README.md │ └── default.vue ├── middleware │ └── README.md ├── nuxt.config.js ├── package-lock.json ├── package.json ├── pages │ ├── README.md │ └── index.vue ├── plugins │ ├── README.md │ └── amplify.js ├── static │ ├── README.md │ └── favicon.ico ├── store │ └── README.md └── tailwind.config.js ├── 02-adding-authentication ├── .editorconfig ├── .gitignore ├── .prettierrc ├── README.md ├── assets │ ├── README.md │ └── css │ │ └── tailwind.css ├── components │ ├── Logo.vue │ └── README.md ├── jsconfig.json ├── layouts │ ├── README.md │ └── default.vue ├── middleware │ └── README.md ├── nuxt.config.js ├── package-lock.json ├── package.json ├── pages │ ├── README.md │ ├── index.vue │ ├── login.vue │ └── register.vue ├── plugins │ ├── README.md │ ├── amplify.js │ └── auth.js ├── static │ ├── README.md │ └── favicon.ico ├── store │ ├── README.md │ ├── auth.js │ └── index.js └── tailwind.config.js ├── 03-adding-graphql-api ├── .editorconfig ├── .gitignore ├── .graphqlconfig.yml ├── .prettierrc ├── README.md ├── assets │ ├── README.md │ └── css │ │ └── tailwind.css ├── components │ ├── Logo.vue │ └── README.md ├── jsconfig.json ├── layouts │ ├── README.md │ └── default.vue ├── middleware │ └── README.md ├── nuxt.config.js ├── package-lock.json ├── package.json ├── pages │ ├── README.md │ ├── index.vue │ ├── login.vue │ ├── posts │ │ ├── _id │ │ │ ├── edit.vue │ │ │ └── index.vue │ │ └── create.vue │ └── register.vue ├── plugins │ ├── README.md │ ├── amplify.js │ └── auth.js ├── src │ └── graphql │ │ ├── mutations.js │ │ ├── queries.js │ │ ├── schema.json │ │ └── subscriptions.js ├── static │ ├── README.md │ └── favicon.ico ├── store │ ├── README.md │ ├── api.js │ ├── auth.js │ ├── index.js │ └── user.js └── tailwind.config.js └── readme.md /01-configuring-nuxt-and-amplify/.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /01-configuring-nuxt-and-amplify/.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### Node template 3 | # Logs 4 | /logs 5 | *.log 6 | npm-debug.log* 7 | yarn-debug.log* 8 | yarn-error.log* 9 | 10 | # Runtime data 11 | pids 12 | *.pid 13 | *.seed 14 | *.pid.lock 15 | 16 | # Directory for instrumented libs generated by jscoverage/JSCover 17 | lib-cov 18 | 19 | # Coverage directory used by tools like istanbul 20 | coverage 21 | 22 | # nyc test coverage 23 | .nyc_output 24 | 25 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 26 | .grunt 27 | 28 | # Bower dependency directory (https://bower.io/) 29 | bower_components 30 | 31 | # node-waf configuration 32 | .lock-wscript 33 | 34 | # Compiled binary addons (https://nodejs.org/api/addons.html) 35 | build/Release 36 | 37 | # Dependency directories 38 | node_modules/ 39 | jspm_packages/ 40 | 41 | # TypeScript v1 declaration files 42 | typings/ 43 | 44 | # Optional npm cache directory 45 | .npm 46 | 47 | # Optional eslint cache 48 | .eslintcache 49 | 50 | # Optional REPL history 51 | .node_repl_history 52 | 53 | # Output of 'npm pack' 54 | *.tgz 55 | 56 | # Yarn Integrity file 57 | .yarn-integrity 58 | 59 | # dotenv environment variables file 60 | .env 61 | 62 | # parcel-bundler cache (https://parceljs.org/) 63 | .cache 64 | 65 | # next.js build output 66 | .next 67 | 68 | # nuxt.js build output 69 | .nuxt 70 | 71 | # Nuxt generate 72 | dist 73 | 74 | # vuepress build output 75 | .vuepress/dist 76 | 77 | # Serverless directories 78 | .serverless 79 | 80 | # IDE / Editor 81 | .idea 82 | 83 | # Service worker 84 | sw.* 85 | 86 | # Mac OSX 87 | .DS_Store 88 | 89 | # Vim swap files 90 | *.swp 91 | 92 | #amplify 93 | amplify/\#current-cloud-backend 94 | amplify/.config/local-* 95 | amplify/mock-data 96 | amplify/backend/amplify-meta.json 97 | amplify/backend/awscloudformation 98 | build/ 99 | dist/ 100 | node_modules/ 101 | aws-exports.js 102 | awsconfiguration.json 103 | amplifyconfiguration.json 104 | amplify-gradle-config.json 105 | amplifyxc.config -------------------------------------------------------------------------------- /01-configuring-nuxt-and-amplify/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": false, 3 | "singleQuote": true 4 | } 5 | -------------------------------------------------------------------------------- /01-configuring-nuxt-and-amplify/README.md: -------------------------------------------------------------------------------- 1 | # amplify-nuxt 2 | 3 | > My awe-inspiring Nuxt.js project 4 | 5 | ## Build Setup 6 | 7 | ``` bash 8 | # install dependencies 9 | $ npm run install 10 | 11 | # serve with hot reload at localhost:3000 12 | $ npm run dev 13 | 14 | # build for production and launch server 15 | $ npm run build 16 | $ npm run start 17 | 18 | # generate static project 19 | $ npm run generate 20 | ``` 21 | 22 | For detailed explanation on how things work, check out [Nuxt.js docs](https://nuxtjs.org). 23 | -------------------------------------------------------------------------------- /01-configuring-nuxt-and-amplify/assets/README.md: -------------------------------------------------------------------------------- 1 | # ASSETS 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your un-compiled assets such as LESS, SASS, or JavaScript. 6 | 7 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#webpacked). 8 | -------------------------------------------------------------------------------- /01-configuring-nuxt-and-amplify/assets/css/tailwind.css: -------------------------------------------------------------------------------- 1 | @import 'tailwindcss/base'; 2 | @import 'tailwindcss/components'; 3 | @import 'tailwindcss/utilities'; 4 | -------------------------------------------------------------------------------- /01-configuring-nuxt-and-amplify/components/Logo.vue: -------------------------------------------------------------------------------- 1 | 20 | 34 | -------------------------------------------------------------------------------- /01-configuring-nuxt-and-amplify/components/README.md: -------------------------------------------------------------------------------- 1 | # COMPONENTS 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | The components directory contains your Vue.js Components. 6 | 7 | _Nuxt.js doesn't supercharge these components._ 8 | -------------------------------------------------------------------------------- /01-configuring-nuxt-and-amplify/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": ".", 4 | "paths": { 5 | "~/*": ["./*"], 6 | "@/*": ["./*"], 7 | "~~/*": ["./*"], 8 | "@@/*": ["./*"] 9 | } 10 | }, 11 | "exclude": ["node_modules", ".nuxt", "dist"] 12 | } 13 | -------------------------------------------------------------------------------- /01-configuring-nuxt-and-amplify/layouts/README.md: -------------------------------------------------------------------------------- 1 | # LAYOUTS 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your Application Layouts. 6 | 7 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/views#layouts). 8 | -------------------------------------------------------------------------------- /01-configuring-nuxt-and-amplify/layouts/default.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 56 | -------------------------------------------------------------------------------- /01-configuring-nuxt-and-amplify/middleware/README.md: -------------------------------------------------------------------------------- 1 | # MIDDLEWARE 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your application middleware. 6 | Middleware let you define custom functions that can be run before rendering either a page or a group of pages. 7 | 8 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/routing#middleware). 9 | -------------------------------------------------------------------------------- /01-configuring-nuxt-and-amplify/nuxt.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | mode: 'spa', 3 | /* 4 | ** Headers of the page 5 | */ 6 | head: { 7 | title: process.env.npm_package_name || '', 8 | meta: [ 9 | { charset: 'utf-8' }, 10 | { name: 'viewport', content: 'width=device-width, initial-scale=1' }, 11 | { 12 | hid: 'description', 13 | name: 'description', 14 | content: process.env.npm_package_description || '' 15 | } 16 | ], 17 | link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }] 18 | }, 19 | /* 20 | ** Customize the progress-bar color 21 | */ 22 | loading: { color: '#fff' }, 23 | /* 24 | ** Global CSS 25 | */ 26 | css: [], 27 | /* 28 | ** Plugins to load before mounting the App 29 | */ 30 | plugins: [{ src: '~/plugins/amplify.js', mode: 'client' }], 31 | /* 32 | ** Nuxt.js dev-modules 33 | */ 34 | buildModules: [ 35 | // Doc: https://github.com/nuxt-community/nuxt-tailwindcss 36 | '@nuxtjs/tailwindcss' 37 | ], 38 | /* 39 | ** Nuxt.js modules 40 | */ 41 | modules: [ 42 | // Doc: https://axios.nuxtjs.org/usage 43 | '@nuxtjs/axios' 44 | ], 45 | /* 46 | ** Axios module configuration 47 | ** See https://axios.nuxtjs.org/options 48 | */ 49 | axios: {}, 50 | /* 51 | ** Build configuration 52 | */ 53 | build: { 54 | /* 55 | ** You can extend webpack config here 56 | */ 57 | extend(config, ctx) {} 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /01-configuring-nuxt-and-amplify/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "amplify-nuxt", 3 | "version": "1.0.0", 4 | "description": "My awe-inspiring Nuxt.js project", 5 | "author": "tomgobich", 6 | "private": true, 7 | "scripts": { 8 | "dev": "nuxt", 9 | "build": "nuxt build", 10 | "start": "nuxt start", 11 | "generate": "nuxt generate" 12 | }, 13 | "dependencies": { 14 | "@nuxtjs/axios": "^5.3.6", 15 | "aws-amplify": "^2.2.2", 16 | "nuxt": "^2.0.0" 17 | }, 18 | "devDependencies": { 19 | "@nuxtjs/tailwindcss": "^1.0.0", 20 | "eslint-config-prettier": "^4.1.0", 21 | "eslint-plugin-prettier": "^3.0.1", 22 | "prettier": "^1.16.4" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /01-configuring-nuxt-and-amplify/pages/README.md: -------------------------------------------------------------------------------- 1 | # PAGES 2 | 3 | This directory contains your Application Views and Routes. 4 | The framework reads all the `*.vue` files inside this directory and creates the router of your application. 5 | 6 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/routing). 7 | -------------------------------------------------------------------------------- /01-configuring-nuxt-and-amplify/pages/index.vue: -------------------------------------------------------------------------------- 1 | 30 | 31 | 40 | 41 | 78 | -------------------------------------------------------------------------------- /01-configuring-nuxt-and-amplify/plugins/README.md: -------------------------------------------------------------------------------- 1 | # PLUGINS 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains Javascript plugins that you want to run before mounting the root Vue.js application. 6 | 7 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/plugins). 8 | -------------------------------------------------------------------------------- /01-configuring-nuxt-and-amplify/plugins/amplify.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Note: 3 | * In the video I install and import aws-amplify-vue. 4 | * We won't actually be using that package at all, 5 | * so feel free to uninstall and change your amplify plugin to the below. 6 | */ 7 | import Amplify from 'aws-amplify' 8 | import awsconfig from '~/aws-exports' 9 | 10 | Amplify.configure(awsconfig) 11 | -------------------------------------------------------------------------------- /01-configuring-nuxt-and-amplify/static/README.md: -------------------------------------------------------------------------------- 1 | # STATIC 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your static files. 6 | Each file inside this directory is mapped to `/`. 7 | Thus you'd want to delete this README.md before deploying to production. 8 | 9 | Example: `/static/robots.txt` is mapped as `/robots.txt`. 10 | 11 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#static). 12 | -------------------------------------------------------------------------------- /01-configuring-nuxt-and-amplify/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adocasts/amplify-nuxt/cb272a3e32d1cb2f2342e580761b9e5952c08bbc/01-configuring-nuxt-and-amplify/static/favicon.ico -------------------------------------------------------------------------------- /01-configuring-nuxt-and-amplify/store/README.md: -------------------------------------------------------------------------------- 1 | # STORE 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your Vuex Store files. 6 | Vuex Store option is implemented in the Nuxt.js framework. 7 | 8 | Creating a file in this directory automatically activates the option in the framework. 9 | 10 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/vuex-store). 11 | -------------------------------------------------------------------------------- /01-configuring-nuxt-and-amplify/tailwind.config.js: -------------------------------------------------------------------------------- 1 | /* 2 | ** TailwindCSS Configuration File 3 | ** 4 | ** Docs: https://tailwindcss.com/docs/configuration 5 | ** Default: https://github.com/tailwindcss/tailwindcss/blob/master/stubs/defaultConfig.stub.js 6 | */ 7 | module.exports = { 8 | theme: {}, 9 | variants: {}, 10 | plugins: [] 11 | } 12 | -------------------------------------------------------------------------------- /02-adding-authentication/.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /02-adding-authentication/.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### Node template 3 | # Logs 4 | /logs 5 | *.log 6 | npm-debug.log* 7 | yarn-debug.log* 8 | yarn-error.log* 9 | 10 | # Runtime data 11 | pids 12 | *.pid 13 | *.seed 14 | *.pid.lock 15 | 16 | # Directory for instrumented libs generated by jscoverage/JSCover 17 | lib-cov 18 | 19 | # Coverage directory used by tools like istanbul 20 | coverage 21 | 22 | # nyc test coverage 23 | .nyc_output 24 | 25 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 26 | .grunt 27 | 28 | # Bower dependency directory (https://bower.io/) 29 | bower_components 30 | 31 | # node-waf configuration 32 | .lock-wscript 33 | 34 | # Compiled binary addons (https://nodejs.org/api/addons.html) 35 | build/Release 36 | 37 | # Dependency directories 38 | node_modules/ 39 | jspm_packages/ 40 | 41 | # TypeScript v1 declaration files 42 | typings/ 43 | 44 | # Optional npm cache directory 45 | .npm 46 | 47 | # Optional eslint cache 48 | .eslintcache 49 | 50 | # Optional REPL history 51 | .node_repl_history 52 | 53 | # Output of 'npm pack' 54 | *.tgz 55 | 56 | # Yarn Integrity file 57 | .yarn-integrity 58 | 59 | # dotenv environment variables file 60 | .env 61 | 62 | # parcel-bundler cache (https://parceljs.org/) 63 | .cache 64 | 65 | # next.js build output 66 | .next 67 | 68 | # nuxt.js build output 69 | .nuxt 70 | 71 | # Nuxt generate 72 | dist 73 | 74 | # vuepress build output 75 | .vuepress/dist 76 | 77 | # Serverless directories 78 | .serverless 79 | 80 | # IDE / Editor 81 | .idea 82 | 83 | # Service worker 84 | sw.* 85 | 86 | # Mac OSX 87 | .DS_Store 88 | 89 | # Vim swap files 90 | *.swp 91 | 92 | #amplify 93 | amplify/\#current-cloud-backend 94 | amplify/.config/local-* 95 | amplify/mock-data 96 | amplify/backend/amplify-meta.json 97 | amplify/backend/awscloudformation 98 | build/ 99 | dist/ 100 | node_modules/ 101 | aws-exports.js 102 | awsconfiguration.json 103 | amplifyconfiguration.json 104 | amplify-gradle-config.json 105 | amplifyxc.config -------------------------------------------------------------------------------- /02-adding-authentication/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": false, 3 | "singleQuote": true 4 | } 5 | -------------------------------------------------------------------------------- /02-adding-authentication/README.md: -------------------------------------------------------------------------------- 1 | # amplify-nuxt 2 | 3 | > My awe-inspiring Nuxt.js project 4 | 5 | ## Build Setup 6 | 7 | ``` bash 8 | # install dependencies 9 | $ npm run install 10 | 11 | # serve with hot reload at localhost:3000 12 | $ npm run dev 13 | 14 | # build for production and launch server 15 | $ npm run build 16 | $ npm run start 17 | 18 | # generate static project 19 | $ npm run generate 20 | ``` 21 | 22 | For detailed explanation on how things work, check out [Nuxt.js docs](https://nuxtjs.org). 23 | -------------------------------------------------------------------------------- /02-adding-authentication/assets/README.md: -------------------------------------------------------------------------------- 1 | # ASSETS 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your un-compiled assets such as LESS, SASS, or JavaScript. 6 | 7 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#webpacked). 8 | -------------------------------------------------------------------------------- /02-adding-authentication/assets/css/tailwind.css: -------------------------------------------------------------------------------- 1 | @import 'tailwindcss/base'; 2 | @import 'tailwindcss/components'; 3 | @import 'tailwindcss/utilities'; 4 | -------------------------------------------------------------------------------- /02-adding-authentication/components/Logo.vue: -------------------------------------------------------------------------------- 1 | 20 | 34 | -------------------------------------------------------------------------------- /02-adding-authentication/components/README.md: -------------------------------------------------------------------------------- 1 | # COMPONENTS 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | The components directory contains your Vue.js Components. 6 | 7 | _Nuxt.js doesn't supercharge these components._ 8 | -------------------------------------------------------------------------------- /02-adding-authentication/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": ".", 4 | "paths": { 5 | "~/*": ["./*"], 6 | "@/*": ["./*"], 7 | "~~/*": ["./*"], 8 | "@@/*": ["./*"] 9 | } 10 | }, 11 | "exclude": ["node_modules", ".nuxt", "dist"] 12 | } 13 | -------------------------------------------------------------------------------- /02-adding-authentication/layouts/README.md: -------------------------------------------------------------------------------- 1 | # LAYOUTS 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your Application Layouts. 6 | 7 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/views#layouts). 8 | -------------------------------------------------------------------------------- /02-adding-authentication/layouts/default.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 61 | -------------------------------------------------------------------------------- /02-adding-authentication/middleware/README.md: -------------------------------------------------------------------------------- 1 | # MIDDLEWARE 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your application middleware. 6 | Middleware let you define custom functions that can be run before rendering either a page or a group of pages. 7 | 8 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/routing#middleware). 9 | -------------------------------------------------------------------------------- /02-adding-authentication/nuxt.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | mode: 'spa', 3 | /* 4 | ** Headers of the page 5 | */ 6 | head: { 7 | title: process.env.npm_package_name || '', 8 | meta: [ 9 | { charset: 'utf-8' }, 10 | { name: 'viewport', content: 'width=device-width, initial-scale=1' }, 11 | { 12 | hid: 'description', 13 | name: 'description', 14 | content: process.env.npm_package_description || '' 15 | } 16 | ], 17 | link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }] 18 | }, 19 | /* 20 | ** Customize the progress-bar color 21 | */ 22 | loading: { color: '#fff' }, 23 | /* 24 | ** Global CSS 25 | */ 26 | css: [], 27 | /* 28 | ** Plugins to load before mounting the App 29 | */ 30 | plugins: [{ src: '~/plugins/amplify.js', mode: 'client' }, '~/plugins/auth'], 31 | /* 32 | ** Nuxt.js dev-modules 33 | */ 34 | buildModules: [ 35 | // Doc: https://github.com/nuxt-community/nuxt-tailwindcss 36 | '@nuxtjs/tailwindcss' 37 | ], 38 | /* 39 | ** Nuxt.js modules 40 | */ 41 | modules: [ 42 | // Doc: https://axios.nuxtjs.org/usage 43 | '@nuxtjs/axios' 44 | ], 45 | /* 46 | ** Axios module configuration 47 | ** See https://axios.nuxtjs.org/options 48 | */ 49 | axios: {}, 50 | /* 51 | ** Build configuration 52 | */ 53 | build: { 54 | /* 55 | ** You can extend webpack config here 56 | */ 57 | extend(config, ctx) {} 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /02-adding-authentication/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "amplify-nuxt", 3 | "version": "1.0.0", 4 | "description": "My awe-inspiring Nuxt.js project", 5 | "author": "tomgobich", 6 | "private": true, 7 | "scripts": { 8 | "dev": "nuxt", 9 | "build": "nuxt build", 10 | "start": "nuxt start", 11 | "generate": "nuxt generate" 12 | }, 13 | "dependencies": { 14 | "@nuxtjs/axios": "^5.3.6", 15 | "aws-amplify": "^2.2.2", 16 | "aws-amplify-vue": "^1.1.2", 17 | "nuxt": "^2.0.0" 18 | }, 19 | "devDependencies": { 20 | "@nuxtjs/tailwindcss": "^1.0.0", 21 | "eslint-config-prettier": "^4.1.0", 22 | "eslint-plugin-prettier": "^3.0.1", 23 | "prettier": "^1.16.4" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /02-adding-authentication/pages/README.md: -------------------------------------------------------------------------------- 1 | # PAGES 2 | 3 | This directory contains your Application Views and Routes. 4 | The framework reads all the `*.vue` files inside this directory and creates the router of your application. 5 | 6 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/routing). 7 | -------------------------------------------------------------------------------- /02-adding-authentication/pages/index.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 31 | 32 | 69 | -------------------------------------------------------------------------------- /02-adding-authentication/pages/login.vue: -------------------------------------------------------------------------------- 1 | 33 | 34 | -------------------------------------------------------------------------------- /02-adding-authentication/pages/register.vue: -------------------------------------------------------------------------------- 1 | 41 | 42 | -------------------------------------------------------------------------------- /02-adding-authentication/plugins/README.md: -------------------------------------------------------------------------------- 1 | # PLUGINS 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains Javascript plugins that you want to run before mounting the root Vue.js application. 6 | 7 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/plugins). 8 | -------------------------------------------------------------------------------- /02-adding-authentication/plugins/amplify.js: -------------------------------------------------------------------------------- 1 | import Amplify from 'aws-amplify' 2 | import awsconfig from '~/aws-exports' 3 | 4 | Amplify.configure(awsconfig) 5 | -------------------------------------------------------------------------------- /02-adding-authentication/plugins/auth.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | 3 | class AuthService { 4 | constructor(store) { 5 | this.$store = store 6 | } 7 | 8 | get isAuthenticated() { 9 | return this.$store.state.auth.isAuthenticated 10 | } 11 | 12 | get user() { 13 | return this.$store.state.auth.user 14 | } 15 | 16 | get email() { 17 | if (!this.user) return 18 | return this.user.attributes.email 19 | } 20 | } 21 | 22 | export default async ({ store }) => { 23 | const authService = new AuthService(store) 24 | Vue.prototype.$auth = authService 25 | Vue.$auth = authService 26 | await store.dispatch('auth/load') 27 | } 28 | -------------------------------------------------------------------------------- /02-adding-authentication/static/README.md: -------------------------------------------------------------------------------- 1 | # STATIC 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your static files. 6 | Each file inside this directory is mapped to `/`. 7 | Thus you'd want to delete this README.md before deploying to production. 8 | 9 | Example: `/static/robots.txt` is mapped as `/robots.txt`. 10 | 11 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#static). 12 | -------------------------------------------------------------------------------- /02-adding-authentication/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adocasts/amplify-nuxt/cb272a3e32d1cb2f2342e580761b9e5952c08bbc/02-adding-authentication/static/favicon.ico -------------------------------------------------------------------------------- /02-adding-authentication/store/README.md: -------------------------------------------------------------------------------- 1 | # STORE 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your Vuex Store files. 6 | Vuex Store option is implemented in the Nuxt.js framework. 7 | 8 | Creating a file in this directory automatically activates the option in the framework. 9 | 10 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/vuex-store). 11 | -------------------------------------------------------------------------------- /02-adding-authentication/store/auth.js: -------------------------------------------------------------------------------- 1 | import { Auth } from 'aws-amplify' 2 | 3 | export const state = () => ({ 4 | isAuthenticated: false, 5 | user: null 6 | }) 7 | 8 | export const mutations = { 9 | set(state, user) { 10 | state.isAuthenticated = !!user 11 | state.user = user 12 | } 13 | } 14 | 15 | export const actions = { 16 | async load({ commit }) { 17 | try { 18 | const user = await Auth.currentAuthenticatedUser() 19 | commit('set', user) 20 | return user 21 | } catch (error) { 22 | commit('set', null) 23 | } 24 | }, 25 | 26 | async register(_, { email, password }) { 27 | const user = await Auth.signUp({ 28 | username: email, 29 | password 30 | }) 31 | return user 32 | }, 33 | 34 | async confirmRegistration(_, { email, code }) { 35 | return await Auth.confirmSignUp(email, code) 36 | }, 37 | 38 | async login({ commit }, { email, password }) { 39 | const user = await Auth.signIn(email, password) 40 | commit('set', user) 41 | return user 42 | }, 43 | 44 | async logout({ commit }) { 45 | await Auth.signOut() 46 | commit('set', null) 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /02-adding-authentication/store/index.js: -------------------------------------------------------------------------------- 1 | export const actions = { 2 | nuxtServerInit() {} 3 | } 4 | -------------------------------------------------------------------------------- /02-adding-authentication/tailwind.config.js: -------------------------------------------------------------------------------- 1 | /* 2 | ** TailwindCSS Configuration File 3 | ** 4 | ** Docs: https://tailwindcss.com/docs/configuration 5 | ** Default: https://github.com/tailwindcss/tailwindcss/blob/master/stubs/defaultConfig.stub.js 6 | */ 7 | module.exports = { 8 | theme: {}, 9 | variants: {}, 10 | plugins: [] 11 | } 12 | -------------------------------------------------------------------------------- /03-adding-graphql-api/.editorconfig: -------------------------------------------------------------------------------- 1 | # editorconfig.org 2 | root = true 3 | 4 | [*] 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | charset = utf-8 9 | trim_trailing_whitespace = true 10 | insert_final_newline = true 11 | 12 | [*.md] 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /03-adding-graphql-api/.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### Node template 3 | # Logs 4 | /logs 5 | *.log 6 | npm-debug.log* 7 | yarn-debug.log* 8 | yarn-error.log* 9 | 10 | # Runtime data 11 | pids 12 | *.pid 13 | *.seed 14 | *.pid.lock 15 | 16 | # Directory for instrumented libs generated by jscoverage/JSCover 17 | lib-cov 18 | 19 | # Coverage directory used by tools like istanbul 20 | coverage 21 | 22 | # nyc test coverage 23 | .nyc_output 24 | 25 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 26 | .grunt 27 | 28 | # Bower dependency directory (https://bower.io/) 29 | bower_components 30 | 31 | # node-waf configuration 32 | .lock-wscript 33 | 34 | # Compiled binary addons (https://nodejs.org/api/addons.html) 35 | build/Release 36 | 37 | # Dependency directories 38 | node_modules/ 39 | jspm_packages/ 40 | 41 | # TypeScript v1 declaration files 42 | typings/ 43 | 44 | # Optional npm cache directory 45 | .npm 46 | 47 | # Optional eslint cache 48 | .eslintcache 49 | 50 | # Optional REPL history 51 | .node_repl_history 52 | 53 | # Output of 'npm pack' 54 | *.tgz 55 | 56 | # Yarn Integrity file 57 | .yarn-integrity 58 | 59 | # dotenv environment variables file 60 | .env 61 | 62 | # parcel-bundler cache (https://parceljs.org/) 63 | .cache 64 | 65 | # next.js build output 66 | .next 67 | 68 | # nuxt.js build output 69 | .nuxt 70 | 71 | # Nuxt generate 72 | dist 73 | 74 | # vuepress build output 75 | .vuepress/dist 76 | 77 | # Serverless directories 78 | .serverless 79 | 80 | # IDE / Editor 81 | .idea 82 | 83 | # Service worker 84 | sw.* 85 | 86 | # Mac OSX 87 | .DS_Store 88 | 89 | # Vim swap files 90 | *.swp 91 | 92 | #amplify 93 | amplify/\#current-cloud-backend 94 | amplify/.config/local-* 95 | amplify/mock-data 96 | amplify/backend/amplify-meta.json 97 | amplify/backend/awscloudformation 98 | build/ 99 | dist/ 100 | node_modules/ 101 | aws-exports.js 102 | awsconfiguration.json 103 | amplifyconfiguration.json 104 | amplify-gradle-config.json 105 | amplifyxc.config -------------------------------------------------------------------------------- /03-adding-graphql-api/.graphqlconfig.yml: -------------------------------------------------------------------------------- 1 | projects: 2 | amplifynuxt: 3 | schemaPath: src/graphql/schema.json 4 | includes: 5 | - src/graphql/**/*.js 6 | excludes: 7 | - ./amplify/** 8 | extensions: 9 | amplify: 10 | codeGenTarget: javascript 11 | generatedFileName: '' 12 | docsFilePath: src/graphql 13 | -------------------------------------------------------------------------------- /03-adding-graphql-api/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "semi": false, 3 | "singleQuote": true 4 | } 5 | -------------------------------------------------------------------------------- /03-adding-graphql-api/README.md: -------------------------------------------------------------------------------- 1 | # amplify-nuxt 2 | 3 | > My awe-inspiring Nuxt.js project 4 | 5 | ## Build Setup 6 | 7 | ``` bash 8 | # install dependencies 9 | $ npm run install 10 | 11 | # serve with hot reload at localhost:3000 12 | $ npm run dev 13 | 14 | # build for production and launch server 15 | $ npm run build 16 | $ npm run start 17 | 18 | # generate static project 19 | $ npm run generate 20 | ``` 21 | 22 | For detailed explanation on how things work, check out [Nuxt.js docs](https://nuxtjs.org). 23 | -------------------------------------------------------------------------------- /03-adding-graphql-api/assets/README.md: -------------------------------------------------------------------------------- 1 | # ASSETS 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your un-compiled assets such as LESS, SASS, or JavaScript. 6 | 7 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#webpacked). 8 | -------------------------------------------------------------------------------- /03-adding-graphql-api/assets/css/tailwind.css: -------------------------------------------------------------------------------- 1 | @import 'tailwindcss/base'; 2 | @import 'tailwindcss/components'; 3 | @import 'tailwindcss/utilities'; 4 | -------------------------------------------------------------------------------- /03-adding-graphql-api/components/Logo.vue: -------------------------------------------------------------------------------- 1 | 20 | 34 | -------------------------------------------------------------------------------- /03-adding-graphql-api/components/README.md: -------------------------------------------------------------------------------- 1 | # COMPONENTS 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | The components directory contains your Vue.js Components. 6 | 7 | _Nuxt.js doesn't supercharge these components._ 8 | -------------------------------------------------------------------------------- /03-adding-graphql-api/jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": ".", 4 | "paths": { 5 | "~/*": ["./*"], 6 | "@/*": ["./*"], 7 | "~~/*": ["./*"], 8 | "@@/*": ["./*"] 9 | } 10 | }, 11 | "exclude": ["node_modules", ".nuxt", "dist"] 12 | } 13 | -------------------------------------------------------------------------------- /03-adding-graphql-api/layouts/README.md: -------------------------------------------------------------------------------- 1 | # LAYOUTS 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your Application Layouts. 6 | 7 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/views#layouts). 8 | -------------------------------------------------------------------------------- /03-adding-graphql-api/layouts/default.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 61 | -------------------------------------------------------------------------------- /03-adding-graphql-api/middleware/README.md: -------------------------------------------------------------------------------- 1 | # MIDDLEWARE 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your application middleware. 6 | Middleware let you define custom functions that can be run before rendering either a page or a group of pages. 7 | 8 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/routing#middleware). 9 | -------------------------------------------------------------------------------- /03-adding-graphql-api/nuxt.config.js: -------------------------------------------------------------------------------- 1 | export default { 2 | mode: 'spa', 3 | /* 4 | ** Headers of the page 5 | */ 6 | head: { 7 | title: process.env.npm_package_name || '', 8 | meta: [ 9 | { charset: 'utf-8' }, 10 | { name: 'viewport', content: 'width=device-width, initial-scale=1' }, 11 | { 12 | hid: 'description', 13 | name: 'description', 14 | content: process.env.npm_package_description || '' 15 | } 16 | ], 17 | link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }] 18 | }, 19 | /* 20 | ** Customize the progress-bar color 21 | */ 22 | loading: { color: '#fff' }, 23 | /* 24 | ** Global CSS 25 | */ 26 | css: [], 27 | /* 28 | ** Plugins to load before mounting the App 29 | */ 30 | plugins: [{ src: '~/plugins/amplify.js', mode: 'client' }, '~/plugins/auth'], 31 | /* 32 | ** Nuxt.js dev-modules 33 | */ 34 | buildModules: [ 35 | // Doc: https://github.com/nuxt-community/nuxt-tailwindcss 36 | '@nuxtjs/tailwindcss' 37 | ], 38 | /* 39 | ** Nuxt.js modules 40 | */ 41 | modules: [ 42 | // Doc: https://axios.nuxtjs.org/usage 43 | '@nuxtjs/axios' 44 | ], 45 | /* 46 | ** Axios module configuration 47 | ** See https://axios.nuxtjs.org/options 48 | */ 49 | axios: {}, 50 | /* 51 | ** Build configuration 52 | */ 53 | build: { 54 | /* 55 | ** You can extend webpack config here 56 | */ 57 | extend(config, ctx) {} 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /03-adding-graphql-api/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "amplify-nuxt", 3 | "version": "1.0.0", 4 | "description": "My awe-inspiring Nuxt.js project", 5 | "author": "tomgobich", 6 | "private": true, 7 | "scripts": { 8 | "dev": "nuxt", 9 | "build": "nuxt build", 10 | "start": "nuxt start", 11 | "generate": "nuxt generate" 12 | }, 13 | "dependencies": { 14 | "@nuxtjs/axios": "^5.3.6", 15 | "aws-amplify": "^2.2.2", 16 | "aws-amplify-vue": "^1.1.2", 17 | "nuxt": "^2.0.0" 18 | }, 19 | "devDependencies": { 20 | "@nuxtjs/tailwindcss": "^1.0.0", 21 | "eslint-config-prettier": "^4.1.0", 22 | "eslint-plugin-prettier": "^3.0.1", 23 | "prettier": "^1.16.4" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /03-adding-graphql-api/pages/README.md: -------------------------------------------------------------------------------- 1 | # PAGES 2 | 3 | This directory contains your Application Views and Routes. 4 | The framework reads all the `*.vue` files inside this directory and creates the router of your application. 5 | 6 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/routing). 7 | -------------------------------------------------------------------------------- /03-adding-graphql-api/pages/index.vue: -------------------------------------------------------------------------------- 1 | 33 | 34 | 56 | 57 | 94 | -------------------------------------------------------------------------------- /03-adding-graphql-api/pages/login.vue: -------------------------------------------------------------------------------- 1 | 33 | 34 | -------------------------------------------------------------------------------- /03-adding-graphql-api/pages/posts/_id/edit.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | -------------------------------------------------------------------------------- /03-adding-graphql-api/pages/posts/_id/index.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | -------------------------------------------------------------------------------- /03-adding-graphql-api/pages/posts/create.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | -------------------------------------------------------------------------------- /03-adding-graphql-api/pages/register.vue: -------------------------------------------------------------------------------- 1 | 41 | 42 | -------------------------------------------------------------------------------- /03-adding-graphql-api/plugins/README.md: -------------------------------------------------------------------------------- 1 | # PLUGINS 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains Javascript plugins that you want to run before mounting the root Vue.js application. 6 | 7 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/plugins). 8 | -------------------------------------------------------------------------------- /03-adding-graphql-api/plugins/amplify.js: -------------------------------------------------------------------------------- 1 | import Amplify from 'aws-amplify' 2 | import awsconfig from '~/aws-exports' 3 | 4 | Amplify.configure(awsconfig) 5 | -------------------------------------------------------------------------------- /03-adding-graphql-api/plugins/auth.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | 3 | class AuthService { 4 | constructor(store) { 5 | this.$store = store 6 | } 7 | 8 | get isAuthenticated() { 9 | return this.$store.state.auth.isAuthenticated 10 | } 11 | 12 | get user() { 13 | return this.$store.state.auth.user 14 | } 15 | 16 | get id() { 17 | if (!this.user) return 18 | return this.user.username 19 | } 20 | 21 | get email() { 22 | if (!this.user) return 23 | return this.user.attributes.email 24 | } 25 | } 26 | 27 | export default async ({ store }) => { 28 | const authService = new AuthService(store) 29 | Vue.prototype.$auth = authService 30 | Vue.$auth = authService 31 | await store.dispatch('auth/load') 32 | } 33 | -------------------------------------------------------------------------------- /03-adding-graphql-api/src/graphql/mutations.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | // this is an auto generated file. This will be overwritten 3 | 4 | export const createUser = /* GraphQL */ ` 5 | mutation CreateUser( 6 | $input: CreateUserInput! 7 | $condition: ModelUserConditionInput 8 | ) { 9 | createUser(input: $input, condition: $condition) { 10 | id 11 | email 12 | name 13 | biography 14 | website 15 | createdAt 16 | posts { 17 | items { 18 | id 19 | title 20 | summary 21 | body 22 | createdAt 23 | authorId 24 | } 25 | nextToken 26 | } 27 | } 28 | } 29 | `; 30 | export const updateUser = /* GraphQL */ ` 31 | mutation UpdateUser( 32 | $input: UpdateUserInput! 33 | $condition: ModelUserConditionInput 34 | ) { 35 | updateUser(input: $input, condition: $condition) { 36 | id 37 | email 38 | name 39 | biography 40 | website 41 | createdAt 42 | posts { 43 | items { 44 | id 45 | title 46 | summary 47 | body 48 | createdAt 49 | authorId 50 | } 51 | nextToken 52 | } 53 | } 54 | } 55 | `; 56 | export const deleteUser = /* GraphQL */ ` 57 | mutation DeleteUser( 58 | $input: DeleteUserInput! 59 | $condition: ModelUserConditionInput 60 | ) { 61 | deleteUser(input: $input, condition: $condition) { 62 | id 63 | email 64 | name 65 | biography 66 | website 67 | createdAt 68 | posts { 69 | items { 70 | id 71 | title 72 | summary 73 | body 74 | createdAt 75 | authorId 76 | } 77 | nextToken 78 | } 79 | } 80 | } 81 | `; 82 | export const createPost = /* GraphQL */ ` 83 | mutation CreatePost( 84 | $input: CreatePostInput! 85 | $condition: ModelPostConditionInput 86 | ) { 87 | createPost(input: $input, condition: $condition) { 88 | id 89 | title 90 | summary 91 | body 92 | createdAt 93 | authorId 94 | author { 95 | id 96 | email 97 | name 98 | biography 99 | website 100 | createdAt 101 | posts { 102 | nextToken 103 | } 104 | } 105 | } 106 | } 107 | `; 108 | export const updatePost = /* GraphQL */ ` 109 | mutation UpdatePost( 110 | $input: UpdatePostInput! 111 | $condition: ModelPostConditionInput 112 | ) { 113 | updatePost(input: $input, condition: $condition) { 114 | id 115 | title 116 | summary 117 | body 118 | createdAt 119 | authorId 120 | author { 121 | id 122 | email 123 | name 124 | biography 125 | website 126 | createdAt 127 | posts { 128 | nextToken 129 | } 130 | } 131 | } 132 | } 133 | `; 134 | export const deletePost = /* GraphQL */ ` 135 | mutation DeletePost( 136 | $input: DeletePostInput! 137 | $condition: ModelPostConditionInput 138 | ) { 139 | deletePost(input: $input, condition: $condition) { 140 | id 141 | title 142 | summary 143 | body 144 | createdAt 145 | authorId 146 | author { 147 | id 148 | email 149 | name 150 | biography 151 | website 152 | createdAt 153 | posts { 154 | nextToken 155 | } 156 | } 157 | } 158 | } 159 | `; 160 | -------------------------------------------------------------------------------- /03-adding-graphql-api/src/graphql/queries.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | // this is an auto generated file. This will be overwritten 3 | 4 | export const listUsers = /* GraphQL */ ` 5 | query ListUsers( 6 | $filter: ModelUserFilterInput 7 | $limit: Int 8 | $nextToken: String 9 | ) { 10 | listUsers(filter: $filter, limit: $limit, nextToken: $nextToken) { 11 | items { 12 | id 13 | email 14 | name 15 | biography 16 | website 17 | createdAt 18 | posts { 19 | nextToken 20 | } 21 | } 22 | nextToken 23 | } 24 | } 25 | `; 26 | export const getUser = /* GraphQL */ ` 27 | query GetUser($id: ID!) { 28 | getUser(id: $id) { 29 | id 30 | email 31 | name 32 | biography 33 | website 34 | createdAt 35 | posts { 36 | items { 37 | id 38 | title 39 | summary 40 | body 41 | createdAt 42 | authorId 43 | } 44 | nextToken 45 | } 46 | } 47 | } 48 | `; 49 | export const getPost = /* GraphQL */ ` 50 | query GetPost($id: ID!) { 51 | getPost(id: $id) { 52 | id 53 | title 54 | summary 55 | body 56 | createdAt 57 | authorId 58 | author { 59 | id 60 | email 61 | name 62 | biography 63 | website 64 | createdAt 65 | posts { 66 | nextToken 67 | } 68 | } 69 | } 70 | } 71 | `; 72 | export const listPosts = /* GraphQL */ ` 73 | query ListPosts( 74 | $filter: ModelPostFilterInput 75 | $limit: Int 76 | $nextToken: String 77 | ) { 78 | listPosts(filter: $filter, limit: $limit, nextToken: $nextToken) { 79 | items { 80 | id 81 | title 82 | summary 83 | body 84 | createdAt 85 | authorId 86 | author { 87 | id 88 | email 89 | name 90 | biography 91 | website 92 | createdAt 93 | } 94 | } 95 | nextToken 96 | } 97 | } 98 | `; 99 | -------------------------------------------------------------------------------- /03-adding-graphql-api/src/graphql/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "data" : { 3 | "__schema" : { 4 | "queryType" : { 5 | "name" : "Query" 6 | }, 7 | "mutationType" : { 8 | "name" : "Mutation" 9 | }, 10 | "subscriptionType" : { 11 | "name" : "Subscription" 12 | }, 13 | "types" : [ { 14 | "kind" : "OBJECT", 15 | "name" : "Query", 16 | "description" : null, 17 | "fields" : [ { 18 | "name" : "listUsers", 19 | "description" : null, 20 | "args" : [ { 21 | "name" : "filter", 22 | "description" : null, 23 | "type" : { 24 | "kind" : "INPUT_OBJECT", 25 | "name" : "ModelUserFilterInput", 26 | "ofType" : null 27 | }, 28 | "defaultValue" : null 29 | }, { 30 | "name" : "limit", 31 | "description" : null, 32 | "type" : { 33 | "kind" : "SCALAR", 34 | "name" : "Int", 35 | "ofType" : null 36 | }, 37 | "defaultValue" : null 38 | }, { 39 | "name" : "nextToken", 40 | "description" : null, 41 | "type" : { 42 | "kind" : "SCALAR", 43 | "name" : "String", 44 | "ofType" : null 45 | }, 46 | "defaultValue" : null 47 | } ], 48 | "type" : { 49 | "kind" : "OBJECT", 50 | "name" : "ModelUserConnection", 51 | "ofType" : null 52 | }, 53 | "isDeprecated" : false, 54 | "deprecationReason" : null 55 | }, { 56 | "name" : "getUser", 57 | "description" : null, 58 | "args" : [ { 59 | "name" : "id", 60 | "description" : null, 61 | "type" : { 62 | "kind" : "NON_NULL", 63 | "name" : null, 64 | "ofType" : { 65 | "kind" : "SCALAR", 66 | "name" : "ID", 67 | "ofType" : null 68 | } 69 | }, 70 | "defaultValue" : null 71 | } ], 72 | "type" : { 73 | "kind" : "OBJECT", 74 | "name" : "User", 75 | "ofType" : null 76 | }, 77 | "isDeprecated" : false, 78 | "deprecationReason" : null 79 | }, { 80 | "name" : "getPost", 81 | "description" : null, 82 | "args" : [ { 83 | "name" : "id", 84 | "description" : null, 85 | "type" : { 86 | "kind" : "NON_NULL", 87 | "name" : null, 88 | "ofType" : { 89 | "kind" : "SCALAR", 90 | "name" : "ID", 91 | "ofType" : null 92 | } 93 | }, 94 | "defaultValue" : null 95 | } ], 96 | "type" : { 97 | "kind" : "OBJECT", 98 | "name" : "Post", 99 | "ofType" : null 100 | }, 101 | "isDeprecated" : false, 102 | "deprecationReason" : null 103 | }, { 104 | "name" : "listPosts", 105 | "description" : null, 106 | "args" : [ { 107 | "name" : "filter", 108 | "description" : null, 109 | "type" : { 110 | "kind" : "INPUT_OBJECT", 111 | "name" : "ModelPostFilterInput", 112 | "ofType" : null 113 | }, 114 | "defaultValue" : null 115 | }, { 116 | "name" : "limit", 117 | "description" : null, 118 | "type" : { 119 | "kind" : "SCALAR", 120 | "name" : "Int", 121 | "ofType" : null 122 | }, 123 | "defaultValue" : null 124 | }, { 125 | "name" : "nextToken", 126 | "description" : null, 127 | "type" : { 128 | "kind" : "SCALAR", 129 | "name" : "String", 130 | "ofType" : null 131 | }, 132 | "defaultValue" : null 133 | } ], 134 | "type" : { 135 | "kind" : "OBJECT", 136 | "name" : "ModelPostConnection", 137 | "ofType" : null 138 | }, 139 | "isDeprecated" : false, 140 | "deprecationReason" : null 141 | } ], 142 | "inputFields" : null, 143 | "interfaces" : [ ], 144 | "enumValues" : null, 145 | "possibleTypes" : null 146 | }, { 147 | "kind" : "OBJECT", 148 | "name" : "ModelUserConnection", 149 | "description" : null, 150 | "fields" : [ { 151 | "name" : "items", 152 | "description" : null, 153 | "args" : [ ], 154 | "type" : { 155 | "kind" : "LIST", 156 | "name" : null, 157 | "ofType" : { 158 | "kind" : "OBJECT", 159 | "name" : "User", 160 | "ofType" : null 161 | } 162 | }, 163 | "isDeprecated" : false, 164 | "deprecationReason" : null 165 | }, { 166 | "name" : "nextToken", 167 | "description" : null, 168 | "args" : [ ], 169 | "type" : { 170 | "kind" : "SCALAR", 171 | "name" : "String", 172 | "ofType" : null 173 | }, 174 | "isDeprecated" : false, 175 | "deprecationReason" : null 176 | } ], 177 | "inputFields" : null, 178 | "interfaces" : [ ], 179 | "enumValues" : null, 180 | "possibleTypes" : null 181 | }, { 182 | "kind" : "OBJECT", 183 | "name" : "User", 184 | "description" : null, 185 | "fields" : [ { 186 | "name" : "id", 187 | "description" : null, 188 | "args" : [ ], 189 | "type" : { 190 | "kind" : "NON_NULL", 191 | "name" : null, 192 | "ofType" : { 193 | "kind" : "SCALAR", 194 | "name" : "ID", 195 | "ofType" : null 196 | } 197 | }, 198 | "isDeprecated" : false, 199 | "deprecationReason" : null 200 | }, { 201 | "name" : "email", 202 | "description" : null, 203 | "args" : [ ], 204 | "type" : { 205 | "kind" : "NON_NULL", 206 | "name" : null, 207 | "ofType" : { 208 | "kind" : "SCALAR", 209 | "name" : "String", 210 | "ofType" : null 211 | } 212 | }, 213 | "isDeprecated" : false, 214 | "deprecationReason" : null 215 | }, { 216 | "name" : "name", 217 | "description" : null, 218 | "args" : [ ], 219 | "type" : { 220 | "kind" : "SCALAR", 221 | "name" : "String", 222 | "ofType" : null 223 | }, 224 | "isDeprecated" : false, 225 | "deprecationReason" : null 226 | }, { 227 | "name" : "biography", 228 | "description" : null, 229 | "args" : [ ], 230 | "type" : { 231 | "kind" : "SCALAR", 232 | "name" : "String", 233 | "ofType" : null 234 | }, 235 | "isDeprecated" : false, 236 | "deprecationReason" : null 237 | }, { 238 | "name" : "website", 239 | "description" : null, 240 | "args" : [ ], 241 | "type" : { 242 | "kind" : "SCALAR", 243 | "name" : "String", 244 | "ofType" : null 245 | }, 246 | "isDeprecated" : false, 247 | "deprecationReason" : null 248 | }, { 249 | "name" : "createdAt", 250 | "description" : null, 251 | "args" : [ ], 252 | "type" : { 253 | "kind" : "NON_NULL", 254 | "name" : null, 255 | "ofType" : { 256 | "kind" : "SCALAR", 257 | "name" : "String", 258 | "ofType" : null 259 | } 260 | }, 261 | "isDeprecated" : false, 262 | "deprecationReason" : null 263 | }, { 264 | "name" : "posts", 265 | "description" : null, 266 | "args" : [ { 267 | "name" : "filter", 268 | "description" : null, 269 | "type" : { 270 | "kind" : "INPUT_OBJECT", 271 | "name" : "ModelPostFilterInput", 272 | "ofType" : null 273 | }, 274 | "defaultValue" : null 275 | }, { 276 | "name" : "sortDirection", 277 | "description" : null, 278 | "type" : { 279 | "kind" : "ENUM", 280 | "name" : "ModelSortDirection", 281 | "ofType" : null 282 | }, 283 | "defaultValue" : null 284 | }, { 285 | "name" : "limit", 286 | "description" : null, 287 | "type" : { 288 | "kind" : "SCALAR", 289 | "name" : "Int", 290 | "ofType" : null 291 | }, 292 | "defaultValue" : null 293 | }, { 294 | "name" : "nextToken", 295 | "description" : null, 296 | "type" : { 297 | "kind" : "SCALAR", 298 | "name" : "String", 299 | "ofType" : null 300 | }, 301 | "defaultValue" : null 302 | } ], 303 | "type" : { 304 | "kind" : "OBJECT", 305 | "name" : "ModelPostConnection", 306 | "ofType" : null 307 | }, 308 | "isDeprecated" : false, 309 | "deprecationReason" : null 310 | } ], 311 | "inputFields" : null, 312 | "interfaces" : [ ], 313 | "enumValues" : null, 314 | "possibleTypes" : null 315 | }, { 316 | "kind" : "SCALAR", 317 | "name" : "ID", 318 | "description" : "Built-in ID", 319 | "fields" : null, 320 | "inputFields" : null, 321 | "interfaces" : null, 322 | "enumValues" : null, 323 | "possibleTypes" : null 324 | }, { 325 | "kind" : "SCALAR", 326 | "name" : "String", 327 | "description" : "Built-in String", 328 | "fields" : null, 329 | "inputFields" : null, 330 | "interfaces" : null, 331 | "enumValues" : null, 332 | "possibleTypes" : null 333 | }, { 334 | "kind" : "OBJECT", 335 | "name" : "ModelPostConnection", 336 | "description" : null, 337 | "fields" : [ { 338 | "name" : "items", 339 | "description" : null, 340 | "args" : [ ], 341 | "type" : { 342 | "kind" : "LIST", 343 | "name" : null, 344 | "ofType" : { 345 | "kind" : "OBJECT", 346 | "name" : "Post", 347 | "ofType" : null 348 | } 349 | }, 350 | "isDeprecated" : false, 351 | "deprecationReason" : null 352 | }, { 353 | "name" : "nextToken", 354 | "description" : null, 355 | "args" : [ ], 356 | "type" : { 357 | "kind" : "SCALAR", 358 | "name" : "String", 359 | "ofType" : null 360 | }, 361 | "isDeprecated" : false, 362 | "deprecationReason" : null 363 | } ], 364 | "inputFields" : null, 365 | "interfaces" : [ ], 366 | "enumValues" : null, 367 | "possibleTypes" : null 368 | }, { 369 | "kind" : "OBJECT", 370 | "name" : "Post", 371 | "description" : null, 372 | "fields" : [ { 373 | "name" : "id", 374 | "description" : null, 375 | "args" : [ ], 376 | "type" : { 377 | "kind" : "NON_NULL", 378 | "name" : null, 379 | "ofType" : { 380 | "kind" : "SCALAR", 381 | "name" : "ID", 382 | "ofType" : null 383 | } 384 | }, 385 | "isDeprecated" : false, 386 | "deprecationReason" : null 387 | }, { 388 | "name" : "title", 389 | "description" : null, 390 | "args" : [ ], 391 | "type" : { 392 | "kind" : "NON_NULL", 393 | "name" : null, 394 | "ofType" : { 395 | "kind" : "SCALAR", 396 | "name" : "String", 397 | "ofType" : null 398 | } 399 | }, 400 | "isDeprecated" : false, 401 | "deprecationReason" : null 402 | }, { 403 | "name" : "summary", 404 | "description" : null, 405 | "args" : [ ], 406 | "type" : { 407 | "kind" : "NON_NULL", 408 | "name" : null, 409 | "ofType" : { 410 | "kind" : "SCALAR", 411 | "name" : "String", 412 | "ofType" : null 413 | } 414 | }, 415 | "isDeprecated" : false, 416 | "deprecationReason" : null 417 | }, { 418 | "name" : "body", 419 | "description" : null, 420 | "args" : [ ], 421 | "type" : { 422 | "kind" : "NON_NULL", 423 | "name" : null, 424 | "ofType" : { 425 | "kind" : "SCALAR", 426 | "name" : "String", 427 | "ofType" : null 428 | } 429 | }, 430 | "isDeprecated" : false, 431 | "deprecationReason" : null 432 | }, { 433 | "name" : "createdAt", 434 | "description" : null, 435 | "args" : [ ], 436 | "type" : { 437 | "kind" : "NON_NULL", 438 | "name" : null, 439 | "ofType" : { 440 | "kind" : "SCALAR", 441 | "name" : "String", 442 | "ofType" : null 443 | } 444 | }, 445 | "isDeprecated" : false, 446 | "deprecationReason" : null 447 | }, { 448 | "name" : "authorId", 449 | "description" : null, 450 | "args" : [ ], 451 | "type" : { 452 | "kind" : "NON_NULL", 453 | "name" : null, 454 | "ofType" : { 455 | "kind" : "SCALAR", 456 | "name" : "String", 457 | "ofType" : null 458 | } 459 | }, 460 | "isDeprecated" : false, 461 | "deprecationReason" : null 462 | }, { 463 | "name" : "author", 464 | "description" : null, 465 | "args" : [ ], 466 | "type" : { 467 | "kind" : "NON_NULL", 468 | "name" : null, 469 | "ofType" : { 470 | "kind" : "OBJECT", 471 | "name" : "User", 472 | "ofType" : null 473 | } 474 | }, 475 | "isDeprecated" : false, 476 | "deprecationReason" : null 477 | } ], 478 | "inputFields" : null, 479 | "interfaces" : [ ], 480 | "enumValues" : null, 481 | "possibleTypes" : null 482 | }, { 483 | "kind" : "INPUT_OBJECT", 484 | "name" : "ModelPostFilterInput", 485 | "description" : null, 486 | "fields" : null, 487 | "inputFields" : [ { 488 | "name" : "id", 489 | "description" : null, 490 | "type" : { 491 | "kind" : "INPUT_OBJECT", 492 | "name" : "ModelIDInput", 493 | "ofType" : null 494 | }, 495 | "defaultValue" : null 496 | }, { 497 | "name" : "title", 498 | "description" : null, 499 | "type" : { 500 | "kind" : "INPUT_OBJECT", 501 | "name" : "ModelStringInput", 502 | "ofType" : null 503 | }, 504 | "defaultValue" : null 505 | }, { 506 | "name" : "summary", 507 | "description" : null, 508 | "type" : { 509 | "kind" : "INPUT_OBJECT", 510 | "name" : "ModelStringInput", 511 | "ofType" : null 512 | }, 513 | "defaultValue" : null 514 | }, { 515 | "name" : "body", 516 | "description" : null, 517 | "type" : { 518 | "kind" : "INPUT_OBJECT", 519 | "name" : "ModelStringInput", 520 | "ofType" : null 521 | }, 522 | "defaultValue" : null 523 | }, { 524 | "name" : "createdAt", 525 | "description" : null, 526 | "type" : { 527 | "kind" : "INPUT_OBJECT", 528 | "name" : "ModelStringInput", 529 | "ofType" : null 530 | }, 531 | "defaultValue" : null 532 | }, { 533 | "name" : "authorId", 534 | "description" : null, 535 | "type" : { 536 | "kind" : "INPUT_OBJECT", 537 | "name" : "ModelStringInput", 538 | "ofType" : null 539 | }, 540 | "defaultValue" : null 541 | }, { 542 | "name" : "and", 543 | "description" : null, 544 | "type" : { 545 | "kind" : "LIST", 546 | "name" : null, 547 | "ofType" : { 548 | "kind" : "INPUT_OBJECT", 549 | "name" : "ModelPostFilterInput", 550 | "ofType" : null 551 | } 552 | }, 553 | "defaultValue" : null 554 | }, { 555 | "name" : "or", 556 | "description" : null, 557 | "type" : { 558 | "kind" : "LIST", 559 | "name" : null, 560 | "ofType" : { 561 | "kind" : "INPUT_OBJECT", 562 | "name" : "ModelPostFilterInput", 563 | "ofType" : null 564 | } 565 | }, 566 | "defaultValue" : null 567 | }, { 568 | "name" : "not", 569 | "description" : null, 570 | "type" : { 571 | "kind" : "INPUT_OBJECT", 572 | "name" : "ModelPostFilterInput", 573 | "ofType" : null 574 | }, 575 | "defaultValue" : null 576 | } ], 577 | "interfaces" : null, 578 | "enumValues" : null, 579 | "possibleTypes" : null 580 | }, { 581 | "kind" : "INPUT_OBJECT", 582 | "name" : "ModelIDInput", 583 | "description" : null, 584 | "fields" : null, 585 | "inputFields" : [ { 586 | "name" : "ne", 587 | "description" : null, 588 | "type" : { 589 | "kind" : "SCALAR", 590 | "name" : "ID", 591 | "ofType" : null 592 | }, 593 | "defaultValue" : null 594 | }, { 595 | "name" : "eq", 596 | "description" : null, 597 | "type" : { 598 | "kind" : "SCALAR", 599 | "name" : "ID", 600 | "ofType" : null 601 | }, 602 | "defaultValue" : null 603 | }, { 604 | "name" : "le", 605 | "description" : null, 606 | "type" : { 607 | "kind" : "SCALAR", 608 | "name" : "ID", 609 | "ofType" : null 610 | }, 611 | "defaultValue" : null 612 | }, { 613 | "name" : "lt", 614 | "description" : null, 615 | "type" : { 616 | "kind" : "SCALAR", 617 | "name" : "ID", 618 | "ofType" : null 619 | }, 620 | "defaultValue" : null 621 | }, { 622 | "name" : "ge", 623 | "description" : null, 624 | "type" : { 625 | "kind" : "SCALAR", 626 | "name" : "ID", 627 | "ofType" : null 628 | }, 629 | "defaultValue" : null 630 | }, { 631 | "name" : "gt", 632 | "description" : null, 633 | "type" : { 634 | "kind" : "SCALAR", 635 | "name" : "ID", 636 | "ofType" : null 637 | }, 638 | "defaultValue" : null 639 | }, { 640 | "name" : "contains", 641 | "description" : null, 642 | "type" : { 643 | "kind" : "SCALAR", 644 | "name" : "ID", 645 | "ofType" : null 646 | }, 647 | "defaultValue" : null 648 | }, { 649 | "name" : "notContains", 650 | "description" : null, 651 | "type" : { 652 | "kind" : "SCALAR", 653 | "name" : "ID", 654 | "ofType" : null 655 | }, 656 | "defaultValue" : null 657 | }, { 658 | "name" : "between", 659 | "description" : null, 660 | "type" : { 661 | "kind" : "LIST", 662 | "name" : null, 663 | "ofType" : { 664 | "kind" : "SCALAR", 665 | "name" : "ID", 666 | "ofType" : null 667 | } 668 | }, 669 | "defaultValue" : null 670 | }, { 671 | "name" : "beginsWith", 672 | "description" : null, 673 | "type" : { 674 | "kind" : "SCALAR", 675 | "name" : "ID", 676 | "ofType" : null 677 | }, 678 | "defaultValue" : null 679 | }, { 680 | "name" : "attributeExists", 681 | "description" : null, 682 | "type" : { 683 | "kind" : "SCALAR", 684 | "name" : "Boolean", 685 | "ofType" : null 686 | }, 687 | "defaultValue" : null 688 | }, { 689 | "name" : "attributeType", 690 | "description" : null, 691 | "type" : { 692 | "kind" : "ENUM", 693 | "name" : "ModelAttributeTypes", 694 | "ofType" : null 695 | }, 696 | "defaultValue" : null 697 | }, { 698 | "name" : "size", 699 | "description" : null, 700 | "type" : { 701 | "kind" : "INPUT_OBJECT", 702 | "name" : "ModelSizeInput", 703 | "ofType" : null 704 | }, 705 | "defaultValue" : null 706 | } ], 707 | "interfaces" : null, 708 | "enumValues" : null, 709 | "possibleTypes" : null 710 | }, { 711 | "kind" : "SCALAR", 712 | "name" : "Boolean", 713 | "description" : "Built-in Boolean", 714 | "fields" : null, 715 | "inputFields" : null, 716 | "interfaces" : null, 717 | "enumValues" : null, 718 | "possibleTypes" : null 719 | }, { 720 | "kind" : "ENUM", 721 | "name" : "ModelAttributeTypes", 722 | "description" : null, 723 | "fields" : null, 724 | "inputFields" : null, 725 | "interfaces" : null, 726 | "enumValues" : [ { 727 | "name" : "binary", 728 | "description" : null, 729 | "isDeprecated" : false, 730 | "deprecationReason" : null 731 | }, { 732 | "name" : "binarySet", 733 | "description" : null, 734 | "isDeprecated" : false, 735 | "deprecationReason" : null 736 | }, { 737 | "name" : "bool", 738 | "description" : null, 739 | "isDeprecated" : false, 740 | "deprecationReason" : null 741 | }, { 742 | "name" : "list", 743 | "description" : null, 744 | "isDeprecated" : false, 745 | "deprecationReason" : null 746 | }, { 747 | "name" : "map", 748 | "description" : null, 749 | "isDeprecated" : false, 750 | "deprecationReason" : null 751 | }, { 752 | "name" : "number", 753 | "description" : null, 754 | "isDeprecated" : false, 755 | "deprecationReason" : null 756 | }, { 757 | "name" : "numberSet", 758 | "description" : null, 759 | "isDeprecated" : false, 760 | "deprecationReason" : null 761 | }, { 762 | "name" : "string", 763 | "description" : null, 764 | "isDeprecated" : false, 765 | "deprecationReason" : null 766 | }, { 767 | "name" : "stringSet", 768 | "description" : null, 769 | "isDeprecated" : false, 770 | "deprecationReason" : null 771 | }, { 772 | "name" : "_null", 773 | "description" : null, 774 | "isDeprecated" : false, 775 | "deprecationReason" : null 776 | } ], 777 | "possibleTypes" : null 778 | }, { 779 | "kind" : "INPUT_OBJECT", 780 | "name" : "ModelSizeInput", 781 | "description" : null, 782 | "fields" : null, 783 | "inputFields" : [ { 784 | "name" : "ne", 785 | "description" : null, 786 | "type" : { 787 | "kind" : "SCALAR", 788 | "name" : "Int", 789 | "ofType" : null 790 | }, 791 | "defaultValue" : null 792 | }, { 793 | "name" : "eq", 794 | "description" : null, 795 | "type" : { 796 | "kind" : "SCALAR", 797 | "name" : "Int", 798 | "ofType" : null 799 | }, 800 | "defaultValue" : null 801 | }, { 802 | "name" : "le", 803 | "description" : null, 804 | "type" : { 805 | "kind" : "SCALAR", 806 | "name" : "Int", 807 | "ofType" : null 808 | }, 809 | "defaultValue" : null 810 | }, { 811 | "name" : "lt", 812 | "description" : null, 813 | "type" : { 814 | "kind" : "SCALAR", 815 | "name" : "Int", 816 | "ofType" : null 817 | }, 818 | "defaultValue" : null 819 | }, { 820 | "name" : "ge", 821 | "description" : null, 822 | "type" : { 823 | "kind" : "SCALAR", 824 | "name" : "Int", 825 | "ofType" : null 826 | }, 827 | "defaultValue" : null 828 | }, { 829 | "name" : "gt", 830 | "description" : null, 831 | "type" : { 832 | "kind" : "SCALAR", 833 | "name" : "Int", 834 | "ofType" : null 835 | }, 836 | "defaultValue" : null 837 | }, { 838 | "name" : "between", 839 | "description" : null, 840 | "type" : { 841 | "kind" : "LIST", 842 | "name" : null, 843 | "ofType" : { 844 | "kind" : "SCALAR", 845 | "name" : "Int", 846 | "ofType" : null 847 | } 848 | }, 849 | "defaultValue" : null 850 | } ], 851 | "interfaces" : null, 852 | "enumValues" : null, 853 | "possibleTypes" : null 854 | }, { 855 | "kind" : "SCALAR", 856 | "name" : "Int", 857 | "description" : "Built-in Int", 858 | "fields" : null, 859 | "inputFields" : null, 860 | "interfaces" : null, 861 | "enumValues" : null, 862 | "possibleTypes" : null 863 | }, { 864 | "kind" : "INPUT_OBJECT", 865 | "name" : "ModelStringInput", 866 | "description" : null, 867 | "fields" : null, 868 | "inputFields" : [ { 869 | "name" : "ne", 870 | "description" : null, 871 | "type" : { 872 | "kind" : "SCALAR", 873 | "name" : "String", 874 | "ofType" : null 875 | }, 876 | "defaultValue" : null 877 | }, { 878 | "name" : "eq", 879 | "description" : null, 880 | "type" : { 881 | "kind" : "SCALAR", 882 | "name" : "String", 883 | "ofType" : null 884 | }, 885 | "defaultValue" : null 886 | }, { 887 | "name" : "le", 888 | "description" : null, 889 | "type" : { 890 | "kind" : "SCALAR", 891 | "name" : "String", 892 | "ofType" : null 893 | }, 894 | "defaultValue" : null 895 | }, { 896 | "name" : "lt", 897 | "description" : null, 898 | "type" : { 899 | "kind" : "SCALAR", 900 | "name" : "String", 901 | "ofType" : null 902 | }, 903 | "defaultValue" : null 904 | }, { 905 | "name" : "ge", 906 | "description" : null, 907 | "type" : { 908 | "kind" : "SCALAR", 909 | "name" : "String", 910 | "ofType" : null 911 | }, 912 | "defaultValue" : null 913 | }, { 914 | "name" : "gt", 915 | "description" : null, 916 | "type" : { 917 | "kind" : "SCALAR", 918 | "name" : "String", 919 | "ofType" : null 920 | }, 921 | "defaultValue" : null 922 | }, { 923 | "name" : "contains", 924 | "description" : null, 925 | "type" : { 926 | "kind" : "SCALAR", 927 | "name" : "String", 928 | "ofType" : null 929 | }, 930 | "defaultValue" : null 931 | }, { 932 | "name" : "notContains", 933 | "description" : null, 934 | "type" : { 935 | "kind" : "SCALAR", 936 | "name" : "String", 937 | "ofType" : null 938 | }, 939 | "defaultValue" : null 940 | }, { 941 | "name" : "between", 942 | "description" : null, 943 | "type" : { 944 | "kind" : "LIST", 945 | "name" : null, 946 | "ofType" : { 947 | "kind" : "SCALAR", 948 | "name" : "String", 949 | "ofType" : null 950 | } 951 | }, 952 | "defaultValue" : null 953 | }, { 954 | "name" : "beginsWith", 955 | "description" : null, 956 | "type" : { 957 | "kind" : "SCALAR", 958 | "name" : "String", 959 | "ofType" : null 960 | }, 961 | "defaultValue" : null 962 | }, { 963 | "name" : "attributeExists", 964 | "description" : null, 965 | "type" : { 966 | "kind" : "SCALAR", 967 | "name" : "Boolean", 968 | "ofType" : null 969 | }, 970 | "defaultValue" : null 971 | }, { 972 | "name" : "attributeType", 973 | "description" : null, 974 | "type" : { 975 | "kind" : "ENUM", 976 | "name" : "ModelAttributeTypes", 977 | "ofType" : null 978 | }, 979 | "defaultValue" : null 980 | }, { 981 | "name" : "size", 982 | "description" : null, 983 | "type" : { 984 | "kind" : "INPUT_OBJECT", 985 | "name" : "ModelSizeInput", 986 | "ofType" : null 987 | }, 988 | "defaultValue" : null 989 | } ], 990 | "interfaces" : null, 991 | "enumValues" : null, 992 | "possibleTypes" : null 993 | }, { 994 | "kind" : "ENUM", 995 | "name" : "ModelSortDirection", 996 | "description" : null, 997 | "fields" : null, 998 | "inputFields" : null, 999 | "interfaces" : null, 1000 | "enumValues" : [ { 1001 | "name" : "ASC", 1002 | "description" : null, 1003 | "isDeprecated" : false, 1004 | "deprecationReason" : null 1005 | }, { 1006 | "name" : "DESC", 1007 | "description" : null, 1008 | "isDeprecated" : false, 1009 | "deprecationReason" : null 1010 | } ], 1011 | "possibleTypes" : null 1012 | }, { 1013 | "kind" : "INPUT_OBJECT", 1014 | "name" : "ModelUserFilterInput", 1015 | "description" : null, 1016 | "fields" : null, 1017 | "inputFields" : [ { 1018 | "name" : "id", 1019 | "description" : null, 1020 | "type" : { 1021 | "kind" : "INPUT_OBJECT", 1022 | "name" : "ModelIDInput", 1023 | "ofType" : null 1024 | }, 1025 | "defaultValue" : null 1026 | }, { 1027 | "name" : "email", 1028 | "description" : null, 1029 | "type" : { 1030 | "kind" : "INPUT_OBJECT", 1031 | "name" : "ModelStringInput", 1032 | "ofType" : null 1033 | }, 1034 | "defaultValue" : null 1035 | }, { 1036 | "name" : "name", 1037 | "description" : null, 1038 | "type" : { 1039 | "kind" : "INPUT_OBJECT", 1040 | "name" : "ModelStringInput", 1041 | "ofType" : null 1042 | }, 1043 | "defaultValue" : null 1044 | }, { 1045 | "name" : "biography", 1046 | "description" : null, 1047 | "type" : { 1048 | "kind" : "INPUT_OBJECT", 1049 | "name" : "ModelStringInput", 1050 | "ofType" : null 1051 | }, 1052 | "defaultValue" : null 1053 | }, { 1054 | "name" : "website", 1055 | "description" : null, 1056 | "type" : { 1057 | "kind" : "INPUT_OBJECT", 1058 | "name" : "ModelStringInput", 1059 | "ofType" : null 1060 | }, 1061 | "defaultValue" : null 1062 | }, { 1063 | "name" : "createdAt", 1064 | "description" : null, 1065 | "type" : { 1066 | "kind" : "INPUT_OBJECT", 1067 | "name" : "ModelStringInput", 1068 | "ofType" : null 1069 | }, 1070 | "defaultValue" : null 1071 | }, { 1072 | "name" : "and", 1073 | "description" : null, 1074 | "type" : { 1075 | "kind" : "LIST", 1076 | "name" : null, 1077 | "ofType" : { 1078 | "kind" : "INPUT_OBJECT", 1079 | "name" : "ModelUserFilterInput", 1080 | "ofType" : null 1081 | } 1082 | }, 1083 | "defaultValue" : null 1084 | }, { 1085 | "name" : "or", 1086 | "description" : null, 1087 | "type" : { 1088 | "kind" : "LIST", 1089 | "name" : null, 1090 | "ofType" : { 1091 | "kind" : "INPUT_OBJECT", 1092 | "name" : "ModelUserFilterInput", 1093 | "ofType" : null 1094 | } 1095 | }, 1096 | "defaultValue" : null 1097 | }, { 1098 | "name" : "not", 1099 | "description" : null, 1100 | "type" : { 1101 | "kind" : "INPUT_OBJECT", 1102 | "name" : "ModelUserFilterInput", 1103 | "ofType" : null 1104 | }, 1105 | "defaultValue" : null 1106 | } ], 1107 | "interfaces" : null, 1108 | "enumValues" : null, 1109 | "possibleTypes" : null 1110 | }, { 1111 | "kind" : "OBJECT", 1112 | "name" : "Mutation", 1113 | "description" : null, 1114 | "fields" : [ { 1115 | "name" : "createUser", 1116 | "description" : null, 1117 | "args" : [ { 1118 | "name" : "input", 1119 | "description" : null, 1120 | "type" : { 1121 | "kind" : "NON_NULL", 1122 | "name" : null, 1123 | "ofType" : { 1124 | "kind" : "INPUT_OBJECT", 1125 | "name" : "CreateUserInput", 1126 | "ofType" : null 1127 | } 1128 | }, 1129 | "defaultValue" : null 1130 | }, { 1131 | "name" : "condition", 1132 | "description" : null, 1133 | "type" : { 1134 | "kind" : "INPUT_OBJECT", 1135 | "name" : "ModelUserConditionInput", 1136 | "ofType" : null 1137 | }, 1138 | "defaultValue" : null 1139 | } ], 1140 | "type" : { 1141 | "kind" : "OBJECT", 1142 | "name" : "User", 1143 | "ofType" : null 1144 | }, 1145 | "isDeprecated" : false, 1146 | "deprecationReason" : null 1147 | }, { 1148 | "name" : "updateUser", 1149 | "description" : null, 1150 | "args" : [ { 1151 | "name" : "input", 1152 | "description" : null, 1153 | "type" : { 1154 | "kind" : "NON_NULL", 1155 | "name" : null, 1156 | "ofType" : { 1157 | "kind" : "INPUT_OBJECT", 1158 | "name" : "UpdateUserInput", 1159 | "ofType" : null 1160 | } 1161 | }, 1162 | "defaultValue" : null 1163 | }, { 1164 | "name" : "condition", 1165 | "description" : null, 1166 | "type" : { 1167 | "kind" : "INPUT_OBJECT", 1168 | "name" : "ModelUserConditionInput", 1169 | "ofType" : null 1170 | }, 1171 | "defaultValue" : null 1172 | } ], 1173 | "type" : { 1174 | "kind" : "OBJECT", 1175 | "name" : "User", 1176 | "ofType" : null 1177 | }, 1178 | "isDeprecated" : false, 1179 | "deprecationReason" : null 1180 | }, { 1181 | "name" : "deleteUser", 1182 | "description" : null, 1183 | "args" : [ { 1184 | "name" : "input", 1185 | "description" : null, 1186 | "type" : { 1187 | "kind" : "NON_NULL", 1188 | "name" : null, 1189 | "ofType" : { 1190 | "kind" : "INPUT_OBJECT", 1191 | "name" : "DeleteUserInput", 1192 | "ofType" : null 1193 | } 1194 | }, 1195 | "defaultValue" : null 1196 | }, { 1197 | "name" : "condition", 1198 | "description" : null, 1199 | "type" : { 1200 | "kind" : "INPUT_OBJECT", 1201 | "name" : "ModelUserConditionInput", 1202 | "ofType" : null 1203 | }, 1204 | "defaultValue" : null 1205 | } ], 1206 | "type" : { 1207 | "kind" : "OBJECT", 1208 | "name" : "User", 1209 | "ofType" : null 1210 | }, 1211 | "isDeprecated" : false, 1212 | "deprecationReason" : null 1213 | }, { 1214 | "name" : "createPost", 1215 | "description" : null, 1216 | "args" : [ { 1217 | "name" : "input", 1218 | "description" : null, 1219 | "type" : { 1220 | "kind" : "NON_NULL", 1221 | "name" : null, 1222 | "ofType" : { 1223 | "kind" : "INPUT_OBJECT", 1224 | "name" : "CreatePostInput", 1225 | "ofType" : null 1226 | } 1227 | }, 1228 | "defaultValue" : null 1229 | }, { 1230 | "name" : "condition", 1231 | "description" : null, 1232 | "type" : { 1233 | "kind" : "INPUT_OBJECT", 1234 | "name" : "ModelPostConditionInput", 1235 | "ofType" : null 1236 | }, 1237 | "defaultValue" : null 1238 | } ], 1239 | "type" : { 1240 | "kind" : "OBJECT", 1241 | "name" : "Post", 1242 | "ofType" : null 1243 | }, 1244 | "isDeprecated" : false, 1245 | "deprecationReason" : null 1246 | }, { 1247 | "name" : "updatePost", 1248 | "description" : null, 1249 | "args" : [ { 1250 | "name" : "input", 1251 | "description" : null, 1252 | "type" : { 1253 | "kind" : "NON_NULL", 1254 | "name" : null, 1255 | "ofType" : { 1256 | "kind" : "INPUT_OBJECT", 1257 | "name" : "UpdatePostInput", 1258 | "ofType" : null 1259 | } 1260 | }, 1261 | "defaultValue" : null 1262 | }, { 1263 | "name" : "condition", 1264 | "description" : null, 1265 | "type" : { 1266 | "kind" : "INPUT_OBJECT", 1267 | "name" : "ModelPostConditionInput", 1268 | "ofType" : null 1269 | }, 1270 | "defaultValue" : null 1271 | } ], 1272 | "type" : { 1273 | "kind" : "OBJECT", 1274 | "name" : "Post", 1275 | "ofType" : null 1276 | }, 1277 | "isDeprecated" : false, 1278 | "deprecationReason" : null 1279 | }, { 1280 | "name" : "deletePost", 1281 | "description" : null, 1282 | "args" : [ { 1283 | "name" : "input", 1284 | "description" : null, 1285 | "type" : { 1286 | "kind" : "NON_NULL", 1287 | "name" : null, 1288 | "ofType" : { 1289 | "kind" : "INPUT_OBJECT", 1290 | "name" : "DeletePostInput", 1291 | "ofType" : null 1292 | } 1293 | }, 1294 | "defaultValue" : null 1295 | }, { 1296 | "name" : "condition", 1297 | "description" : null, 1298 | "type" : { 1299 | "kind" : "INPUT_OBJECT", 1300 | "name" : "ModelPostConditionInput", 1301 | "ofType" : null 1302 | }, 1303 | "defaultValue" : null 1304 | } ], 1305 | "type" : { 1306 | "kind" : "OBJECT", 1307 | "name" : "Post", 1308 | "ofType" : null 1309 | }, 1310 | "isDeprecated" : false, 1311 | "deprecationReason" : null 1312 | } ], 1313 | "inputFields" : null, 1314 | "interfaces" : [ ], 1315 | "enumValues" : null, 1316 | "possibleTypes" : null 1317 | }, { 1318 | "kind" : "INPUT_OBJECT", 1319 | "name" : "CreateUserInput", 1320 | "description" : null, 1321 | "fields" : null, 1322 | "inputFields" : [ { 1323 | "name" : "id", 1324 | "description" : null, 1325 | "type" : { 1326 | "kind" : "SCALAR", 1327 | "name" : "ID", 1328 | "ofType" : null 1329 | }, 1330 | "defaultValue" : null 1331 | }, { 1332 | "name" : "email", 1333 | "description" : null, 1334 | "type" : { 1335 | "kind" : "NON_NULL", 1336 | "name" : null, 1337 | "ofType" : { 1338 | "kind" : "SCALAR", 1339 | "name" : "String", 1340 | "ofType" : null 1341 | } 1342 | }, 1343 | "defaultValue" : null 1344 | }, { 1345 | "name" : "name", 1346 | "description" : null, 1347 | "type" : { 1348 | "kind" : "SCALAR", 1349 | "name" : "String", 1350 | "ofType" : null 1351 | }, 1352 | "defaultValue" : null 1353 | }, { 1354 | "name" : "biography", 1355 | "description" : null, 1356 | "type" : { 1357 | "kind" : "SCALAR", 1358 | "name" : "String", 1359 | "ofType" : null 1360 | }, 1361 | "defaultValue" : null 1362 | }, { 1363 | "name" : "website", 1364 | "description" : null, 1365 | "type" : { 1366 | "kind" : "SCALAR", 1367 | "name" : "String", 1368 | "ofType" : null 1369 | }, 1370 | "defaultValue" : null 1371 | }, { 1372 | "name" : "createdAt", 1373 | "description" : null, 1374 | "type" : { 1375 | "kind" : "NON_NULL", 1376 | "name" : null, 1377 | "ofType" : { 1378 | "kind" : "SCALAR", 1379 | "name" : "String", 1380 | "ofType" : null 1381 | } 1382 | }, 1383 | "defaultValue" : null 1384 | } ], 1385 | "interfaces" : null, 1386 | "enumValues" : null, 1387 | "possibleTypes" : null 1388 | }, { 1389 | "kind" : "INPUT_OBJECT", 1390 | "name" : "ModelUserConditionInput", 1391 | "description" : null, 1392 | "fields" : null, 1393 | "inputFields" : [ { 1394 | "name" : "email", 1395 | "description" : null, 1396 | "type" : { 1397 | "kind" : "INPUT_OBJECT", 1398 | "name" : "ModelStringInput", 1399 | "ofType" : null 1400 | }, 1401 | "defaultValue" : null 1402 | }, { 1403 | "name" : "name", 1404 | "description" : null, 1405 | "type" : { 1406 | "kind" : "INPUT_OBJECT", 1407 | "name" : "ModelStringInput", 1408 | "ofType" : null 1409 | }, 1410 | "defaultValue" : null 1411 | }, { 1412 | "name" : "biography", 1413 | "description" : null, 1414 | "type" : { 1415 | "kind" : "INPUT_OBJECT", 1416 | "name" : "ModelStringInput", 1417 | "ofType" : null 1418 | }, 1419 | "defaultValue" : null 1420 | }, { 1421 | "name" : "website", 1422 | "description" : null, 1423 | "type" : { 1424 | "kind" : "INPUT_OBJECT", 1425 | "name" : "ModelStringInput", 1426 | "ofType" : null 1427 | }, 1428 | "defaultValue" : null 1429 | }, { 1430 | "name" : "createdAt", 1431 | "description" : null, 1432 | "type" : { 1433 | "kind" : "INPUT_OBJECT", 1434 | "name" : "ModelStringInput", 1435 | "ofType" : null 1436 | }, 1437 | "defaultValue" : null 1438 | }, { 1439 | "name" : "and", 1440 | "description" : null, 1441 | "type" : { 1442 | "kind" : "LIST", 1443 | "name" : null, 1444 | "ofType" : { 1445 | "kind" : "INPUT_OBJECT", 1446 | "name" : "ModelUserConditionInput", 1447 | "ofType" : null 1448 | } 1449 | }, 1450 | "defaultValue" : null 1451 | }, { 1452 | "name" : "or", 1453 | "description" : null, 1454 | "type" : { 1455 | "kind" : "LIST", 1456 | "name" : null, 1457 | "ofType" : { 1458 | "kind" : "INPUT_OBJECT", 1459 | "name" : "ModelUserConditionInput", 1460 | "ofType" : null 1461 | } 1462 | }, 1463 | "defaultValue" : null 1464 | }, { 1465 | "name" : "not", 1466 | "description" : null, 1467 | "type" : { 1468 | "kind" : "INPUT_OBJECT", 1469 | "name" : "ModelUserConditionInput", 1470 | "ofType" : null 1471 | }, 1472 | "defaultValue" : null 1473 | } ], 1474 | "interfaces" : null, 1475 | "enumValues" : null, 1476 | "possibleTypes" : null 1477 | }, { 1478 | "kind" : "INPUT_OBJECT", 1479 | "name" : "UpdateUserInput", 1480 | "description" : null, 1481 | "fields" : null, 1482 | "inputFields" : [ { 1483 | "name" : "id", 1484 | "description" : null, 1485 | "type" : { 1486 | "kind" : "NON_NULL", 1487 | "name" : null, 1488 | "ofType" : { 1489 | "kind" : "SCALAR", 1490 | "name" : "ID", 1491 | "ofType" : null 1492 | } 1493 | }, 1494 | "defaultValue" : null 1495 | }, { 1496 | "name" : "email", 1497 | "description" : null, 1498 | "type" : { 1499 | "kind" : "SCALAR", 1500 | "name" : "String", 1501 | "ofType" : null 1502 | }, 1503 | "defaultValue" : null 1504 | }, { 1505 | "name" : "name", 1506 | "description" : null, 1507 | "type" : { 1508 | "kind" : "SCALAR", 1509 | "name" : "String", 1510 | "ofType" : null 1511 | }, 1512 | "defaultValue" : null 1513 | }, { 1514 | "name" : "biography", 1515 | "description" : null, 1516 | "type" : { 1517 | "kind" : "SCALAR", 1518 | "name" : "String", 1519 | "ofType" : null 1520 | }, 1521 | "defaultValue" : null 1522 | }, { 1523 | "name" : "website", 1524 | "description" : null, 1525 | "type" : { 1526 | "kind" : "SCALAR", 1527 | "name" : "String", 1528 | "ofType" : null 1529 | }, 1530 | "defaultValue" : null 1531 | }, { 1532 | "name" : "createdAt", 1533 | "description" : null, 1534 | "type" : { 1535 | "kind" : "SCALAR", 1536 | "name" : "String", 1537 | "ofType" : null 1538 | }, 1539 | "defaultValue" : null 1540 | } ], 1541 | "interfaces" : null, 1542 | "enumValues" : null, 1543 | "possibleTypes" : null 1544 | }, { 1545 | "kind" : "INPUT_OBJECT", 1546 | "name" : "DeleteUserInput", 1547 | "description" : null, 1548 | "fields" : null, 1549 | "inputFields" : [ { 1550 | "name" : "id", 1551 | "description" : null, 1552 | "type" : { 1553 | "kind" : "SCALAR", 1554 | "name" : "ID", 1555 | "ofType" : null 1556 | }, 1557 | "defaultValue" : null 1558 | } ], 1559 | "interfaces" : null, 1560 | "enumValues" : null, 1561 | "possibleTypes" : null 1562 | }, { 1563 | "kind" : "INPUT_OBJECT", 1564 | "name" : "CreatePostInput", 1565 | "description" : null, 1566 | "fields" : null, 1567 | "inputFields" : [ { 1568 | "name" : "id", 1569 | "description" : null, 1570 | "type" : { 1571 | "kind" : "SCALAR", 1572 | "name" : "ID", 1573 | "ofType" : null 1574 | }, 1575 | "defaultValue" : null 1576 | }, { 1577 | "name" : "title", 1578 | "description" : null, 1579 | "type" : { 1580 | "kind" : "NON_NULL", 1581 | "name" : null, 1582 | "ofType" : { 1583 | "kind" : "SCALAR", 1584 | "name" : "String", 1585 | "ofType" : null 1586 | } 1587 | }, 1588 | "defaultValue" : null 1589 | }, { 1590 | "name" : "summary", 1591 | "description" : null, 1592 | "type" : { 1593 | "kind" : "NON_NULL", 1594 | "name" : null, 1595 | "ofType" : { 1596 | "kind" : "SCALAR", 1597 | "name" : "String", 1598 | "ofType" : null 1599 | } 1600 | }, 1601 | "defaultValue" : null 1602 | }, { 1603 | "name" : "body", 1604 | "description" : null, 1605 | "type" : { 1606 | "kind" : "NON_NULL", 1607 | "name" : null, 1608 | "ofType" : { 1609 | "kind" : "SCALAR", 1610 | "name" : "String", 1611 | "ofType" : null 1612 | } 1613 | }, 1614 | "defaultValue" : null 1615 | }, { 1616 | "name" : "createdAt", 1617 | "description" : null, 1618 | "type" : { 1619 | "kind" : "NON_NULL", 1620 | "name" : null, 1621 | "ofType" : { 1622 | "kind" : "SCALAR", 1623 | "name" : "String", 1624 | "ofType" : null 1625 | } 1626 | }, 1627 | "defaultValue" : null 1628 | }, { 1629 | "name" : "authorId", 1630 | "description" : null, 1631 | "type" : { 1632 | "kind" : "NON_NULL", 1633 | "name" : null, 1634 | "ofType" : { 1635 | "kind" : "SCALAR", 1636 | "name" : "String", 1637 | "ofType" : null 1638 | } 1639 | }, 1640 | "defaultValue" : null 1641 | } ], 1642 | "interfaces" : null, 1643 | "enumValues" : null, 1644 | "possibleTypes" : null 1645 | }, { 1646 | "kind" : "INPUT_OBJECT", 1647 | "name" : "ModelPostConditionInput", 1648 | "description" : null, 1649 | "fields" : null, 1650 | "inputFields" : [ { 1651 | "name" : "title", 1652 | "description" : null, 1653 | "type" : { 1654 | "kind" : "INPUT_OBJECT", 1655 | "name" : "ModelStringInput", 1656 | "ofType" : null 1657 | }, 1658 | "defaultValue" : null 1659 | }, { 1660 | "name" : "summary", 1661 | "description" : null, 1662 | "type" : { 1663 | "kind" : "INPUT_OBJECT", 1664 | "name" : "ModelStringInput", 1665 | "ofType" : null 1666 | }, 1667 | "defaultValue" : null 1668 | }, { 1669 | "name" : "body", 1670 | "description" : null, 1671 | "type" : { 1672 | "kind" : "INPUT_OBJECT", 1673 | "name" : "ModelStringInput", 1674 | "ofType" : null 1675 | }, 1676 | "defaultValue" : null 1677 | }, { 1678 | "name" : "createdAt", 1679 | "description" : null, 1680 | "type" : { 1681 | "kind" : "INPUT_OBJECT", 1682 | "name" : "ModelStringInput", 1683 | "ofType" : null 1684 | }, 1685 | "defaultValue" : null 1686 | }, { 1687 | "name" : "and", 1688 | "description" : null, 1689 | "type" : { 1690 | "kind" : "LIST", 1691 | "name" : null, 1692 | "ofType" : { 1693 | "kind" : "INPUT_OBJECT", 1694 | "name" : "ModelPostConditionInput", 1695 | "ofType" : null 1696 | } 1697 | }, 1698 | "defaultValue" : null 1699 | }, { 1700 | "name" : "or", 1701 | "description" : null, 1702 | "type" : { 1703 | "kind" : "LIST", 1704 | "name" : null, 1705 | "ofType" : { 1706 | "kind" : "INPUT_OBJECT", 1707 | "name" : "ModelPostConditionInput", 1708 | "ofType" : null 1709 | } 1710 | }, 1711 | "defaultValue" : null 1712 | }, { 1713 | "name" : "not", 1714 | "description" : null, 1715 | "type" : { 1716 | "kind" : "INPUT_OBJECT", 1717 | "name" : "ModelPostConditionInput", 1718 | "ofType" : null 1719 | }, 1720 | "defaultValue" : null 1721 | } ], 1722 | "interfaces" : null, 1723 | "enumValues" : null, 1724 | "possibleTypes" : null 1725 | }, { 1726 | "kind" : "INPUT_OBJECT", 1727 | "name" : "UpdatePostInput", 1728 | "description" : null, 1729 | "fields" : null, 1730 | "inputFields" : [ { 1731 | "name" : "id", 1732 | "description" : null, 1733 | "type" : { 1734 | "kind" : "NON_NULL", 1735 | "name" : null, 1736 | "ofType" : { 1737 | "kind" : "SCALAR", 1738 | "name" : "ID", 1739 | "ofType" : null 1740 | } 1741 | }, 1742 | "defaultValue" : null 1743 | }, { 1744 | "name" : "title", 1745 | "description" : null, 1746 | "type" : { 1747 | "kind" : "SCALAR", 1748 | "name" : "String", 1749 | "ofType" : null 1750 | }, 1751 | "defaultValue" : null 1752 | }, { 1753 | "name" : "summary", 1754 | "description" : null, 1755 | "type" : { 1756 | "kind" : "SCALAR", 1757 | "name" : "String", 1758 | "ofType" : null 1759 | }, 1760 | "defaultValue" : null 1761 | }, { 1762 | "name" : "body", 1763 | "description" : null, 1764 | "type" : { 1765 | "kind" : "SCALAR", 1766 | "name" : "String", 1767 | "ofType" : null 1768 | }, 1769 | "defaultValue" : null 1770 | }, { 1771 | "name" : "createdAt", 1772 | "description" : null, 1773 | "type" : { 1774 | "kind" : "SCALAR", 1775 | "name" : "String", 1776 | "ofType" : null 1777 | }, 1778 | "defaultValue" : null 1779 | }, { 1780 | "name" : "authorId", 1781 | "description" : null, 1782 | "type" : { 1783 | "kind" : "SCALAR", 1784 | "name" : "String", 1785 | "ofType" : null 1786 | }, 1787 | "defaultValue" : null 1788 | } ], 1789 | "interfaces" : null, 1790 | "enumValues" : null, 1791 | "possibleTypes" : null 1792 | }, { 1793 | "kind" : "INPUT_OBJECT", 1794 | "name" : "DeletePostInput", 1795 | "description" : null, 1796 | "fields" : null, 1797 | "inputFields" : [ { 1798 | "name" : "id", 1799 | "description" : null, 1800 | "type" : { 1801 | "kind" : "SCALAR", 1802 | "name" : "ID", 1803 | "ofType" : null 1804 | }, 1805 | "defaultValue" : null 1806 | } ], 1807 | "interfaces" : null, 1808 | "enumValues" : null, 1809 | "possibleTypes" : null 1810 | }, { 1811 | "kind" : "OBJECT", 1812 | "name" : "Subscription", 1813 | "description" : null, 1814 | "fields" : [ { 1815 | "name" : "onCreateUser", 1816 | "description" : null, 1817 | "args" : [ { 1818 | "name" : "id", 1819 | "description" : null, 1820 | "type" : { 1821 | "kind" : "SCALAR", 1822 | "name" : "String", 1823 | "ofType" : null 1824 | }, 1825 | "defaultValue" : null 1826 | } ], 1827 | "type" : { 1828 | "kind" : "OBJECT", 1829 | "name" : "User", 1830 | "ofType" : null 1831 | }, 1832 | "isDeprecated" : false, 1833 | "deprecationReason" : null 1834 | }, { 1835 | "name" : "onUpdateUser", 1836 | "description" : null, 1837 | "args" : [ { 1838 | "name" : "id", 1839 | "description" : null, 1840 | "type" : { 1841 | "kind" : "SCALAR", 1842 | "name" : "String", 1843 | "ofType" : null 1844 | }, 1845 | "defaultValue" : null 1846 | } ], 1847 | "type" : { 1848 | "kind" : "OBJECT", 1849 | "name" : "User", 1850 | "ofType" : null 1851 | }, 1852 | "isDeprecated" : false, 1853 | "deprecationReason" : null 1854 | }, { 1855 | "name" : "onDeleteUser", 1856 | "description" : null, 1857 | "args" : [ { 1858 | "name" : "id", 1859 | "description" : null, 1860 | "type" : { 1861 | "kind" : "SCALAR", 1862 | "name" : "String", 1863 | "ofType" : null 1864 | }, 1865 | "defaultValue" : null 1866 | } ], 1867 | "type" : { 1868 | "kind" : "OBJECT", 1869 | "name" : "User", 1870 | "ofType" : null 1871 | }, 1872 | "isDeprecated" : false, 1873 | "deprecationReason" : null 1874 | }, { 1875 | "name" : "onCreatePost", 1876 | "description" : null, 1877 | "args" : [ { 1878 | "name" : "authorId", 1879 | "description" : null, 1880 | "type" : { 1881 | "kind" : "SCALAR", 1882 | "name" : "String", 1883 | "ofType" : null 1884 | }, 1885 | "defaultValue" : null 1886 | } ], 1887 | "type" : { 1888 | "kind" : "OBJECT", 1889 | "name" : "Post", 1890 | "ofType" : null 1891 | }, 1892 | "isDeprecated" : false, 1893 | "deprecationReason" : null 1894 | }, { 1895 | "name" : "onUpdatePost", 1896 | "description" : null, 1897 | "args" : [ { 1898 | "name" : "authorId", 1899 | "description" : null, 1900 | "type" : { 1901 | "kind" : "SCALAR", 1902 | "name" : "String", 1903 | "ofType" : null 1904 | }, 1905 | "defaultValue" : null 1906 | } ], 1907 | "type" : { 1908 | "kind" : "OBJECT", 1909 | "name" : "Post", 1910 | "ofType" : null 1911 | }, 1912 | "isDeprecated" : false, 1913 | "deprecationReason" : null 1914 | }, { 1915 | "name" : "onDeletePost", 1916 | "description" : null, 1917 | "args" : [ { 1918 | "name" : "authorId", 1919 | "description" : null, 1920 | "type" : { 1921 | "kind" : "SCALAR", 1922 | "name" : "String", 1923 | "ofType" : null 1924 | }, 1925 | "defaultValue" : null 1926 | } ], 1927 | "type" : { 1928 | "kind" : "OBJECT", 1929 | "name" : "Post", 1930 | "ofType" : null 1931 | }, 1932 | "isDeprecated" : false, 1933 | "deprecationReason" : null 1934 | } ], 1935 | "inputFields" : null, 1936 | "interfaces" : [ ], 1937 | "enumValues" : null, 1938 | "possibleTypes" : null 1939 | }, { 1940 | "kind" : "INPUT_OBJECT", 1941 | "name" : "ModelBooleanInput", 1942 | "description" : null, 1943 | "fields" : null, 1944 | "inputFields" : [ { 1945 | "name" : "ne", 1946 | "description" : null, 1947 | "type" : { 1948 | "kind" : "SCALAR", 1949 | "name" : "Boolean", 1950 | "ofType" : null 1951 | }, 1952 | "defaultValue" : null 1953 | }, { 1954 | "name" : "eq", 1955 | "description" : null, 1956 | "type" : { 1957 | "kind" : "SCALAR", 1958 | "name" : "Boolean", 1959 | "ofType" : null 1960 | }, 1961 | "defaultValue" : null 1962 | }, { 1963 | "name" : "attributeExists", 1964 | "description" : null, 1965 | "type" : { 1966 | "kind" : "SCALAR", 1967 | "name" : "Boolean", 1968 | "ofType" : null 1969 | }, 1970 | "defaultValue" : null 1971 | }, { 1972 | "name" : "attributeType", 1973 | "description" : null, 1974 | "type" : { 1975 | "kind" : "ENUM", 1976 | "name" : "ModelAttributeTypes", 1977 | "ofType" : null 1978 | }, 1979 | "defaultValue" : null 1980 | } ], 1981 | "interfaces" : null, 1982 | "enumValues" : null, 1983 | "possibleTypes" : null 1984 | }, { 1985 | "kind" : "INPUT_OBJECT", 1986 | "name" : "ModelFloatInput", 1987 | "description" : null, 1988 | "fields" : null, 1989 | "inputFields" : [ { 1990 | "name" : "ne", 1991 | "description" : null, 1992 | "type" : { 1993 | "kind" : "SCALAR", 1994 | "name" : "Float", 1995 | "ofType" : null 1996 | }, 1997 | "defaultValue" : null 1998 | }, { 1999 | "name" : "eq", 2000 | "description" : null, 2001 | "type" : { 2002 | "kind" : "SCALAR", 2003 | "name" : "Float", 2004 | "ofType" : null 2005 | }, 2006 | "defaultValue" : null 2007 | }, { 2008 | "name" : "le", 2009 | "description" : null, 2010 | "type" : { 2011 | "kind" : "SCALAR", 2012 | "name" : "Float", 2013 | "ofType" : null 2014 | }, 2015 | "defaultValue" : null 2016 | }, { 2017 | "name" : "lt", 2018 | "description" : null, 2019 | "type" : { 2020 | "kind" : "SCALAR", 2021 | "name" : "Float", 2022 | "ofType" : null 2023 | }, 2024 | "defaultValue" : null 2025 | }, { 2026 | "name" : "ge", 2027 | "description" : null, 2028 | "type" : { 2029 | "kind" : "SCALAR", 2030 | "name" : "Float", 2031 | "ofType" : null 2032 | }, 2033 | "defaultValue" : null 2034 | }, { 2035 | "name" : "gt", 2036 | "description" : null, 2037 | "type" : { 2038 | "kind" : "SCALAR", 2039 | "name" : "Float", 2040 | "ofType" : null 2041 | }, 2042 | "defaultValue" : null 2043 | }, { 2044 | "name" : "between", 2045 | "description" : null, 2046 | "type" : { 2047 | "kind" : "LIST", 2048 | "name" : null, 2049 | "ofType" : { 2050 | "kind" : "SCALAR", 2051 | "name" : "Float", 2052 | "ofType" : null 2053 | } 2054 | }, 2055 | "defaultValue" : null 2056 | }, { 2057 | "name" : "attributeExists", 2058 | "description" : null, 2059 | "type" : { 2060 | "kind" : "SCALAR", 2061 | "name" : "Boolean", 2062 | "ofType" : null 2063 | }, 2064 | "defaultValue" : null 2065 | }, { 2066 | "name" : "attributeType", 2067 | "description" : null, 2068 | "type" : { 2069 | "kind" : "ENUM", 2070 | "name" : "ModelAttributeTypes", 2071 | "ofType" : null 2072 | }, 2073 | "defaultValue" : null 2074 | } ], 2075 | "interfaces" : null, 2076 | "enumValues" : null, 2077 | "possibleTypes" : null 2078 | }, { 2079 | "kind" : "SCALAR", 2080 | "name" : "Float", 2081 | "description" : "Built-in Float", 2082 | "fields" : null, 2083 | "inputFields" : null, 2084 | "interfaces" : null, 2085 | "enumValues" : null, 2086 | "possibleTypes" : null 2087 | }, { 2088 | "kind" : "INPUT_OBJECT", 2089 | "name" : "ModelIntInput", 2090 | "description" : null, 2091 | "fields" : null, 2092 | "inputFields" : [ { 2093 | "name" : "ne", 2094 | "description" : null, 2095 | "type" : { 2096 | "kind" : "SCALAR", 2097 | "name" : "Int", 2098 | "ofType" : null 2099 | }, 2100 | "defaultValue" : null 2101 | }, { 2102 | "name" : "eq", 2103 | "description" : null, 2104 | "type" : { 2105 | "kind" : "SCALAR", 2106 | "name" : "Int", 2107 | "ofType" : null 2108 | }, 2109 | "defaultValue" : null 2110 | }, { 2111 | "name" : "le", 2112 | "description" : null, 2113 | "type" : { 2114 | "kind" : "SCALAR", 2115 | "name" : "Int", 2116 | "ofType" : null 2117 | }, 2118 | "defaultValue" : null 2119 | }, { 2120 | "name" : "lt", 2121 | "description" : null, 2122 | "type" : { 2123 | "kind" : "SCALAR", 2124 | "name" : "Int", 2125 | "ofType" : null 2126 | }, 2127 | "defaultValue" : null 2128 | }, { 2129 | "name" : "ge", 2130 | "description" : null, 2131 | "type" : { 2132 | "kind" : "SCALAR", 2133 | "name" : "Int", 2134 | "ofType" : null 2135 | }, 2136 | "defaultValue" : null 2137 | }, { 2138 | "name" : "gt", 2139 | "description" : null, 2140 | "type" : { 2141 | "kind" : "SCALAR", 2142 | "name" : "Int", 2143 | "ofType" : null 2144 | }, 2145 | "defaultValue" : null 2146 | }, { 2147 | "name" : "between", 2148 | "description" : null, 2149 | "type" : { 2150 | "kind" : "LIST", 2151 | "name" : null, 2152 | "ofType" : { 2153 | "kind" : "SCALAR", 2154 | "name" : "Int", 2155 | "ofType" : null 2156 | } 2157 | }, 2158 | "defaultValue" : null 2159 | }, { 2160 | "name" : "attributeExists", 2161 | "description" : null, 2162 | "type" : { 2163 | "kind" : "SCALAR", 2164 | "name" : "Boolean", 2165 | "ofType" : null 2166 | }, 2167 | "defaultValue" : null 2168 | }, { 2169 | "name" : "attributeType", 2170 | "description" : null, 2171 | "type" : { 2172 | "kind" : "ENUM", 2173 | "name" : "ModelAttributeTypes", 2174 | "ofType" : null 2175 | }, 2176 | "defaultValue" : null 2177 | } ], 2178 | "interfaces" : null, 2179 | "enumValues" : null, 2180 | "possibleTypes" : null 2181 | }, { 2182 | "kind" : "OBJECT", 2183 | "name" : "__Schema", 2184 | "description" : "A GraphQL Introspection defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, the entry points for query, mutation, and subscription operations.", 2185 | "fields" : [ { 2186 | "name" : "types", 2187 | "description" : "A list of all types supported by this server.", 2188 | "args" : [ ], 2189 | "type" : { 2190 | "kind" : "NON_NULL", 2191 | "name" : null, 2192 | "ofType" : { 2193 | "kind" : "LIST", 2194 | "name" : null, 2195 | "ofType" : { 2196 | "kind" : "NON_NULL", 2197 | "name" : null, 2198 | "ofType" : { 2199 | "kind" : "OBJECT", 2200 | "name" : "__Type", 2201 | "ofType" : null 2202 | } 2203 | } 2204 | } 2205 | }, 2206 | "isDeprecated" : false, 2207 | "deprecationReason" : null 2208 | }, { 2209 | "name" : "queryType", 2210 | "description" : "The type that query operations will be rooted at.", 2211 | "args" : [ ], 2212 | "type" : { 2213 | "kind" : "NON_NULL", 2214 | "name" : null, 2215 | "ofType" : { 2216 | "kind" : "OBJECT", 2217 | "name" : "__Type", 2218 | "ofType" : null 2219 | } 2220 | }, 2221 | "isDeprecated" : false, 2222 | "deprecationReason" : null 2223 | }, { 2224 | "name" : "mutationType", 2225 | "description" : "If this server supports mutation, the type that mutation operations will be rooted at.", 2226 | "args" : [ ], 2227 | "type" : { 2228 | "kind" : "OBJECT", 2229 | "name" : "__Type", 2230 | "ofType" : null 2231 | }, 2232 | "isDeprecated" : false, 2233 | "deprecationReason" : null 2234 | }, { 2235 | "name" : "directives", 2236 | "description" : "'A list of all directives supported by this server.", 2237 | "args" : [ ], 2238 | "type" : { 2239 | "kind" : "NON_NULL", 2240 | "name" : null, 2241 | "ofType" : { 2242 | "kind" : "LIST", 2243 | "name" : null, 2244 | "ofType" : { 2245 | "kind" : "NON_NULL", 2246 | "name" : null, 2247 | "ofType" : { 2248 | "kind" : "OBJECT", 2249 | "name" : "__Directive", 2250 | "ofType" : null 2251 | } 2252 | } 2253 | } 2254 | }, 2255 | "isDeprecated" : false, 2256 | "deprecationReason" : null 2257 | }, { 2258 | "name" : "subscriptionType", 2259 | "description" : "'If this server support subscription, the type that subscription operations will be rooted at.", 2260 | "args" : [ ], 2261 | "type" : { 2262 | "kind" : "OBJECT", 2263 | "name" : "__Type", 2264 | "ofType" : null 2265 | }, 2266 | "isDeprecated" : false, 2267 | "deprecationReason" : null 2268 | } ], 2269 | "inputFields" : null, 2270 | "interfaces" : [ ], 2271 | "enumValues" : null, 2272 | "possibleTypes" : null 2273 | }, { 2274 | "kind" : "OBJECT", 2275 | "name" : "__Type", 2276 | "description" : null, 2277 | "fields" : [ { 2278 | "name" : "kind", 2279 | "description" : null, 2280 | "args" : [ ], 2281 | "type" : { 2282 | "kind" : "NON_NULL", 2283 | "name" : null, 2284 | "ofType" : { 2285 | "kind" : "ENUM", 2286 | "name" : "__TypeKind", 2287 | "ofType" : null 2288 | } 2289 | }, 2290 | "isDeprecated" : false, 2291 | "deprecationReason" : null 2292 | }, { 2293 | "name" : "name", 2294 | "description" : null, 2295 | "args" : [ ], 2296 | "type" : { 2297 | "kind" : "SCALAR", 2298 | "name" : "String", 2299 | "ofType" : null 2300 | }, 2301 | "isDeprecated" : false, 2302 | "deprecationReason" : null 2303 | }, { 2304 | "name" : "description", 2305 | "description" : null, 2306 | "args" : [ ], 2307 | "type" : { 2308 | "kind" : "SCALAR", 2309 | "name" : "String", 2310 | "ofType" : null 2311 | }, 2312 | "isDeprecated" : false, 2313 | "deprecationReason" : null 2314 | }, { 2315 | "name" : "fields", 2316 | "description" : null, 2317 | "args" : [ { 2318 | "name" : "includeDeprecated", 2319 | "description" : null, 2320 | "type" : { 2321 | "kind" : "SCALAR", 2322 | "name" : "Boolean", 2323 | "ofType" : null 2324 | }, 2325 | "defaultValue" : "false" 2326 | } ], 2327 | "type" : { 2328 | "kind" : "LIST", 2329 | "name" : null, 2330 | "ofType" : { 2331 | "kind" : "NON_NULL", 2332 | "name" : null, 2333 | "ofType" : { 2334 | "kind" : "OBJECT", 2335 | "name" : "__Field", 2336 | "ofType" : null 2337 | } 2338 | } 2339 | }, 2340 | "isDeprecated" : false, 2341 | "deprecationReason" : null 2342 | }, { 2343 | "name" : "interfaces", 2344 | "description" : null, 2345 | "args" : [ ], 2346 | "type" : { 2347 | "kind" : "LIST", 2348 | "name" : null, 2349 | "ofType" : { 2350 | "kind" : "NON_NULL", 2351 | "name" : null, 2352 | "ofType" : { 2353 | "kind" : "OBJECT", 2354 | "name" : "__Type", 2355 | "ofType" : null 2356 | } 2357 | } 2358 | }, 2359 | "isDeprecated" : false, 2360 | "deprecationReason" : null 2361 | }, { 2362 | "name" : "possibleTypes", 2363 | "description" : null, 2364 | "args" : [ ], 2365 | "type" : { 2366 | "kind" : "LIST", 2367 | "name" : null, 2368 | "ofType" : { 2369 | "kind" : "NON_NULL", 2370 | "name" : null, 2371 | "ofType" : { 2372 | "kind" : "OBJECT", 2373 | "name" : "__Type", 2374 | "ofType" : null 2375 | } 2376 | } 2377 | }, 2378 | "isDeprecated" : false, 2379 | "deprecationReason" : null 2380 | }, { 2381 | "name" : "enumValues", 2382 | "description" : null, 2383 | "args" : [ { 2384 | "name" : "includeDeprecated", 2385 | "description" : null, 2386 | "type" : { 2387 | "kind" : "SCALAR", 2388 | "name" : "Boolean", 2389 | "ofType" : null 2390 | }, 2391 | "defaultValue" : "false" 2392 | } ], 2393 | "type" : { 2394 | "kind" : "LIST", 2395 | "name" : null, 2396 | "ofType" : { 2397 | "kind" : "NON_NULL", 2398 | "name" : null, 2399 | "ofType" : { 2400 | "kind" : "OBJECT", 2401 | "name" : "__EnumValue", 2402 | "ofType" : null 2403 | } 2404 | } 2405 | }, 2406 | "isDeprecated" : false, 2407 | "deprecationReason" : null 2408 | }, { 2409 | "name" : "inputFields", 2410 | "description" : null, 2411 | "args" : [ ], 2412 | "type" : { 2413 | "kind" : "LIST", 2414 | "name" : null, 2415 | "ofType" : { 2416 | "kind" : "NON_NULL", 2417 | "name" : null, 2418 | "ofType" : { 2419 | "kind" : "OBJECT", 2420 | "name" : "__InputValue", 2421 | "ofType" : null 2422 | } 2423 | } 2424 | }, 2425 | "isDeprecated" : false, 2426 | "deprecationReason" : null 2427 | }, { 2428 | "name" : "ofType", 2429 | "description" : null, 2430 | "args" : [ ], 2431 | "type" : { 2432 | "kind" : "OBJECT", 2433 | "name" : "__Type", 2434 | "ofType" : null 2435 | }, 2436 | "isDeprecated" : false, 2437 | "deprecationReason" : null 2438 | } ], 2439 | "inputFields" : null, 2440 | "interfaces" : [ ], 2441 | "enumValues" : null, 2442 | "possibleTypes" : null 2443 | }, { 2444 | "kind" : "ENUM", 2445 | "name" : "__TypeKind", 2446 | "description" : "An enum describing what kind of type a given __Type is", 2447 | "fields" : null, 2448 | "inputFields" : null, 2449 | "interfaces" : null, 2450 | "enumValues" : [ { 2451 | "name" : "SCALAR", 2452 | "description" : "Indicates this type is a scalar.", 2453 | "isDeprecated" : false, 2454 | "deprecationReason" : null 2455 | }, { 2456 | "name" : "OBJECT", 2457 | "description" : "Indicates this type is an object. `fields` and `interfaces` are valid fields.", 2458 | "isDeprecated" : false, 2459 | "deprecationReason" : null 2460 | }, { 2461 | "name" : "INTERFACE", 2462 | "description" : "Indicates this type is an interface. `fields` and `possibleTypes` are valid fields.", 2463 | "isDeprecated" : false, 2464 | "deprecationReason" : null 2465 | }, { 2466 | "name" : "UNION", 2467 | "description" : "Indicates this type is a union. `possibleTypes` is a valid field.", 2468 | "isDeprecated" : false, 2469 | "deprecationReason" : null 2470 | }, { 2471 | "name" : "ENUM", 2472 | "description" : "Indicates this type is an enum. `enumValues` is a valid field.", 2473 | "isDeprecated" : false, 2474 | "deprecationReason" : null 2475 | }, { 2476 | "name" : "INPUT_OBJECT", 2477 | "description" : "Indicates this type is an input object. `inputFields` is a valid field.", 2478 | "isDeprecated" : false, 2479 | "deprecationReason" : null 2480 | }, { 2481 | "name" : "LIST", 2482 | "description" : "Indicates this type is a list. `ofType` is a valid field.", 2483 | "isDeprecated" : false, 2484 | "deprecationReason" : null 2485 | }, { 2486 | "name" : "NON_NULL", 2487 | "description" : "Indicates this type is a non-null. `ofType` is a valid field.", 2488 | "isDeprecated" : false, 2489 | "deprecationReason" : null 2490 | } ], 2491 | "possibleTypes" : null 2492 | }, { 2493 | "kind" : "OBJECT", 2494 | "name" : "__Field", 2495 | "description" : null, 2496 | "fields" : [ { 2497 | "name" : "name", 2498 | "description" : null, 2499 | "args" : [ ], 2500 | "type" : { 2501 | "kind" : "NON_NULL", 2502 | "name" : null, 2503 | "ofType" : { 2504 | "kind" : "SCALAR", 2505 | "name" : "String", 2506 | "ofType" : null 2507 | } 2508 | }, 2509 | "isDeprecated" : false, 2510 | "deprecationReason" : null 2511 | }, { 2512 | "name" : "description", 2513 | "description" : null, 2514 | "args" : [ ], 2515 | "type" : { 2516 | "kind" : "SCALAR", 2517 | "name" : "String", 2518 | "ofType" : null 2519 | }, 2520 | "isDeprecated" : false, 2521 | "deprecationReason" : null 2522 | }, { 2523 | "name" : "args", 2524 | "description" : null, 2525 | "args" : [ ], 2526 | "type" : { 2527 | "kind" : "NON_NULL", 2528 | "name" : null, 2529 | "ofType" : { 2530 | "kind" : "LIST", 2531 | "name" : null, 2532 | "ofType" : { 2533 | "kind" : "NON_NULL", 2534 | "name" : null, 2535 | "ofType" : { 2536 | "kind" : "OBJECT", 2537 | "name" : "__InputValue", 2538 | "ofType" : null 2539 | } 2540 | } 2541 | } 2542 | }, 2543 | "isDeprecated" : false, 2544 | "deprecationReason" : null 2545 | }, { 2546 | "name" : "type", 2547 | "description" : null, 2548 | "args" : [ ], 2549 | "type" : { 2550 | "kind" : "NON_NULL", 2551 | "name" : null, 2552 | "ofType" : { 2553 | "kind" : "OBJECT", 2554 | "name" : "__Type", 2555 | "ofType" : null 2556 | } 2557 | }, 2558 | "isDeprecated" : false, 2559 | "deprecationReason" : null 2560 | }, { 2561 | "name" : "isDeprecated", 2562 | "description" : null, 2563 | "args" : [ ], 2564 | "type" : { 2565 | "kind" : "NON_NULL", 2566 | "name" : null, 2567 | "ofType" : { 2568 | "kind" : "SCALAR", 2569 | "name" : "Boolean", 2570 | "ofType" : null 2571 | } 2572 | }, 2573 | "isDeprecated" : false, 2574 | "deprecationReason" : null 2575 | }, { 2576 | "name" : "deprecationReason", 2577 | "description" : null, 2578 | "args" : [ ], 2579 | "type" : { 2580 | "kind" : "SCALAR", 2581 | "name" : "String", 2582 | "ofType" : null 2583 | }, 2584 | "isDeprecated" : false, 2585 | "deprecationReason" : null 2586 | } ], 2587 | "inputFields" : null, 2588 | "interfaces" : [ ], 2589 | "enumValues" : null, 2590 | "possibleTypes" : null 2591 | }, { 2592 | "kind" : "OBJECT", 2593 | "name" : "__InputValue", 2594 | "description" : null, 2595 | "fields" : [ { 2596 | "name" : "name", 2597 | "description" : null, 2598 | "args" : [ ], 2599 | "type" : { 2600 | "kind" : "NON_NULL", 2601 | "name" : null, 2602 | "ofType" : { 2603 | "kind" : "SCALAR", 2604 | "name" : "String", 2605 | "ofType" : null 2606 | } 2607 | }, 2608 | "isDeprecated" : false, 2609 | "deprecationReason" : null 2610 | }, { 2611 | "name" : "description", 2612 | "description" : null, 2613 | "args" : [ ], 2614 | "type" : { 2615 | "kind" : "SCALAR", 2616 | "name" : "String", 2617 | "ofType" : null 2618 | }, 2619 | "isDeprecated" : false, 2620 | "deprecationReason" : null 2621 | }, { 2622 | "name" : "type", 2623 | "description" : null, 2624 | "args" : [ ], 2625 | "type" : { 2626 | "kind" : "NON_NULL", 2627 | "name" : null, 2628 | "ofType" : { 2629 | "kind" : "OBJECT", 2630 | "name" : "__Type", 2631 | "ofType" : null 2632 | } 2633 | }, 2634 | "isDeprecated" : false, 2635 | "deprecationReason" : null 2636 | }, { 2637 | "name" : "defaultValue", 2638 | "description" : null, 2639 | "args" : [ ], 2640 | "type" : { 2641 | "kind" : "SCALAR", 2642 | "name" : "String", 2643 | "ofType" : null 2644 | }, 2645 | "isDeprecated" : false, 2646 | "deprecationReason" : null 2647 | } ], 2648 | "inputFields" : null, 2649 | "interfaces" : [ ], 2650 | "enumValues" : null, 2651 | "possibleTypes" : null 2652 | }, { 2653 | "kind" : "OBJECT", 2654 | "name" : "__EnumValue", 2655 | "description" : null, 2656 | "fields" : [ { 2657 | "name" : "name", 2658 | "description" : null, 2659 | "args" : [ ], 2660 | "type" : { 2661 | "kind" : "NON_NULL", 2662 | "name" : null, 2663 | "ofType" : { 2664 | "kind" : "SCALAR", 2665 | "name" : "String", 2666 | "ofType" : null 2667 | } 2668 | }, 2669 | "isDeprecated" : false, 2670 | "deprecationReason" : null 2671 | }, { 2672 | "name" : "description", 2673 | "description" : null, 2674 | "args" : [ ], 2675 | "type" : { 2676 | "kind" : "SCALAR", 2677 | "name" : "String", 2678 | "ofType" : null 2679 | }, 2680 | "isDeprecated" : false, 2681 | "deprecationReason" : null 2682 | }, { 2683 | "name" : "isDeprecated", 2684 | "description" : null, 2685 | "args" : [ ], 2686 | "type" : { 2687 | "kind" : "NON_NULL", 2688 | "name" : null, 2689 | "ofType" : { 2690 | "kind" : "SCALAR", 2691 | "name" : "Boolean", 2692 | "ofType" : null 2693 | } 2694 | }, 2695 | "isDeprecated" : false, 2696 | "deprecationReason" : null 2697 | }, { 2698 | "name" : "deprecationReason", 2699 | "description" : null, 2700 | "args" : [ ], 2701 | "type" : { 2702 | "kind" : "SCALAR", 2703 | "name" : "String", 2704 | "ofType" : null 2705 | }, 2706 | "isDeprecated" : false, 2707 | "deprecationReason" : null 2708 | } ], 2709 | "inputFields" : null, 2710 | "interfaces" : [ ], 2711 | "enumValues" : null, 2712 | "possibleTypes" : null 2713 | }, { 2714 | "kind" : "OBJECT", 2715 | "name" : "__Directive", 2716 | "description" : null, 2717 | "fields" : [ { 2718 | "name" : "name", 2719 | "description" : null, 2720 | "args" : [ ], 2721 | "type" : { 2722 | "kind" : "SCALAR", 2723 | "name" : "String", 2724 | "ofType" : null 2725 | }, 2726 | "isDeprecated" : false, 2727 | "deprecationReason" : null 2728 | }, { 2729 | "name" : "description", 2730 | "description" : null, 2731 | "args" : [ ], 2732 | "type" : { 2733 | "kind" : "SCALAR", 2734 | "name" : "String", 2735 | "ofType" : null 2736 | }, 2737 | "isDeprecated" : false, 2738 | "deprecationReason" : null 2739 | }, { 2740 | "name" : "locations", 2741 | "description" : null, 2742 | "args" : [ ], 2743 | "type" : { 2744 | "kind" : "LIST", 2745 | "name" : null, 2746 | "ofType" : { 2747 | "kind" : "NON_NULL", 2748 | "name" : null, 2749 | "ofType" : { 2750 | "kind" : "ENUM", 2751 | "name" : "__DirectiveLocation", 2752 | "ofType" : null 2753 | } 2754 | } 2755 | }, 2756 | "isDeprecated" : false, 2757 | "deprecationReason" : null 2758 | }, { 2759 | "name" : "args", 2760 | "description" : null, 2761 | "args" : [ ], 2762 | "type" : { 2763 | "kind" : "NON_NULL", 2764 | "name" : null, 2765 | "ofType" : { 2766 | "kind" : "LIST", 2767 | "name" : null, 2768 | "ofType" : { 2769 | "kind" : "NON_NULL", 2770 | "name" : null, 2771 | "ofType" : { 2772 | "kind" : "OBJECT", 2773 | "name" : "__InputValue", 2774 | "ofType" : null 2775 | } 2776 | } 2777 | } 2778 | }, 2779 | "isDeprecated" : false, 2780 | "deprecationReason" : null 2781 | }, { 2782 | "name" : "onOperation", 2783 | "description" : null, 2784 | "args" : [ ], 2785 | "type" : { 2786 | "kind" : "SCALAR", 2787 | "name" : "Boolean", 2788 | "ofType" : null 2789 | }, 2790 | "isDeprecated" : true, 2791 | "deprecationReason" : "Use `locations`." 2792 | }, { 2793 | "name" : "onFragment", 2794 | "description" : null, 2795 | "args" : [ ], 2796 | "type" : { 2797 | "kind" : "SCALAR", 2798 | "name" : "Boolean", 2799 | "ofType" : null 2800 | }, 2801 | "isDeprecated" : true, 2802 | "deprecationReason" : "Use `locations`." 2803 | }, { 2804 | "name" : "onField", 2805 | "description" : null, 2806 | "args" : [ ], 2807 | "type" : { 2808 | "kind" : "SCALAR", 2809 | "name" : "Boolean", 2810 | "ofType" : null 2811 | }, 2812 | "isDeprecated" : true, 2813 | "deprecationReason" : "Use `locations`." 2814 | } ], 2815 | "inputFields" : null, 2816 | "interfaces" : [ ], 2817 | "enumValues" : null, 2818 | "possibleTypes" : null 2819 | }, { 2820 | "kind" : "ENUM", 2821 | "name" : "__DirectiveLocation", 2822 | "description" : "An enum describing valid locations where a directive can be placed", 2823 | "fields" : null, 2824 | "inputFields" : null, 2825 | "interfaces" : null, 2826 | "enumValues" : [ { 2827 | "name" : "QUERY", 2828 | "description" : "Indicates the directive is valid on queries.", 2829 | "isDeprecated" : false, 2830 | "deprecationReason" : null 2831 | }, { 2832 | "name" : "MUTATION", 2833 | "description" : "Indicates the directive is valid on mutations.", 2834 | "isDeprecated" : false, 2835 | "deprecationReason" : null 2836 | }, { 2837 | "name" : "FIELD", 2838 | "description" : "Indicates the directive is valid on fields.", 2839 | "isDeprecated" : false, 2840 | "deprecationReason" : null 2841 | }, { 2842 | "name" : "FRAGMENT_DEFINITION", 2843 | "description" : "Indicates the directive is valid on fragment definitions.", 2844 | "isDeprecated" : false, 2845 | "deprecationReason" : null 2846 | }, { 2847 | "name" : "FRAGMENT_SPREAD", 2848 | "description" : "Indicates the directive is valid on fragment spreads.", 2849 | "isDeprecated" : false, 2850 | "deprecationReason" : null 2851 | }, { 2852 | "name" : "INLINE_FRAGMENT", 2853 | "description" : "Indicates the directive is valid on inline fragments.", 2854 | "isDeprecated" : false, 2855 | "deprecationReason" : null 2856 | }, { 2857 | "name" : "SCHEMA", 2858 | "description" : "Indicates the directive is valid on a schema SDL definition.", 2859 | "isDeprecated" : false, 2860 | "deprecationReason" : null 2861 | }, { 2862 | "name" : "SCALAR", 2863 | "description" : "Indicates the directive is valid on a scalar SDL definition.", 2864 | "isDeprecated" : false, 2865 | "deprecationReason" : null 2866 | }, { 2867 | "name" : "OBJECT", 2868 | "description" : "Indicates the directive is valid on an object SDL definition.", 2869 | "isDeprecated" : false, 2870 | "deprecationReason" : null 2871 | }, { 2872 | "name" : "FIELD_DEFINITION", 2873 | "description" : "Indicates the directive is valid on a field SDL definition.", 2874 | "isDeprecated" : false, 2875 | "deprecationReason" : null 2876 | }, { 2877 | "name" : "ARGUMENT_DEFINITION", 2878 | "description" : "Indicates the directive is valid on a field argument SDL definition.", 2879 | "isDeprecated" : false, 2880 | "deprecationReason" : null 2881 | }, { 2882 | "name" : "INTERFACE", 2883 | "description" : "Indicates the directive is valid on an interface SDL definition.", 2884 | "isDeprecated" : false, 2885 | "deprecationReason" : null 2886 | }, { 2887 | "name" : "UNION", 2888 | "description" : "Indicates the directive is valid on an union SDL definition.", 2889 | "isDeprecated" : false, 2890 | "deprecationReason" : null 2891 | }, { 2892 | "name" : "ENUM", 2893 | "description" : "Indicates the directive is valid on an enum SDL definition.", 2894 | "isDeprecated" : false, 2895 | "deprecationReason" : null 2896 | }, { 2897 | "name" : "ENUM_VALUE", 2898 | "description" : "Indicates the directive is valid on an enum value SDL definition.", 2899 | "isDeprecated" : false, 2900 | "deprecationReason" : null 2901 | }, { 2902 | "name" : "INPUT_OBJECT", 2903 | "description" : "Indicates the directive is valid on an input object SDL definition.", 2904 | "isDeprecated" : false, 2905 | "deprecationReason" : null 2906 | }, { 2907 | "name" : "INPUT_FIELD_DEFINITION", 2908 | "description" : "Indicates the directive is valid on an input object field SDL definition.", 2909 | "isDeprecated" : false, 2910 | "deprecationReason" : null 2911 | } ], 2912 | "possibleTypes" : null 2913 | } ], 2914 | "directives" : [ { 2915 | "name" : "include", 2916 | "description" : "Directs the executor to include this field or fragment only when the `if` argument is true", 2917 | "locations" : [ "FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT" ], 2918 | "args" : [ { 2919 | "name" : "if", 2920 | "description" : "Included when true.", 2921 | "type" : { 2922 | "kind" : "NON_NULL", 2923 | "name" : null, 2924 | "ofType" : { 2925 | "kind" : "SCALAR", 2926 | "name" : "Boolean", 2927 | "ofType" : null 2928 | } 2929 | }, 2930 | "defaultValue" : null 2931 | } ], 2932 | "onOperation" : false, 2933 | "onFragment" : true, 2934 | "onField" : true 2935 | }, { 2936 | "name" : "skip", 2937 | "description" : "Directs the executor to skip this field or fragment when the `if`'argument is true.", 2938 | "locations" : [ "FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT" ], 2939 | "args" : [ { 2940 | "name" : "if", 2941 | "description" : "Skipped when true.", 2942 | "type" : { 2943 | "kind" : "NON_NULL", 2944 | "name" : null, 2945 | "ofType" : { 2946 | "kind" : "SCALAR", 2947 | "name" : "Boolean", 2948 | "ofType" : null 2949 | } 2950 | }, 2951 | "defaultValue" : null 2952 | } ], 2953 | "onOperation" : false, 2954 | "onFragment" : true, 2955 | "onField" : true 2956 | }, { 2957 | "name" : "defer", 2958 | "description" : "This directive allows results to be deferred during execution", 2959 | "locations" : [ "FIELD" ], 2960 | "args" : [ ], 2961 | "onOperation" : false, 2962 | "onFragment" : false, 2963 | "onField" : true 2964 | }, { 2965 | "name" : "aws_publish", 2966 | "description" : "Tells the service which subscriptions will be published to when this mutation is called. This directive is deprecated use @aws_susbscribe directive instead.", 2967 | "locations" : [ "FIELD_DEFINITION" ], 2968 | "args" : [ { 2969 | "name" : "subscriptions", 2970 | "description" : "List of subscriptions which will be published to when this mutation is called.", 2971 | "type" : { 2972 | "kind" : "LIST", 2973 | "name" : null, 2974 | "ofType" : { 2975 | "kind" : "SCALAR", 2976 | "name" : "String", 2977 | "ofType" : null 2978 | } 2979 | }, 2980 | "defaultValue" : null 2981 | } ], 2982 | "onOperation" : false, 2983 | "onFragment" : false, 2984 | "onField" : false 2985 | }, { 2986 | "name" : "aws_api_key", 2987 | "description" : "Tells the service this field/object has access authorized by an API key.", 2988 | "locations" : [ "OBJECT", "FIELD_DEFINITION" ], 2989 | "args" : [ ], 2990 | "onOperation" : false, 2991 | "onFragment" : false, 2992 | "onField" : false 2993 | }, { 2994 | "name" : "deprecated", 2995 | "description" : null, 2996 | "locations" : [ "FIELD_DEFINITION", "ENUM_VALUE" ], 2997 | "args" : [ { 2998 | "name" : "reason", 2999 | "description" : null, 3000 | "type" : { 3001 | "kind" : "SCALAR", 3002 | "name" : "String", 3003 | "ofType" : null 3004 | }, 3005 | "defaultValue" : "\"No longer supported\"" 3006 | } ], 3007 | "onOperation" : false, 3008 | "onFragment" : false, 3009 | "onField" : false 3010 | }, { 3011 | "name" : "aws_cognito_user_pools", 3012 | "description" : "Tells the service this field/object has access authorized by a Cognito User Pools token.", 3013 | "locations" : [ "OBJECT", "FIELD_DEFINITION" ], 3014 | "args" : [ { 3015 | "name" : "cognito_groups", 3016 | "description" : "List of cognito user pool groups which have access on this field", 3017 | "type" : { 3018 | "kind" : "LIST", 3019 | "name" : null, 3020 | "ofType" : { 3021 | "kind" : "SCALAR", 3022 | "name" : "String", 3023 | "ofType" : null 3024 | } 3025 | }, 3026 | "defaultValue" : null 3027 | } ], 3028 | "onOperation" : false, 3029 | "onFragment" : false, 3030 | "onField" : false 3031 | }, { 3032 | "name" : "aws_subscribe", 3033 | "description" : "Tells the service which mutation triggers this subscription.", 3034 | "locations" : [ "FIELD_DEFINITION" ], 3035 | "args" : [ { 3036 | "name" : "mutations", 3037 | "description" : "List of mutations which will trigger this subscription when they are called.", 3038 | "type" : { 3039 | "kind" : "LIST", 3040 | "name" : null, 3041 | "ofType" : { 3042 | "kind" : "SCALAR", 3043 | "name" : "String", 3044 | "ofType" : null 3045 | } 3046 | }, 3047 | "defaultValue" : null 3048 | } ], 3049 | "onOperation" : false, 3050 | "onFragment" : false, 3051 | "onField" : false 3052 | }, { 3053 | "name" : "aws_oidc", 3054 | "description" : "Tells the service this field/object has access authorized by an OIDC token.", 3055 | "locations" : [ "OBJECT", "FIELD_DEFINITION" ], 3056 | "args" : [ ], 3057 | "onOperation" : false, 3058 | "onFragment" : false, 3059 | "onField" : false 3060 | }, { 3061 | "name" : "aws_auth", 3062 | "description" : "Directs the schema to enforce authorization on a field", 3063 | "locations" : [ "FIELD_DEFINITION" ], 3064 | "args" : [ { 3065 | "name" : "cognito_groups", 3066 | "description" : "List of cognito user pool groups which have access on this field", 3067 | "type" : { 3068 | "kind" : "LIST", 3069 | "name" : null, 3070 | "ofType" : { 3071 | "kind" : "SCALAR", 3072 | "name" : "String", 3073 | "ofType" : null 3074 | } 3075 | }, 3076 | "defaultValue" : null 3077 | } ], 3078 | "onOperation" : false, 3079 | "onFragment" : false, 3080 | "onField" : false 3081 | }, { 3082 | "name" : "aws_iam", 3083 | "description" : "Tells the service this field/object has access authorized by sigv4 signing.", 3084 | "locations" : [ "OBJECT", "FIELD_DEFINITION" ], 3085 | "args" : [ ], 3086 | "onOperation" : false, 3087 | "onFragment" : false, 3088 | "onField" : false 3089 | } ] 3090 | } 3091 | } 3092 | } -------------------------------------------------------------------------------- /03-adding-graphql-api/src/graphql/subscriptions.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | // this is an auto generated file. This will be overwritten 3 | 4 | export const onCreateUser = /* GraphQL */ ` 5 | subscription OnCreateUser($id: String) { 6 | onCreateUser(id: $id) { 7 | id 8 | email 9 | name 10 | biography 11 | website 12 | createdAt 13 | posts { 14 | items { 15 | id 16 | title 17 | summary 18 | body 19 | createdAt 20 | authorId 21 | } 22 | nextToken 23 | } 24 | } 25 | } 26 | `; 27 | export const onUpdateUser = /* GraphQL */ ` 28 | subscription OnUpdateUser($id: String) { 29 | onUpdateUser(id: $id) { 30 | id 31 | email 32 | name 33 | biography 34 | website 35 | createdAt 36 | posts { 37 | items { 38 | id 39 | title 40 | summary 41 | body 42 | createdAt 43 | authorId 44 | } 45 | nextToken 46 | } 47 | } 48 | } 49 | `; 50 | export const onDeleteUser = /* GraphQL */ ` 51 | subscription OnDeleteUser($id: String) { 52 | onDeleteUser(id: $id) { 53 | id 54 | email 55 | name 56 | biography 57 | website 58 | createdAt 59 | posts { 60 | items { 61 | id 62 | title 63 | summary 64 | body 65 | createdAt 66 | authorId 67 | } 68 | nextToken 69 | } 70 | } 71 | } 72 | `; 73 | export const onCreatePost = /* GraphQL */ ` 74 | subscription OnCreatePost($authorId: String) { 75 | onCreatePost(authorId: $authorId) { 76 | id 77 | title 78 | summary 79 | body 80 | createdAt 81 | authorId 82 | author { 83 | id 84 | email 85 | name 86 | biography 87 | website 88 | createdAt 89 | posts { 90 | nextToken 91 | } 92 | } 93 | } 94 | } 95 | `; 96 | export const onUpdatePost = /* GraphQL */ ` 97 | subscription OnUpdatePost($authorId: String) { 98 | onUpdatePost(authorId: $authorId) { 99 | id 100 | title 101 | summary 102 | body 103 | createdAt 104 | authorId 105 | author { 106 | id 107 | email 108 | name 109 | biography 110 | website 111 | createdAt 112 | posts { 113 | nextToken 114 | } 115 | } 116 | } 117 | } 118 | `; 119 | export const onDeletePost = /* GraphQL */ ` 120 | subscription OnDeletePost($authorId: String) { 121 | onDeletePost(authorId: $authorId) { 122 | id 123 | title 124 | summary 125 | body 126 | createdAt 127 | authorId 128 | author { 129 | id 130 | email 131 | name 132 | biography 133 | website 134 | createdAt 135 | posts { 136 | nextToken 137 | } 138 | } 139 | } 140 | } 141 | `; 142 | -------------------------------------------------------------------------------- /03-adding-graphql-api/static/README.md: -------------------------------------------------------------------------------- 1 | # STATIC 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your static files. 6 | Each file inside this directory is mapped to `/`. 7 | Thus you'd want to delete this README.md before deploying to production. 8 | 9 | Example: `/static/robots.txt` is mapped as `/robots.txt`. 10 | 11 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/assets#static). 12 | -------------------------------------------------------------------------------- /03-adding-graphql-api/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adocasts/amplify-nuxt/cb272a3e32d1cb2f2342e580761b9e5952c08bbc/03-adding-graphql-api/static/favicon.ico -------------------------------------------------------------------------------- /03-adding-graphql-api/store/README.md: -------------------------------------------------------------------------------- 1 | # STORE 2 | 3 | **This directory is not required, you can delete it if you don't want to use it.** 4 | 5 | This directory contains your Vuex Store files. 6 | Vuex Store option is implemented in the Nuxt.js framework. 7 | 8 | Creating a file in this directory automatically activates the option in the framework. 9 | 10 | More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/vuex-store). 11 | -------------------------------------------------------------------------------- /03-adding-graphql-api/store/api.js: -------------------------------------------------------------------------------- 1 | import { API } from 'aws-amplify' 2 | import * as gqlQueries from '~/src/graphql/queries' 3 | import * as gqlMutations from '~/src/graphql/mutations' 4 | 5 | export const state = () => ({ 6 | posts: [], 7 | post: null 8 | }) 9 | 10 | export const getters = { 11 | authMode: (state, getters, rootState) => 12 | rootState.auth.isAuthenticated ? 'AMAZON_COGNITO_USER_POOLS' : 'API_KEY' 13 | } 14 | 15 | export const mutations = { 16 | set(state, { key, value }) { 17 | state[key] = value 18 | } 19 | } 20 | 21 | export const actions = { 22 | async listPosts({ dispatch }) { 23 | return dispatch('query', { key: 'posts', query: 'listPosts' }) 24 | }, 25 | 26 | async getPost({ dispatch }, id) { 27 | return dispatch('get', { key: 'post', query: 'getPost', id }) 28 | }, 29 | 30 | async createPost({ dispatch }, input) { 31 | return dispatch('mutate', { key: 'post', mutation: 'createPost', input }) 32 | }, 33 | 34 | async updatePost({ dispatch }, input) { 35 | return dispatch('mutate', { 36 | key: 'post', 37 | mutation: 'updatePost', 38 | input 39 | }) 40 | }, 41 | 42 | async deletePost({ dispatch }, id) { 43 | return dispatch('mutate', { mutation: 'deletePost', input: { id } }) 44 | }, 45 | 46 | // API HELPERS 47 | async get({ commit, getters }, { key, query, id }) { 48 | const { data } = await API.graphql({ 49 | query: gqlQueries[query], 50 | variables: { id }, 51 | authMode: getters.authMode 52 | }) 53 | 54 | const value = data[query] 55 | if (key) commit('set', { key, value }) 56 | return value 57 | }, 58 | 59 | async query({ commit, getters }, { key, query, filter }) { 60 | const { data } = await API.graphql({ 61 | query: gqlQueries[query], 62 | variables: { filter }, 63 | authMode: getters.authMode 64 | }) 65 | 66 | const value = data[query].items 67 | if (key) commit('set', { key, value }) 68 | return value 69 | }, 70 | 71 | async mutate({ commit, getters }, { key, mutation, input }) { 72 | const { data } = await API.graphql({ 73 | query: gqlMutations[mutation], 74 | variables: { input }, 75 | authMode: getters.authMode 76 | }) 77 | 78 | const value = data[mutation] 79 | if (key) commit('set', { key, value }) 80 | return value 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /03-adding-graphql-api/store/auth.js: -------------------------------------------------------------------------------- 1 | import { Auth } from 'aws-amplify' 2 | 3 | export const state = () => ({ 4 | isAuthenticated: false, 5 | user: null 6 | }) 7 | 8 | export const mutations = { 9 | set(state, user) { 10 | state.isAuthenticated = !!user 11 | state.user = user 12 | } 13 | } 14 | 15 | export const actions = { 16 | async load({ commit, dispatch }) { 17 | try { 18 | const user = await Auth.currentAuthenticatedUser() 19 | commit('set', user) 20 | 21 | if (user) { 22 | await dispatch('user/getUser', user.username, { root: true }) 23 | } 24 | 25 | return user 26 | } catch (error) { 27 | commit('set', null) 28 | } 29 | }, 30 | 31 | async register(_, { email, password }) { 32 | const user = await Auth.signUp({ 33 | username: email, 34 | password 35 | }) 36 | return user 37 | }, 38 | 39 | async confirmRegistration(_, { email, code }) { 40 | return await Auth.confirmSignUp(email, code) 41 | }, 42 | 43 | async login({ commit, dispatch }, { email, password }) { 44 | const user = await Auth.signIn(email, password) 45 | commit('set', user) 46 | 47 | await dispatch('user/findOrCreateUser', user, { root: true }) 48 | 49 | return user 50 | }, 51 | 52 | async logout({ commit }) { 53 | await Auth.signOut() 54 | commit('set', null) 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /03-adding-graphql-api/store/index.js: -------------------------------------------------------------------------------- 1 | export const actions = { 2 | nuxtServerInit() {} 3 | } 4 | -------------------------------------------------------------------------------- /03-adding-graphql-api/store/user.js: -------------------------------------------------------------------------------- 1 | import { getUser } from '~/src/graphql/queries' 2 | import { createUser } from '~/src/graphql/mutations' 3 | 4 | export const state = () => ({ 5 | user: null 6 | }) 7 | 8 | export const mutations = { 9 | setUser(state, user) { 10 | state.user = user 11 | } 12 | } 13 | 14 | export const actions = { 15 | async getUser({ commit, dispatch }, id) { 16 | const user = await dispatch( 17 | 'api/get', 18 | { query: 'getUser', id }, 19 | { root: true } 20 | ) 21 | commit('setUser', user) 22 | return user 23 | }, 24 | 25 | async createUser({ commit, dispatch }, input) { 26 | const user = await dispatch( 27 | 'api/mutate', 28 | { mutation: 'createUser', input }, 29 | { root: true } 30 | ) 31 | commit('setUser', user) 32 | return user 33 | }, 34 | 35 | async findOrCreateUser({ dispatch }, { attributes, username }) { 36 | const user = await dispatch('getUser', username) 37 | if (user) return user 38 | 39 | return dispatch('createUser', { 40 | id: username, 41 | email: attributes.email, 42 | createdAt: Date.now() + '' 43 | }) 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /03-adding-graphql-api/tailwind.config.js: -------------------------------------------------------------------------------- 1 | /* 2 | ** TailwindCSS Configuration File 3 | ** 4 | ** Docs: https://tailwindcss.com/docs/configuration 5 | ** Default: https://github.com/tailwindcss/tailwindcss/blob/master/stubs/defaultConfig.stub.js 6 | */ 7 | module.exports = { 8 | theme: {}, 9 | variants: {}, 10 | plugins: [] 11 | } 12 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Amplify + Nuxt 2 | 3 | Video Series: 4 | 5 | - Website: [https://jagr.co](https://jagr.co) 6 | - YouTube: [https://www.youtube.com/playlist?list=PL9dIWiKCV573u7FUcj6bF1vwunYFEDA6Y](https://www.youtube.com/playlist?list=PL9dIWiKCV573u7FUcj6bF1vwunYFEDA6Y) 7 | 8 | ### In this series we'll be going over: 9 | 10 | - [x] [How to setup and configure AWS Amplify in a new Nuxt project](https://jagr.co/posts/how-to-setup-aws-amplify-in-a-new-nuxt-project), [Jagr](https://jagr.co/posts/how-to-setup-aws-amplify-in-a-new-nuxt-project) / [YouTube](https://www.youtube.com/watch?v=bM0iisnRYUk&list=PL9dIWiKCV573u7FUcj6bF1vwunYFEDA6Y&index=2&t=0s) 11 | - [x] [How to add authentication using AWS Amplify's Auth Class in a Nuxt app (Auth Part 1)](https://jagr.co/posts/how-to-add-authentication-using-aws-amplifys-auth-class-in-a-nuxt-app), [Jagr](https://jagr.co/posts/how-to-add-authentication-using-aws-amplifys-auth-class-in-a-nuxt-app) / [YouTube](https://www.youtube.com/watch?v=fzcG5Oe31bo&list=PL9dIWiKCV573u7FUcj6bF1vwunYFEDA6Y&index=3&t=1s) 12 | - [x] [Adding register and login flows using AWS Amplify in a Nuxt app (Auth Part 2)](https://jagr.co/posts/adding-register-and-login-flows-using-aws-amplify-in-a-nuxt-app), [Jagr](https://jagr.co/posts/adding-register-and-login-flows-using-aws-amplify-in-a-nuxt-app) / [YouTube](https://www.youtube.com/watch?v=Q4eaOQCWCJk&list=PL9dIWiKCV573u7FUcj6bF1vwunYFEDA6Y&index=4&t=0s) 13 | - [x] [How to add an anotated GraphQL API with public and private auth guards](https://jagr.co/posts/how-to-add-a-public-and-private-graphql-api-with-aws-amplify), [Jagr](https://jagr.co/posts/how-to-add-a-public-and-private-graphql-api-with-aws-amplify) / [YouTube](https://www.youtube.com/watch?v=WMtF4Gk3cD4) 14 | - [x] [How to deploy our application via Amplify CLI on S3](https://jagr.co/posts/amplify-nuxt-how-to-deploy-to-amplify-as-an-spa), [Jagr](https://jagr.co/posts/amplify-nuxt-how-to-deploy-to-amplify-as-an-spa) / [YouTube](https://www.youtube.com/watch?v=tcsJaRyiC0A&list=PL9dIWiKCV573u7FUcj6bF1vwunYFEDA6Y&index=6) 15 | - [x] [How to deploy our application for production](https://jagr.co/posts/amplify-nuxt-how-to-setup-a-production-deployment), [Jagr](https://jagr.co/posts/amplify-nuxt-how-to-setup-a-production-deployment) / [YouTube](https://www.youtube.com/watch?v=jvwOQBcJdI4&list=PL9dIWiKCV573u7FUcj6bF1vwunYFEDA6Y&index=7) 16 | - [x] [How to use a custom domain in AWS Amplify](https://jagr.co/posts/how-to-use-a-custom-domain-in-aws-amplify-with-route53), [Jagr](https://jagr.co/posts/how-to-use-a-custom-domain-in-aws-amplify-with-route53) / [YouTube](https://www.youtube.com/watch?v=gldpw-WNbrU&list=PL9dIWiKCV573u7FUcj6bF1vwunYFEDA6Y&index=8) 17 | 18 | ### When Cloning 19 | 20 | If you should happen to clone down this repository you'll need to configure the project with your project's Amplify details. To do so, run the below command in your terminal and walk through the configuration steps/questions. 21 | 22 | This will pull down the amplify directory in addition to generating your `aws-exports.js` file. 23 | 24 | ``` 25 | $ amplify pull 26 | ``` 27 | 28 | ### Find Us 29 | 30 | - WebSite: https://jagr.co 31 | - YouTube: https://youtube.com/jagrco 32 | - Twitter: https://twitter.com/jagr_co 33 | --------------------------------------------------------------------------------