├── .gitattributes ├── src ├── playground.ts ├── resolvers │ ├── resolvers.ts │ ├── Query │ │ └── index.ts │ └── Mutation │ │ └── index.ts ├── schema │ └── schema.graphql ├── graphql.ts └── generated │ ├── schema.graphql │ └── prisma.ts ├── typings └── typings.d.ts ├── config └── webpack │ └── profile.js ├── .travis.yml ├── database ├── datamodel.graphql ├── seed.graphql └── prisma.yml ├── .env.example ├── .graphqlconfig.yml ├── tslint.json ├── Dockerfile ├── tsconfig.json ├── .babelrc ├── .gitignore ├── Makefile ├── README.md ├── webpack.config.js ├── package.json └── serverless.yml /.gitattributes: -------------------------------------------------------------------------------- 1 | yarn.lock binary 2 | -------------------------------------------------------------------------------- /src/playground.ts: -------------------------------------------------------------------------------- 1 | import GraphQLPlayground from 'graphql-playground-middleware-lambda' 2 | export const handler = GraphQLPlayground({ endpoint: '/' }) 3 | -------------------------------------------------------------------------------- /src/resolvers/resolvers.ts: -------------------------------------------------------------------------------- 1 | import Mutation from './Mutation' 2 | import Query from './Query' 3 | 4 | export default { 5 | Mutation, 6 | Query 7 | } 8 | -------------------------------------------------------------------------------- /typings/typings.d.ts: -------------------------------------------------------------------------------- 1 | declare module '*.json' { 2 | const content: any 3 | export default content 4 | } 5 | 6 | declare module '*.graphql' { 7 | const content: any 8 | export default content 9 | } 10 | -------------------------------------------------------------------------------- /config/webpack/profile.js: -------------------------------------------------------------------------------- 1 | const config = require('../../webpack.config') 2 | 3 | module.exports = Object.assign({}, config, { 4 | entry: { 5 | 'src/graphql': './src/graphql.ts', 6 | 'src/playground': './src/playground.ts' 7 | } 8 | }) 9 | -------------------------------------------------------------------------------- /src/schema/schema.graphql: -------------------------------------------------------------------------------- 1 | # import Post from 'src/generated/schema.graphql' 2 | 3 | type Query { 4 | node: Boolean 5 | feed: [Post!]! 6 | } 7 | 8 | type Mutation { 9 | ping(id: String!): String 10 | } 11 | 12 | type schema { 13 | query: Query 14 | mutation: Mutation 15 | } 16 | -------------------------------------------------------------------------------- /src/resolvers/Query/index.ts: -------------------------------------------------------------------------------- 1 | import { Prisma } from '../../generated/prisma' 2 | 3 | export default { 4 | node: () => { 5 | return true 6 | }, 7 | feed: (parent, args, ctx: { prisma: Prisma }, info) => { 8 | console.log(info) 9 | return ctx.prisma.query.posts({ where: { isPublished: true } }, info) 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/resolvers/Mutation/index.ts: -------------------------------------------------------------------------------- 1 | // https://medium.freecodecamp.org/how-to-reverse-a-string-in-javascript-in-3-different-ways-75e4763c68cb 2 | function reverse (str) { 3 | return (str === '') ? '' : reverse(str.substr(1)) + str.charAt(0) 4 | } 5 | 6 | export default { 7 | ping (_, { id }) { 8 | return reverse(id) 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | dist: trusty 3 | language: node_js 4 | node_js: 5 | - "10" 6 | 7 | cache: 8 | yarn: true 9 | directories: 10 | - node_modules 11 | 12 | before_install: 13 | - curl -o- -L https://yarnpkg.com/install.sh | bash 14 | - export PATH="$HOME/.yarn/bin:$PATH" 15 | 16 | install: 17 | - yarn 18 | 19 | script: 20 | - yarn tsc 21 | - yarn build 22 | -------------------------------------------------------------------------------- /database/datamodel.graphql: -------------------------------------------------------------------------------- 1 | type Post { 2 | id: ID! @unique 3 | createdAt: DateTime! 4 | updatedAt: DateTime! 5 | isPublished: Boolean! @default(value: "false") 6 | title: String! 7 | text: String! 8 | author: User! 9 | } 10 | 11 | type User { 12 | id: ID! @unique 13 | email: String! @unique 14 | password: String! 15 | name: String! 16 | posts: [Post!]! 17 | } 18 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | AWS_ACCESS_KEY_ID=<> 2 | AWS_SECRET_ACCESS_KEY=<> 3 | 4 | ARTIFACTS_BUCKET=<> 5 | 6 | API_DOMAIN_NAME=<> 7 | API_HOSTED_ZONE=<> 8 | API_SSL_CERT_ARN=<> 9 | 10 | PRISMA_DEBUG=false 11 | PRISMA_ENDPOINT=<> 12 | PRISMA_SECRET=<> 13 | PRISMA_SERVICE=<> 14 | PRISMA_STAGE=dev 15 | -------------------------------------------------------------------------------- /.graphqlconfig.yml: -------------------------------------------------------------------------------- 1 | projects: 2 | app: 3 | schemaPath: src/schema.graphql 4 | extensions: 5 | endpoints: 6 | default: http://localhost:4000 7 | database: 8 | schemaPath: src/generated/schema.graphql 9 | extensions: 10 | prisma: database/prisma.yml 11 | codegen: 12 | - generator: prisma-binding 13 | language: typescript 14 | output: 15 | binding: src/generated/prisma.ts 16 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "tslint-config-standard" 4 | ], 5 | "rules": { 6 | "await-promise": false, 7 | "no-floating-promises": false, 8 | "no-implicit-dependencies": false, 9 | "no-unnecessary-qualifier": false, 10 | "no-unnecessary-type-assertion": false, 11 | "no-unused-variable": false, 12 | "no-use-before-declare": false, 13 | "return-undefined": false, 14 | "strict-type-predicates": false 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:latest@sha256:737b3a051de3db388aac1d4ef2e7cf6b96e6dcceb3e1f700c01e8c250d7d5500 2 | 3 | # install the latest version of yarn 4 | RUN curl -o- -L https://yarnpkg.com/install.sh | bash 5 | ENV PATH /root/.yarn/bin:/root/.config/yarn/global/node_modules/.bin:$PATH 6 | 7 | # install global node modules 8 | RUN yarn global add graphql prisma 9 | 10 | # check versions 11 | RUN yarn --version 12 | RUN prisma --version 13 | 14 | # expose development ports 15 | EXPOSE 4000:4000 16 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "emitDecoratorMetadata": true, 4 | "experimentalDecorators": true, 5 | "lib": [ 6 | "dom", 7 | "esnext" 8 | ], 9 | "module": "commonjs", 10 | "moduleResolution": "node", 11 | "noEmit": true, 12 | "pretty": true, 13 | "skipLibCheck": true, 14 | "target": "esnext", 15 | }, 16 | "include": [ 17 | "src/**/*", 18 | "typings/**/*" 19 | ], 20 | "exclude": [ 21 | "node_modules" 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "development": { 4 | "plugins": [ 5 | ["module-resolver", { "extensions": [".ts"], "root": ["./src"] }] 6 | ], 7 | "presets": [ 8 | ["@babel/env", { "targets": { "node": "8.10" }}], 9 | ["@babel/typescript"] 10 | ] 11 | }, 12 | "production": { 13 | "plugins": [ 14 | ["module-resolver", { "extensions": [".ts"], "root": ["./src"] }] 15 | ], 16 | "presets": [ 17 | ["@babel/env", { "targets": { "node": "8.10" }}], 18 | ["@babel/typescript"] 19 | ] 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /database/seed.graphql: -------------------------------------------------------------------------------- 1 | mutation { 2 | createUser(data: { 3 | email: "developer@example.com" 4 | password: "$2a$10$hACwQ5/HQI6FhbIISOUVeusy3sKyUDhSq36fF5d/54aAdiygJPFzm" # plaintext password: "nooneknows" 5 | name: "Sarah" 6 | posts: { 7 | create: [{ 8 | title: "Hello World" 9 | text: "This is my first blog post ever!" 10 | isPublished: true 11 | }, { 12 | title: "My Second Post" 13 | text: "My first post was good, but this one is better!" 14 | isPublished: true 15 | }, { 16 | title: "Solving World Hunger" 17 | text: "This is a draft..." 18 | isPublished: false 19 | }] 20 | } 21 | }) { 22 | id 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/graphql.ts: -------------------------------------------------------------------------------- 1 | import { GraphQLServerLambda } from 'graphql-yoga' 2 | import { Prisma } from './generated/prisma' 3 | import resolvers from './resolvers/resolvers' 4 | import typeDefs from './schema/schema.graphql' 5 | 6 | export const handler = (event, ctx, callback) => { 7 | try { 8 | const server = new GraphQLServerLambda({ 9 | context: (ctx: { prisma: Prisma }) => ({ 10 | ...ctx, 11 | prisma: new Prisma({ 12 | debug: process.env.PRISMA_DEBUG === 'true', 13 | endpoint: process.env.PRISMA_ENDPOINT, 14 | secret: process.env.PRISMA_SECRET 15 | }) 16 | }), 17 | resolvers, 18 | typeDefs 19 | }) 20 | 21 | server.graphqlHandler(event, ctx, (error, output) => { 22 | callback(error, { ...output, statusCode: 200 }) 23 | }) 24 | } catch (exception) { 25 | console.log(exception) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /database/prisma.yml: -------------------------------------------------------------------------------- 1 | # The endpoint of your Prisma API (deployed to a Prisma Sandbox). 2 | endpoint: ${env:PRISMA_ENDPOINT} 3 | 4 | # The file containing the definition of your data model. 5 | datamodel: datamodel.graphql 6 | 7 | # Seed your service with initial data based on `seed.graphql`. 8 | seed: 9 | import: seed.graphql 10 | 11 | # Download the GraphQL schema of the Prisma API into 12 | # `src/generated/prisma.graphql` (as specfied in `.graphqlconfig.yml`). 13 | # Then generate the corresponding TypeScript definitions into 14 | # `src/generated/prisma.ts` (also specfied in `.graphqlconfig.yml`) 15 | # with `graphql codegen` . 16 | hooks: 17 | post-deploy: 18 | - graphql get-schema --project database 19 | - graphql codegen 20 | 21 | # If specified, the `secret` must be used to generate a JWT which is attached 22 | # to the `Authorization` header of HTTP requests made against the Prisma API. 23 | # Info: https://www.prisma.io/docs/reference/prisma-api/concepts-utee3eiquo#authentication 24 | secret: ${env:PRISMA_SECRET} 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | 8 | # Runtime data 9 | pids 10 | *.pid 11 | *.seed 12 | *.pid.lock 13 | 14 | # Directory for instrumented libs generated by jscoverage/JSCover 15 | lib-cov 16 | 17 | # Coverage directory used by tools like istanbul 18 | coverage 19 | 20 | # nyc test coverage 21 | .nyc_output 22 | 23 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 24 | .grunt 25 | 26 | # Bower dependency directory (https://bower.io/) 27 | bower_components 28 | 29 | # node-waf configuration 30 | .lock-wscript 31 | 32 | # Compiled binary addons (http://nodejs.org/api/addons.html) 33 | build/Release 34 | 35 | # Dependency directories 36 | node_modules/ 37 | jspm_packages/ 38 | 39 | # Optional npm cache directory 40 | .npm 41 | 42 | # Optional eslint cache 43 | .eslintcache 44 | 45 | # Optional REPL history 46 | .node_repl_history 47 | 48 | # Output of 'npm pack' 49 | *.tgz 50 | 51 | # Yarn Integrity file 52 | .yarn-integrity 53 | 54 | # dotenv environment variables file 55 | .env 56 | .env.* 57 | !.env.example 58 | 59 | .DS_Store 60 | 61 | .serverless 62 | .webpack 63 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Load the environment variables 2 | ifdef ENV 3 | export ENV_FILE = .env.$(ENV) 4 | else 5 | export ENV_FILE = .env 6 | endif 7 | 8 | # Include the envionment variables in this Makefile 9 | include $(ENV_FILE) 10 | 11 | CONTAINER_NAME = serverless-prisma/devbox 12 | NODE_CONTAINER = \ 13 | --env-file $(ENV_FILE) \ 14 | --interactive \ 15 | --rm \ 16 | --tty \ 17 | --volume $(shell pwd):/var/task \ 18 | --workdir /var/task \ 19 | $(CONTAINER_NAME) 20 | 21 | devbox: 22 | @docker build --no-cache --tag $(CONTAINER_NAME) . 23 | 24 | install: 25 | @docker run $(NODE_CONTAINER) yarn install 26 | 27 | dev: 28 | @docker run $(NODE_CONTAINER) /bin/bash 29 | 30 | build: 31 | @docker run $(NODE_CONTAINER) yarn build 32 | 33 | start: 34 | @docker run --publish 4000:4000 $(NODE_CONTAINER) yarn start 35 | 36 | hard-start: 37 | rm -rf node_modules 38 | rm -f yarn.lock 39 | make devbox 40 | make install 41 | make start 42 | 43 | deploy: 44 | @make deploy-prisma 45 | @make deploy-api 46 | 47 | deploy-api: 48 | @docker run $(NODE_CONTAINER) yarn run deploy:api:$(ENV) 49 | 50 | deploy-prisma: 51 | @docker run $(NODE_CONTAINER) yarn run deploy:prisma:$(ENV) 52 | 53 | profile: 54 | @docker run $(NODE_CONTAINER) yarn run profile 55 | 56 | tsc: 57 | @docker run $(NODE_CONTAINER) yarn run tsc 58 | 59 | tslint: 60 | @docker run $(NODE_CONTAINER) yarn run tslint 61 | 62 | tslint-fix: 63 | @docker run $(NODE_CONTAINER) yarn run tslint-fix 64 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Serverless Prisma 2 | 3 | [![Build Status](https://travis-ci.org/jgeschwendt/serverless-prisma.svg?branch=master)](https://travis-ci.org/jgeschwendt/serverless-prisma) 4 | 5 | **[Archived]** — New projects should consider using [Prisma2](https://www.prisma.io/blog/announcing-prisma-2-zq1s745db8i5#getting-started-with-prisma-2) 6 | 7 | Minimal Serverless + Prisma Project Template 8 | 9 | ## Getting Started 10 | 11 | - Be sure to have `Docker` and `Make` installed on your machine. `Docker` is used for maintaining a consistent development/deployment environment; `Make` is used to shorten frequently used `Docker` commands. 12 | 13 | - Create an `.env` file for your local machine (refer to `~/.env.example` for the configuration requirements) 14 | 15 | - Create Environment configurations for deployments, ie. `.env.dev`, `.env.prod`, alternatively this can be configured in your CI/CD. 16 | 17 | ```console 18 | 19 | # Create a Node Development Docker Container 20 | 21 | make devbox 22 | 23 | 24 | # Install Node Dependencies using the DevBox Container 25 | 26 | make install 27 | 28 | 29 | # Start Serverless in Offline Mode 30 | 31 | make start 32 | 33 | 34 | # Package Service for Deployment 35 | 36 | make build 37 | 38 | 39 | # Deploy to a specific Environment 40 | 41 | ENV=dev make deploy # uses the configuration from `.env.dev` 42 | 43 | ENV=prod make deploy # uses the configuration from `.env.prod` 44 | 45 | ``` 46 | 47 | The complete command list can be viewed in the `~/Makefile` 48 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | const CircularDependencyPlugin = require('circular-dependency-plugin') 2 | const path = require('path') 3 | const slsw = require('serverless-webpack') 4 | const webpack = require('webpack') 5 | const nodeExternals = require('webpack-node-externals') 6 | 7 | module.exports = { 8 | mode: slsw.lib.webpack.isLocal ? 'development' : 'production', 9 | devtool: 'source-map', 10 | target: 'node', 11 | entry: slsw.lib.entries, 12 | externals: [nodeExternals()], 13 | output: { 14 | filename: '[name].js', 15 | libraryTarget: 'commonjs', 16 | path: path.resolve(__dirname, '.webpack'), 17 | }, 18 | module: { 19 | rules: [ 20 | { 21 | enforce: 'pre', 22 | exclude: /(node_modules|src\/generated)/, 23 | test: /\.ts$/, 24 | use: [ 25 | { loader: 'tslint-loader' }, 26 | ] 27 | }, 28 | { 29 | exclude: /node_modules/, 30 | test: /\.ts$/, 31 | use: [ 32 | { loader: 'imports-loader', options: { graphql: true } }, 33 | { loader: 'babel-loader' }, 34 | ], 35 | }, 36 | { 37 | exclude: /node_modules/, 38 | test: /\.graphql$/, 39 | use: [ 40 | { 41 | loader: 'graphql-import-loader', 42 | }, 43 | ] 44 | }, 45 | ], 46 | }, 47 | plugins: [ 48 | new webpack.NamedModulesPlugin(), 49 | new webpack.NoEmitOnErrorsPlugin(), 50 | new CircularDependencyPlugin({ exclude: /node_modules/, failOnError: false }), 51 | ], 52 | resolve: { 53 | extensions: [ 54 | '.graphql', 55 | '.js', 56 | '.ts', 57 | ] 58 | }, 59 | } 60 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "serverless-prisma", 3 | "version": "0.1.0", 4 | "description": "Serverless Prisma", 5 | "main": "handler.ts", 6 | "repository": "git@github.com:jgeschwendt/serverless-prisma.git", 7 | "author": "jlg ", 8 | "license": "MIT", 9 | "private": true, 10 | "scripts": { 11 | "build": "BABEL_ENV=production NODE_ENV=production sls package", 12 | "prisma:login": "prisma login", 13 | "deploy:api:dev": "tsc && BABEL_ENV=production NODE_ENV=production sls deploy --stage dev", 14 | "deploy:api:prod": "tsc && BABEL_ENV=production NODE_ENV=production sls deploy --stage prod", 15 | "deploy:prisma:dev": "prisma deploy --stage dev", 16 | "deploy:prisma:prod": "prisma deploy --stage prod", 17 | "profile": "webpack --config config/webpack/profile.js --profile --json > .webpack/stats.json && webpack-bundle-analyzer .webpack/stats.json .webpack --mode static --no-open --report .webpack/report.html", 18 | "start": "BABEL_ENV=development NODE_ENV=development sls offline --dontPrintOutput --host 0.0.0.0 --port 4000", 19 | "tsc": "tsc --project tsconfig.json", 20 | "tslint": "tslint --exclude src/generated/prisma.ts --project tsconfig.json", 21 | "tslint-fix": "tslint --exclude src/generated/prisma.ts --fix --project tsconfig.json" 22 | }, 23 | "resolutions": { 24 | "graphql": "14.6.0" 25 | }, 26 | "dependencies": { 27 | "aws-lambda": "0.1.2", 28 | "graphql": "14.6.0", 29 | "graphql-playground-middleware-lambda": "1.7.13", 30 | "graphql-tag": "2.10.2", 31 | "graphql-yoga": "1.18.3", 32 | "node-fetch": "2.6.0", 33 | "prisma-binding": "2.3.16" 34 | }, 35 | "devDependencies": { 36 | "@babel/core": "7.8.7", 37 | "@babel/preset-env": "7.8.7", 38 | "@babel/preset-typescript": "7.8.3", 39 | "aws-sdk": "2.639.0", 40 | "babel-loader": "8.0.6", 41 | "babel-plugin-module-resolver": "3.2.0", 42 | "circular-dependency-plugin": "5.2.0", 43 | "graphql-import": "0.7.1", 44 | "graphql-import-loader": "0.2.1", 45 | "imports-loader": "0.8.0", 46 | "jest": "24.9.0", 47 | "npm-run-all": "4.1.5", 48 | "prisma": "1.34.10", 49 | "serverless": "1.66.0", 50 | "serverless-offline": "5.12.1", 51 | "serverless-webpack": "5.3.1", 52 | "tslint": "5.20.1", 53 | "tslint-config-standard": "8.0.1", 54 | "tslint-loader": "3.6.0", 55 | "typescript": "3.8.3", 56 | "webpack": "4.42.0", 57 | "webpack-bundle-analyzer": "3.6.1", 58 | "webpack-cli": "3.3.11", 59 | "webpack-node-externals": "1.7.2" 60 | }, 61 | "peerDependencies": { 62 | "aws-sdk": "*" 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /serverless.yml: -------------------------------------------------------------------------------- 1 | service: serverless-prisma 2 | 3 | frameworkVersion: '>=1.9.0 <2.0.0' 4 | 5 | custom: 6 | stage: ${opt:stage, self:provider.stage} 7 | webpack: 8 | includeModules: true 9 | packager: yarn 10 | webpackConfig: ./webpack.config.js 11 | 12 | package: 13 | individually: true 14 | 15 | plugins: 16 | - serverless-webpack 17 | - serverless-offline 18 | 19 | provider: 20 | name: aws 21 | region: us-east-1 22 | runtime: nodejs8.10 23 | deploymentBucket: ${env:ARTIFACTS_BUCKET} 24 | environment: 25 | PRISMA_DEBUG: ${env:PRISMA_DEBUG} 26 | PRISMA_ENDPOINT: ${env:PRISMA_ENDPOINT} 27 | PRISMA_SECRET: ${env:PRISMA_SECRET} 28 | PRISMA_SERVICE: ${env:PRISMA_SERVICE} 29 | 30 | functions: 31 | graphql: 32 | name: serverless-prisma-${self:custom.stage} 33 | handler: src/graphql.handler 34 | events: 35 | - http: 36 | cors: true 37 | integration: lambda-proxy 38 | method: get 39 | path: / 40 | - http: 41 | cors: true 42 | integration: lambda-proxy 43 | method: post 44 | path: / 45 | playground: 46 | name: serverless-prisma-playground-${self:custom.stage} 47 | handler: src/playground.handler 48 | events: 49 | - http: 50 | cors: true 51 | integration: lambda-proxy 52 | method: get 53 | path: /playground 54 | 55 | resources: 56 | Resources: 57 | ApiGatewayBasePathMapping: 58 | DependsOn: ApiGatewayDomainName 59 | Type: AWS::ApiGateway::BasePathMapping 60 | Properties: 61 | BasePath: '' 62 | DomainName: ${env:API_DOMAIN_NAME} 63 | RestApiId: 64 | Ref: ApiGatewayRestApi # created by serverless, check the stack's resources 65 | Stage: ${self:custom.stage} 66 | 67 | ApiGatewayDomainName: 68 | Type: AWS::ApiGateway::DomainName 69 | Properties: 70 | CertificateArn: ${env:API_SSL_CERT_ARN} 71 | DomainName: ${env:API_DOMAIN_NAME} 72 | 73 | ApiGatewayRecordSetGroup: 74 | Type: AWS::Route53::RecordSetGroup 75 | Properties: 76 | HostedZoneName: ${env:API_HOSTED_ZONE}. 77 | RecordSets: 78 | - Name: ${env:API_DOMAIN_NAME}. 79 | Type: A 80 | AliasTarget: 81 | DNSName: {'Fn::GetAtt': ApiGatewayDomainName.DistributionDomainName} 82 | HostedZoneId: Z2FDTNDATAQYW2 83 | - Name: ${env:API_DOMAIN_NAME}. 84 | Type: AAAA 85 | AliasTarget: 86 | DNSName: {'Fn::GetAtt': ApiGatewayDomainName.DistributionDomainName} 87 | HostedZoneId: Z2FDTNDATAQYW2 88 | -------------------------------------------------------------------------------- /src/generated/schema.graphql: -------------------------------------------------------------------------------- 1 | # source: https://us1.prisma.sh/joshua-geschwendt/serverless-prisma-dev/dev 2 | # timestamp: Mon Jun 04 2018 19:39:57 GMT-0400 (EDT) 3 | 4 | type AggregatePost { 5 | count: Int! 6 | } 7 | 8 | type AggregateUser { 9 | count: Int! 10 | } 11 | 12 | type BatchPayload { 13 | """The number of nodes that have been affected by the Batch operation.""" 14 | count: Long! 15 | } 16 | 17 | scalar DateTime 18 | 19 | """ 20 | The `Long` scalar type represents non-fractional signed whole numeric values. 21 | Long can represent values between -(2^63) and 2^63 - 1. 22 | """ 23 | scalar Long 24 | 25 | type Mutation { 26 | createPost(data: PostCreateInput!): Post! 27 | createUser(data: UserCreateInput!): User! 28 | updatePost(data: PostUpdateInput!, where: PostWhereUniqueInput!): Post 29 | updateUser(data: UserUpdateInput!, where: UserWhereUniqueInput!): User 30 | deletePost(where: PostWhereUniqueInput!): Post 31 | deleteUser(where: UserWhereUniqueInput!): User 32 | upsertPost(where: PostWhereUniqueInput!, create: PostCreateInput!, update: PostUpdateInput!): Post! 33 | upsertUser(where: UserWhereUniqueInput!, create: UserCreateInput!, update: UserUpdateInput!): User! 34 | updateManyPosts(data: PostUpdateInput!, where: PostWhereInput): BatchPayload! 35 | updateManyUsers(data: UserUpdateInput!, where: UserWhereInput): BatchPayload! 36 | deleteManyPosts(where: PostWhereInput): BatchPayload! 37 | deleteManyUsers(where: UserWhereInput): BatchPayload! 38 | } 39 | 40 | enum MutationType { 41 | CREATED 42 | UPDATED 43 | DELETED 44 | } 45 | 46 | """An object with an ID""" 47 | interface Node { 48 | """The id of the object.""" 49 | id: ID! 50 | } 51 | 52 | """Information about pagination in a connection.""" 53 | type PageInfo { 54 | """When paginating forwards, are there more items?""" 55 | hasNextPage: Boolean! 56 | 57 | """When paginating backwards, are there more items?""" 58 | hasPreviousPage: Boolean! 59 | 60 | """When paginating backwards, the cursor to continue.""" 61 | startCursor: String 62 | 63 | """When paginating forwards, the cursor to continue.""" 64 | endCursor: String 65 | } 66 | 67 | type Post implements Node { 68 | id: ID! 69 | createdAt: DateTime! 70 | updatedAt: DateTime! 71 | isPublished: Boolean! 72 | title: String! 73 | text: String! 74 | author(where: UserWhereInput): User! 75 | } 76 | 77 | """A connection to a list of items.""" 78 | type PostConnection { 79 | """Information to aid in pagination.""" 80 | pageInfo: PageInfo! 81 | 82 | """A list of edges.""" 83 | edges: [PostEdge]! 84 | aggregate: AggregatePost! 85 | } 86 | 87 | input PostCreateInput { 88 | isPublished: Boolean 89 | title: String! 90 | text: String! 91 | author: UserCreateOneWithoutPostsInput! 92 | } 93 | 94 | input PostCreateManyWithoutAuthorInput { 95 | create: [PostCreateWithoutAuthorInput!] 96 | connect: [PostWhereUniqueInput!] 97 | } 98 | 99 | input PostCreateWithoutAuthorInput { 100 | isPublished: Boolean 101 | title: String! 102 | text: String! 103 | } 104 | 105 | """An edge in a connection.""" 106 | type PostEdge { 107 | """The item at the end of the edge.""" 108 | node: Post! 109 | 110 | """A cursor for use in pagination.""" 111 | cursor: String! 112 | } 113 | 114 | enum PostOrderByInput { 115 | id_ASC 116 | id_DESC 117 | createdAt_ASC 118 | createdAt_DESC 119 | updatedAt_ASC 120 | updatedAt_DESC 121 | isPublished_ASC 122 | isPublished_DESC 123 | title_ASC 124 | title_DESC 125 | text_ASC 126 | text_DESC 127 | } 128 | 129 | type PostPreviousValues { 130 | id: ID! 131 | createdAt: DateTime! 132 | updatedAt: DateTime! 133 | isPublished: Boolean! 134 | title: String! 135 | text: String! 136 | } 137 | 138 | type PostSubscriptionPayload { 139 | mutation: MutationType! 140 | node: Post 141 | updatedFields: [String!] 142 | previousValues: PostPreviousValues 143 | } 144 | 145 | input PostSubscriptionWhereInput { 146 | """Logical AND on all given filters.""" 147 | AND: [PostSubscriptionWhereInput!] 148 | 149 | """Logical OR on all given filters.""" 150 | OR: [PostSubscriptionWhereInput!] 151 | 152 | """Logical NOT on all given filters combined by AND.""" 153 | NOT: [PostSubscriptionWhereInput!] 154 | 155 | """ 156 | The subscription event gets dispatched when it's listed in mutation_in 157 | """ 158 | mutation_in: [MutationType!] 159 | 160 | """ 161 | The subscription event gets only dispatched when one of the updated fields names is included in this list 162 | """ 163 | updatedFields_contains: String 164 | 165 | """ 166 | The subscription event gets only dispatched when all of the field names included in this list have been updated 167 | """ 168 | updatedFields_contains_every: [String!] 169 | 170 | """ 171 | The subscription event gets only dispatched when some of the field names included in this list have been updated 172 | """ 173 | updatedFields_contains_some: [String!] 174 | node: PostWhereInput 175 | } 176 | 177 | input PostUpdateInput { 178 | isPublished: Boolean 179 | title: String 180 | text: String 181 | author: UserUpdateOneWithoutPostsInput 182 | } 183 | 184 | input PostUpdateManyWithoutAuthorInput { 185 | create: [PostCreateWithoutAuthorInput!] 186 | connect: [PostWhereUniqueInput!] 187 | disconnect: [PostWhereUniqueInput!] 188 | delete: [PostWhereUniqueInput!] 189 | update: [PostUpdateWithWhereUniqueWithoutAuthorInput!] 190 | upsert: [PostUpsertWithWhereUniqueWithoutAuthorInput!] 191 | } 192 | 193 | input PostUpdateWithoutAuthorDataInput { 194 | isPublished: Boolean 195 | title: String 196 | text: String 197 | } 198 | 199 | input PostUpdateWithWhereUniqueWithoutAuthorInput { 200 | where: PostWhereUniqueInput! 201 | data: PostUpdateWithoutAuthorDataInput! 202 | } 203 | 204 | input PostUpsertWithWhereUniqueWithoutAuthorInput { 205 | where: PostWhereUniqueInput! 206 | update: PostUpdateWithoutAuthorDataInput! 207 | create: PostCreateWithoutAuthorInput! 208 | } 209 | 210 | input PostWhereInput { 211 | """Logical AND on all given filters.""" 212 | AND: [PostWhereInput!] 213 | 214 | """Logical OR on all given filters.""" 215 | OR: [PostWhereInput!] 216 | 217 | """Logical NOT on all given filters combined by AND.""" 218 | NOT: [PostWhereInput!] 219 | id: ID 220 | 221 | """All values that are not equal to given value.""" 222 | id_not: ID 223 | 224 | """All values that are contained in given list.""" 225 | id_in: [ID!] 226 | 227 | """All values that are not contained in given list.""" 228 | id_not_in: [ID!] 229 | 230 | """All values less than the given value.""" 231 | id_lt: ID 232 | 233 | """All values less than or equal the given value.""" 234 | id_lte: ID 235 | 236 | """All values greater than the given value.""" 237 | id_gt: ID 238 | 239 | """All values greater than or equal the given value.""" 240 | id_gte: ID 241 | 242 | """All values containing the given string.""" 243 | id_contains: ID 244 | 245 | """All values not containing the given string.""" 246 | id_not_contains: ID 247 | 248 | """All values starting with the given string.""" 249 | id_starts_with: ID 250 | 251 | """All values not starting with the given string.""" 252 | id_not_starts_with: ID 253 | 254 | """All values ending with the given string.""" 255 | id_ends_with: ID 256 | 257 | """All values not ending with the given string.""" 258 | id_not_ends_with: ID 259 | createdAt: DateTime 260 | 261 | """All values that are not equal to given value.""" 262 | createdAt_not: DateTime 263 | 264 | """All values that are contained in given list.""" 265 | createdAt_in: [DateTime!] 266 | 267 | """All values that are not contained in given list.""" 268 | createdAt_not_in: [DateTime!] 269 | 270 | """All values less than the given value.""" 271 | createdAt_lt: DateTime 272 | 273 | """All values less than or equal the given value.""" 274 | createdAt_lte: DateTime 275 | 276 | """All values greater than the given value.""" 277 | createdAt_gt: DateTime 278 | 279 | """All values greater than or equal the given value.""" 280 | createdAt_gte: DateTime 281 | updatedAt: DateTime 282 | 283 | """All values that are not equal to given value.""" 284 | updatedAt_not: DateTime 285 | 286 | """All values that are contained in given list.""" 287 | updatedAt_in: [DateTime!] 288 | 289 | """All values that are not contained in given list.""" 290 | updatedAt_not_in: [DateTime!] 291 | 292 | """All values less than the given value.""" 293 | updatedAt_lt: DateTime 294 | 295 | """All values less than or equal the given value.""" 296 | updatedAt_lte: DateTime 297 | 298 | """All values greater than the given value.""" 299 | updatedAt_gt: DateTime 300 | 301 | """All values greater than or equal the given value.""" 302 | updatedAt_gte: DateTime 303 | isPublished: Boolean 304 | 305 | """All values that are not equal to given value.""" 306 | isPublished_not: Boolean 307 | title: String 308 | 309 | """All values that are not equal to given value.""" 310 | title_not: String 311 | 312 | """All values that are contained in given list.""" 313 | title_in: [String!] 314 | 315 | """All values that are not contained in given list.""" 316 | title_not_in: [String!] 317 | 318 | """All values less than the given value.""" 319 | title_lt: String 320 | 321 | """All values less than or equal the given value.""" 322 | title_lte: String 323 | 324 | """All values greater than the given value.""" 325 | title_gt: String 326 | 327 | """All values greater than or equal the given value.""" 328 | title_gte: String 329 | 330 | """All values containing the given string.""" 331 | title_contains: String 332 | 333 | """All values not containing the given string.""" 334 | title_not_contains: String 335 | 336 | """All values starting with the given string.""" 337 | title_starts_with: String 338 | 339 | """All values not starting with the given string.""" 340 | title_not_starts_with: String 341 | 342 | """All values ending with the given string.""" 343 | title_ends_with: String 344 | 345 | """All values not ending with the given string.""" 346 | title_not_ends_with: String 347 | text: String 348 | 349 | """All values that are not equal to given value.""" 350 | text_not: String 351 | 352 | """All values that are contained in given list.""" 353 | text_in: [String!] 354 | 355 | """All values that are not contained in given list.""" 356 | text_not_in: [String!] 357 | 358 | """All values less than the given value.""" 359 | text_lt: String 360 | 361 | """All values less than or equal the given value.""" 362 | text_lte: String 363 | 364 | """All values greater than the given value.""" 365 | text_gt: String 366 | 367 | """All values greater than or equal the given value.""" 368 | text_gte: String 369 | 370 | """All values containing the given string.""" 371 | text_contains: String 372 | 373 | """All values not containing the given string.""" 374 | text_not_contains: String 375 | 376 | """All values starting with the given string.""" 377 | text_starts_with: String 378 | 379 | """All values not starting with the given string.""" 380 | text_not_starts_with: String 381 | 382 | """All values ending with the given string.""" 383 | text_ends_with: String 384 | 385 | """All values not ending with the given string.""" 386 | text_not_ends_with: String 387 | author: UserWhereInput 388 | } 389 | 390 | input PostWhereUniqueInput { 391 | id: ID 392 | } 393 | 394 | type Query { 395 | posts(where: PostWhereInput, orderBy: PostOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Post]! 396 | users(where: UserWhereInput, orderBy: UserOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [User]! 397 | post(where: PostWhereUniqueInput!): Post 398 | user(where: UserWhereUniqueInput!): User 399 | postsConnection(where: PostWhereInput, orderBy: PostOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): PostConnection! 400 | usersConnection(where: UserWhereInput, orderBy: UserOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): UserConnection! 401 | 402 | """Fetches an object given its ID""" 403 | node( 404 | """The ID of an object""" 405 | id: ID! 406 | ): Node 407 | } 408 | 409 | type Subscription { 410 | post(where: PostSubscriptionWhereInput): PostSubscriptionPayload 411 | user(where: UserSubscriptionWhereInput): UserSubscriptionPayload 412 | } 413 | 414 | type User implements Node { 415 | id: ID! 416 | email: String! 417 | password: String! 418 | name: String! 419 | posts(where: PostWhereInput, orderBy: PostOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Post!] 420 | } 421 | 422 | """A connection to a list of items.""" 423 | type UserConnection { 424 | """Information to aid in pagination.""" 425 | pageInfo: PageInfo! 426 | 427 | """A list of edges.""" 428 | edges: [UserEdge]! 429 | aggregate: AggregateUser! 430 | } 431 | 432 | input UserCreateInput { 433 | email: String! 434 | password: String! 435 | name: String! 436 | posts: PostCreateManyWithoutAuthorInput 437 | } 438 | 439 | input UserCreateOneWithoutPostsInput { 440 | create: UserCreateWithoutPostsInput 441 | connect: UserWhereUniqueInput 442 | } 443 | 444 | input UserCreateWithoutPostsInput { 445 | email: String! 446 | password: String! 447 | name: String! 448 | } 449 | 450 | """An edge in a connection.""" 451 | type UserEdge { 452 | """The item at the end of the edge.""" 453 | node: User! 454 | 455 | """A cursor for use in pagination.""" 456 | cursor: String! 457 | } 458 | 459 | enum UserOrderByInput { 460 | id_ASC 461 | id_DESC 462 | email_ASC 463 | email_DESC 464 | password_ASC 465 | password_DESC 466 | name_ASC 467 | name_DESC 468 | updatedAt_ASC 469 | updatedAt_DESC 470 | createdAt_ASC 471 | createdAt_DESC 472 | } 473 | 474 | type UserPreviousValues { 475 | id: ID! 476 | email: String! 477 | password: String! 478 | name: String! 479 | } 480 | 481 | type UserSubscriptionPayload { 482 | mutation: MutationType! 483 | node: User 484 | updatedFields: [String!] 485 | previousValues: UserPreviousValues 486 | } 487 | 488 | input UserSubscriptionWhereInput { 489 | """Logical AND on all given filters.""" 490 | AND: [UserSubscriptionWhereInput!] 491 | 492 | """Logical OR on all given filters.""" 493 | OR: [UserSubscriptionWhereInput!] 494 | 495 | """Logical NOT on all given filters combined by AND.""" 496 | NOT: [UserSubscriptionWhereInput!] 497 | 498 | """ 499 | The subscription event gets dispatched when it's listed in mutation_in 500 | """ 501 | mutation_in: [MutationType!] 502 | 503 | """ 504 | The subscription event gets only dispatched when one of the updated fields names is included in this list 505 | """ 506 | updatedFields_contains: String 507 | 508 | """ 509 | The subscription event gets only dispatched when all of the field names included in this list have been updated 510 | """ 511 | updatedFields_contains_every: [String!] 512 | 513 | """ 514 | The subscription event gets only dispatched when some of the field names included in this list have been updated 515 | """ 516 | updatedFields_contains_some: [String!] 517 | node: UserWhereInput 518 | } 519 | 520 | input UserUpdateInput { 521 | email: String 522 | password: String 523 | name: String 524 | posts: PostUpdateManyWithoutAuthorInput 525 | } 526 | 527 | input UserUpdateOneWithoutPostsInput { 528 | create: UserCreateWithoutPostsInput 529 | connect: UserWhereUniqueInput 530 | delete: Boolean 531 | update: UserUpdateWithoutPostsDataInput 532 | upsert: UserUpsertWithoutPostsInput 533 | } 534 | 535 | input UserUpdateWithoutPostsDataInput { 536 | email: String 537 | password: String 538 | name: String 539 | } 540 | 541 | input UserUpsertWithoutPostsInput { 542 | update: UserUpdateWithoutPostsDataInput! 543 | create: UserCreateWithoutPostsInput! 544 | } 545 | 546 | input UserWhereInput { 547 | """Logical AND on all given filters.""" 548 | AND: [UserWhereInput!] 549 | 550 | """Logical OR on all given filters.""" 551 | OR: [UserWhereInput!] 552 | 553 | """Logical NOT on all given filters combined by AND.""" 554 | NOT: [UserWhereInput!] 555 | id: ID 556 | 557 | """All values that are not equal to given value.""" 558 | id_not: ID 559 | 560 | """All values that are contained in given list.""" 561 | id_in: [ID!] 562 | 563 | """All values that are not contained in given list.""" 564 | id_not_in: [ID!] 565 | 566 | """All values less than the given value.""" 567 | id_lt: ID 568 | 569 | """All values less than or equal the given value.""" 570 | id_lte: ID 571 | 572 | """All values greater than the given value.""" 573 | id_gt: ID 574 | 575 | """All values greater than or equal the given value.""" 576 | id_gte: ID 577 | 578 | """All values containing the given string.""" 579 | id_contains: ID 580 | 581 | """All values not containing the given string.""" 582 | id_not_contains: ID 583 | 584 | """All values starting with the given string.""" 585 | id_starts_with: ID 586 | 587 | """All values not starting with the given string.""" 588 | id_not_starts_with: ID 589 | 590 | """All values ending with the given string.""" 591 | id_ends_with: ID 592 | 593 | """All values not ending with the given string.""" 594 | id_not_ends_with: ID 595 | email: String 596 | 597 | """All values that are not equal to given value.""" 598 | email_not: String 599 | 600 | """All values that are contained in given list.""" 601 | email_in: [String!] 602 | 603 | """All values that are not contained in given list.""" 604 | email_not_in: [String!] 605 | 606 | """All values less than the given value.""" 607 | email_lt: String 608 | 609 | """All values less than or equal the given value.""" 610 | email_lte: String 611 | 612 | """All values greater than the given value.""" 613 | email_gt: String 614 | 615 | """All values greater than or equal the given value.""" 616 | email_gte: String 617 | 618 | """All values containing the given string.""" 619 | email_contains: String 620 | 621 | """All values not containing the given string.""" 622 | email_not_contains: String 623 | 624 | """All values starting with the given string.""" 625 | email_starts_with: String 626 | 627 | """All values not starting with the given string.""" 628 | email_not_starts_with: String 629 | 630 | """All values ending with the given string.""" 631 | email_ends_with: String 632 | 633 | """All values not ending with the given string.""" 634 | email_not_ends_with: String 635 | password: String 636 | 637 | """All values that are not equal to given value.""" 638 | password_not: String 639 | 640 | """All values that are contained in given list.""" 641 | password_in: [String!] 642 | 643 | """All values that are not contained in given list.""" 644 | password_not_in: [String!] 645 | 646 | """All values less than the given value.""" 647 | password_lt: String 648 | 649 | """All values less than or equal the given value.""" 650 | password_lte: String 651 | 652 | """All values greater than the given value.""" 653 | password_gt: String 654 | 655 | """All values greater than or equal the given value.""" 656 | password_gte: String 657 | 658 | """All values containing the given string.""" 659 | password_contains: String 660 | 661 | """All values not containing the given string.""" 662 | password_not_contains: String 663 | 664 | """All values starting with the given string.""" 665 | password_starts_with: String 666 | 667 | """All values not starting with the given string.""" 668 | password_not_starts_with: String 669 | 670 | """All values ending with the given string.""" 671 | password_ends_with: String 672 | 673 | """All values not ending with the given string.""" 674 | password_not_ends_with: String 675 | name: String 676 | 677 | """All values that are not equal to given value.""" 678 | name_not: String 679 | 680 | """All values that are contained in given list.""" 681 | name_in: [String!] 682 | 683 | """All values that are not contained in given list.""" 684 | name_not_in: [String!] 685 | 686 | """All values less than the given value.""" 687 | name_lt: String 688 | 689 | """All values less than or equal the given value.""" 690 | name_lte: String 691 | 692 | """All values greater than the given value.""" 693 | name_gt: String 694 | 695 | """All values greater than or equal the given value.""" 696 | name_gte: String 697 | 698 | """All values containing the given string.""" 699 | name_contains: String 700 | 701 | """All values not containing the given string.""" 702 | name_not_contains: String 703 | 704 | """All values starting with the given string.""" 705 | name_starts_with: String 706 | 707 | """All values not starting with the given string.""" 708 | name_not_starts_with: String 709 | 710 | """All values ending with the given string.""" 711 | name_ends_with: String 712 | 713 | """All values not ending with the given string.""" 714 | name_not_ends_with: String 715 | posts_every: PostWhereInput 716 | posts_some: PostWhereInput 717 | posts_none: PostWhereInput 718 | } 719 | 720 | input UserWhereUniqueInput { 721 | id: ID 722 | email: String 723 | } 724 | -------------------------------------------------------------------------------- /src/generated/prisma.ts: -------------------------------------------------------------------------------- 1 | import { GraphQLResolveInfo, GraphQLSchema } from 'graphql' 2 | import { IResolvers } from 'graphql-tools/dist/Interfaces' 3 | import { Options } from 'graphql-binding' 4 | import { makePrismaBindingClass, BasePrismaOptions } from 'prisma-binding' 5 | 6 | export interface Query { 7 | posts: (args: { where?: PostWhereInput, orderBy?: PostOrderByInput, skip?: Int, after?: String, before?: String, first?: Int, last?: Int }, info?: GraphQLResolveInfo | string, options?: Options) => Promise , 8 | users: (args: { where?: UserWhereInput, orderBy?: UserOrderByInput, skip?: Int, after?: String, before?: String, first?: Int, last?: Int }, info?: GraphQLResolveInfo | string, options?: Options) => Promise , 9 | post: (args: { where: PostWhereUniqueInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise , 10 | user: (args: { where: UserWhereUniqueInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise , 11 | postsConnection: (args: { where?: PostWhereInput, orderBy?: PostOrderByInput, skip?: Int, after?: String, before?: String, first?: Int, last?: Int }, info?: GraphQLResolveInfo | string, options?: Options) => Promise , 12 | usersConnection: (args: { where?: UserWhereInput, orderBy?: UserOrderByInput, skip?: Int, after?: String, before?: String, first?: Int, last?: Int }, info?: GraphQLResolveInfo | string, options?: Options) => Promise , 13 | node: (args: { id: ID_Output }, info?: GraphQLResolveInfo | string, options?: Options) => Promise 14 | } 15 | 16 | export interface Mutation { 17 | createPost: (args: { data: PostCreateInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise , 18 | createUser: (args: { data: UserCreateInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise , 19 | updatePost: (args: { data: PostUpdateInput, where: PostWhereUniqueInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise , 20 | updateUser: (args: { data: UserUpdateInput, where: UserWhereUniqueInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise , 21 | deletePost: (args: { where: PostWhereUniqueInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise , 22 | deleteUser: (args: { where: UserWhereUniqueInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise , 23 | upsertPost: (args: { where: PostWhereUniqueInput, create: PostCreateInput, update: PostUpdateInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise , 24 | upsertUser: (args: { where: UserWhereUniqueInput, create: UserCreateInput, update: UserUpdateInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise , 25 | updateManyPosts: (args: { data: PostUpdateInput, where?: PostWhereInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise , 26 | updateManyUsers: (args: { data: UserUpdateInput, where?: UserWhereInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise , 27 | deleteManyPosts: (args: { where?: PostWhereInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise , 28 | deleteManyUsers: (args: { where?: UserWhereInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise 29 | } 30 | 31 | export interface Subscription { 32 | post: (args: { where?: PostSubscriptionWhereInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise> , 33 | user: (args: { where?: UserSubscriptionWhereInput }, info?: GraphQLResolveInfo | string, options?: Options) => Promise> 34 | } 35 | 36 | export interface Exists { 37 | Post: (where?: PostWhereInput) => Promise 38 | User: (where?: UserWhereInput) => Promise 39 | } 40 | 41 | export interface Prisma { 42 | query: Query 43 | mutation: Mutation 44 | subscription: Subscription 45 | exists: Exists 46 | request: (query: string, variables?: {[key: string]: any}) => Promise 47 | delegate(operation: 'query' | 'mutation', fieldName: string, args: { 48 | [key: string]: any; 49 | }, infoOrQuery?: GraphQLResolveInfo | string, options?: Options): Promise; 50 | delegateSubscription(fieldName: string, args?: { 51 | [key: string]: any; 52 | }, infoOrQuery?: GraphQLResolveInfo | string, options?: Options): Promise>; 53 | getAbstractResolvers(filterSchema?: GraphQLSchema | string): IResolvers; 54 | } 55 | 56 | export interface BindingConstructor { 57 | new(options: BasePrismaOptions): T 58 | } 59 | /** 60 | * Type Defs 61 | */ 62 | 63 | const typeDefs = `type AggregatePost { 64 | count: Int! 65 | } 66 | 67 | type AggregateUser { 68 | count: Int! 69 | } 70 | 71 | type BatchPayload { 72 | """The number of nodes that have been affected by the Batch operation.""" 73 | count: Long! 74 | } 75 | 76 | scalar DateTime 77 | 78 | """ 79 | The \`Long\` scalar type represents non-fractional signed whole numeric values. 80 | Long can represent values between -(2^63) and 2^63 - 1. 81 | """ 82 | scalar Long 83 | 84 | type Mutation { 85 | createPost(data: PostCreateInput!): Post! 86 | createUser(data: UserCreateInput!): User! 87 | updatePost(data: PostUpdateInput!, where: PostWhereUniqueInput!): Post 88 | updateUser(data: UserUpdateInput!, where: UserWhereUniqueInput!): User 89 | deletePost(where: PostWhereUniqueInput!): Post 90 | deleteUser(where: UserWhereUniqueInput!): User 91 | upsertPost(where: PostWhereUniqueInput!, create: PostCreateInput!, update: PostUpdateInput!): Post! 92 | upsertUser(where: UserWhereUniqueInput!, create: UserCreateInput!, update: UserUpdateInput!): User! 93 | updateManyPosts(data: PostUpdateInput!, where: PostWhereInput): BatchPayload! 94 | updateManyUsers(data: UserUpdateInput!, where: UserWhereInput): BatchPayload! 95 | deleteManyPosts(where: PostWhereInput): BatchPayload! 96 | deleteManyUsers(where: UserWhereInput): BatchPayload! 97 | } 98 | 99 | enum MutationType { 100 | CREATED 101 | UPDATED 102 | DELETED 103 | } 104 | 105 | """An object with an ID""" 106 | interface Node { 107 | """The id of the object.""" 108 | id: ID! 109 | } 110 | 111 | """Information about pagination in a connection.""" 112 | type PageInfo { 113 | """When paginating forwards, are there more items?""" 114 | hasNextPage: Boolean! 115 | 116 | """When paginating backwards, are there more items?""" 117 | hasPreviousPage: Boolean! 118 | 119 | """When paginating backwards, the cursor to continue.""" 120 | startCursor: String 121 | 122 | """When paginating forwards, the cursor to continue.""" 123 | endCursor: String 124 | } 125 | 126 | type Post implements Node { 127 | id: ID! 128 | createdAt: DateTime! 129 | updatedAt: DateTime! 130 | isPublished: Boolean! 131 | title: String! 132 | text: String! 133 | author(where: UserWhereInput): User! 134 | } 135 | 136 | """A connection to a list of items.""" 137 | type PostConnection { 138 | """Information to aid in pagination.""" 139 | pageInfo: PageInfo! 140 | 141 | """A list of edges.""" 142 | edges: [PostEdge]! 143 | aggregate: AggregatePost! 144 | } 145 | 146 | input PostCreateInput { 147 | isPublished: Boolean 148 | title: String! 149 | text: String! 150 | author: UserCreateOneWithoutPostsInput! 151 | } 152 | 153 | input PostCreateManyWithoutAuthorInput { 154 | create: [PostCreateWithoutAuthorInput!] 155 | connect: [PostWhereUniqueInput!] 156 | } 157 | 158 | input PostCreateWithoutAuthorInput { 159 | isPublished: Boolean 160 | title: String! 161 | text: String! 162 | } 163 | 164 | """An edge in a connection.""" 165 | type PostEdge { 166 | """The item at the end of the edge.""" 167 | node: Post! 168 | 169 | """A cursor for use in pagination.""" 170 | cursor: String! 171 | } 172 | 173 | enum PostOrderByInput { 174 | id_ASC 175 | id_DESC 176 | createdAt_ASC 177 | createdAt_DESC 178 | updatedAt_ASC 179 | updatedAt_DESC 180 | isPublished_ASC 181 | isPublished_DESC 182 | title_ASC 183 | title_DESC 184 | text_ASC 185 | text_DESC 186 | } 187 | 188 | type PostPreviousValues { 189 | id: ID! 190 | createdAt: DateTime! 191 | updatedAt: DateTime! 192 | isPublished: Boolean! 193 | title: String! 194 | text: String! 195 | } 196 | 197 | type PostSubscriptionPayload { 198 | mutation: MutationType! 199 | node: Post 200 | updatedFields: [String!] 201 | previousValues: PostPreviousValues 202 | } 203 | 204 | input PostSubscriptionWhereInput { 205 | """Logical AND on all given filters.""" 206 | AND: [PostSubscriptionWhereInput!] 207 | 208 | """Logical OR on all given filters.""" 209 | OR: [PostSubscriptionWhereInput!] 210 | 211 | """Logical NOT on all given filters combined by AND.""" 212 | NOT: [PostSubscriptionWhereInput!] 213 | 214 | """ 215 | The subscription event gets dispatched when it's listed in mutation_in 216 | """ 217 | mutation_in: [MutationType!] 218 | 219 | """ 220 | The subscription event gets only dispatched when one of the updated fields names is included in this list 221 | """ 222 | updatedFields_contains: String 223 | 224 | """ 225 | The subscription event gets only dispatched when all of the field names included in this list have been updated 226 | """ 227 | updatedFields_contains_every: [String!] 228 | 229 | """ 230 | The subscription event gets only dispatched when some of the field names included in this list have been updated 231 | """ 232 | updatedFields_contains_some: [String!] 233 | node: PostWhereInput 234 | } 235 | 236 | input PostUpdateInput { 237 | isPublished: Boolean 238 | title: String 239 | text: String 240 | author: UserUpdateOneWithoutPostsInput 241 | } 242 | 243 | input PostUpdateManyWithoutAuthorInput { 244 | create: [PostCreateWithoutAuthorInput!] 245 | connect: [PostWhereUniqueInput!] 246 | disconnect: [PostWhereUniqueInput!] 247 | delete: [PostWhereUniqueInput!] 248 | update: [PostUpdateWithWhereUniqueWithoutAuthorInput!] 249 | upsert: [PostUpsertWithWhereUniqueWithoutAuthorInput!] 250 | } 251 | 252 | input PostUpdateWithoutAuthorDataInput { 253 | isPublished: Boolean 254 | title: String 255 | text: String 256 | } 257 | 258 | input PostUpdateWithWhereUniqueWithoutAuthorInput { 259 | where: PostWhereUniqueInput! 260 | data: PostUpdateWithoutAuthorDataInput! 261 | } 262 | 263 | input PostUpsertWithWhereUniqueWithoutAuthorInput { 264 | where: PostWhereUniqueInput! 265 | update: PostUpdateWithoutAuthorDataInput! 266 | create: PostCreateWithoutAuthorInput! 267 | } 268 | 269 | input PostWhereInput { 270 | """Logical AND on all given filters.""" 271 | AND: [PostWhereInput!] 272 | 273 | """Logical OR on all given filters.""" 274 | OR: [PostWhereInput!] 275 | 276 | """Logical NOT on all given filters combined by AND.""" 277 | NOT: [PostWhereInput!] 278 | id: ID 279 | 280 | """All values that are not equal to given value.""" 281 | id_not: ID 282 | 283 | """All values that are contained in given list.""" 284 | id_in: [ID!] 285 | 286 | """All values that are not contained in given list.""" 287 | id_not_in: [ID!] 288 | 289 | """All values less than the given value.""" 290 | id_lt: ID 291 | 292 | """All values less than or equal the given value.""" 293 | id_lte: ID 294 | 295 | """All values greater than the given value.""" 296 | id_gt: ID 297 | 298 | """All values greater than or equal the given value.""" 299 | id_gte: ID 300 | 301 | """All values containing the given string.""" 302 | id_contains: ID 303 | 304 | """All values not containing the given string.""" 305 | id_not_contains: ID 306 | 307 | """All values starting with the given string.""" 308 | id_starts_with: ID 309 | 310 | """All values not starting with the given string.""" 311 | id_not_starts_with: ID 312 | 313 | """All values ending with the given string.""" 314 | id_ends_with: ID 315 | 316 | """All values not ending with the given string.""" 317 | id_not_ends_with: ID 318 | createdAt: DateTime 319 | 320 | """All values that are not equal to given value.""" 321 | createdAt_not: DateTime 322 | 323 | """All values that are contained in given list.""" 324 | createdAt_in: [DateTime!] 325 | 326 | """All values that are not contained in given list.""" 327 | createdAt_not_in: [DateTime!] 328 | 329 | """All values less than the given value.""" 330 | createdAt_lt: DateTime 331 | 332 | """All values less than or equal the given value.""" 333 | createdAt_lte: DateTime 334 | 335 | """All values greater than the given value.""" 336 | createdAt_gt: DateTime 337 | 338 | """All values greater than or equal the given value.""" 339 | createdAt_gte: DateTime 340 | updatedAt: DateTime 341 | 342 | """All values that are not equal to given value.""" 343 | updatedAt_not: DateTime 344 | 345 | """All values that are contained in given list.""" 346 | updatedAt_in: [DateTime!] 347 | 348 | """All values that are not contained in given list.""" 349 | updatedAt_not_in: [DateTime!] 350 | 351 | """All values less than the given value.""" 352 | updatedAt_lt: DateTime 353 | 354 | """All values less than or equal the given value.""" 355 | updatedAt_lte: DateTime 356 | 357 | """All values greater than the given value.""" 358 | updatedAt_gt: DateTime 359 | 360 | """All values greater than or equal the given value.""" 361 | updatedAt_gte: DateTime 362 | isPublished: Boolean 363 | 364 | """All values that are not equal to given value.""" 365 | isPublished_not: Boolean 366 | title: String 367 | 368 | """All values that are not equal to given value.""" 369 | title_not: String 370 | 371 | """All values that are contained in given list.""" 372 | title_in: [String!] 373 | 374 | """All values that are not contained in given list.""" 375 | title_not_in: [String!] 376 | 377 | """All values less than the given value.""" 378 | title_lt: String 379 | 380 | """All values less than or equal the given value.""" 381 | title_lte: String 382 | 383 | """All values greater than the given value.""" 384 | title_gt: String 385 | 386 | """All values greater than or equal the given value.""" 387 | title_gte: String 388 | 389 | """All values containing the given string.""" 390 | title_contains: String 391 | 392 | """All values not containing the given string.""" 393 | title_not_contains: String 394 | 395 | """All values starting with the given string.""" 396 | title_starts_with: String 397 | 398 | """All values not starting with the given string.""" 399 | title_not_starts_with: String 400 | 401 | """All values ending with the given string.""" 402 | title_ends_with: String 403 | 404 | """All values not ending with the given string.""" 405 | title_not_ends_with: String 406 | text: String 407 | 408 | """All values that are not equal to given value.""" 409 | text_not: String 410 | 411 | """All values that are contained in given list.""" 412 | text_in: [String!] 413 | 414 | """All values that are not contained in given list.""" 415 | text_not_in: [String!] 416 | 417 | """All values less than the given value.""" 418 | text_lt: String 419 | 420 | """All values less than or equal the given value.""" 421 | text_lte: String 422 | 423 | """All values greater than the given value.""" 424 | text_gt: String 425 | 426 | """All values greater than or equal the given value.""" 427 | text_gte: String 428 | 429 | """All values containing the given string.""" 430 | text_contains: String 431 | 432 | """All values not containing the given string.""" 433 | text_not_contains: String 434 | 435 | """All values starting with the given string.""" 436 | text_starts_with: String 437 | 438 | """All values not starting with the given string.""" 439 | text_not_starts_with: String 440 | 441 | """All values ending with the given string.""" 442 | text_ends_with: String 443 | 444 | """All values not ending with the given string.""" 445 | text_not_ends_with: String 446 | author: UserWhereInput 447 | } 448 | 449 | input PostWhereUniqueInput { 450 | id: ID 451 | } 452 | 453 | type Query { 454 | posts(where: PostWhereInput, orderBy: PostOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Post]! 455 | users(where: UserWhereInput, orderBy: UserOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [User]! 456 | post(where: PostWhereUniqueInput!): Post 457 | user(where: UserWhereUniqueInput!): User 458 | postsConnection(where: PostWhereInput, orderBy: PostOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): PostConnection! 459 | usersConnection(where: UserWhereInput, orderBy: UserOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): UserConnection! 460 | 461 | """Fetches an object given its ID""" 462 | node( 463 | """The ID of an object""" 464 | id: ID! 465 | ): Node 466 | } 467 | 468 | type Subscription { 469 | post(where: PostSubscriptionWhereInput): PostSubscriptionPayload 470 | user(where: UserSubscriptionWhereInput): UserSubscriptionPayload 471 | } 472 | 473 | type User implements Node { 474 | id: ID! 475 | email: String! 476 | password: String! 477 | name: String! 478 | posts(where: PostWhereInput, orderBy: PostOrderByInput, skip: Int, after: String, before: String, first: Int, last: Int): [Post!] 479 | } 480 | 481 | """A connection to a list of items.""" 482 | type UserConnection { 483 | """Information to aid in pagination.""" 484 | pageInfo: PageInfo! 485 | 486 | """A list of edges.""" 487 | edges: [UserEdge]! 488 | aggregate: AggregateUser! 489 | } 490 | 491 | input UserCreateInput { 492 | email: String! 493 | password: String! 494 | name: String! 495 | posts: PostCreateManyWithoutAuthorInput 496 | } 497 | 498 | input UserCreateOneWithoutPostsInput { 499 | create: UserCreateWithoutPostsInput 500 | connect: UserWhereUniqueInput 501 | } 502 | 503 | input UserCreateWithoutPostsInput { 504 | email: String! 505 | password: String! 506 | name: String! 507 | } 508 | 509 | """An edge in a connection.""" 510 | type UserEdge { 511 | """The item at the end of the edge.""" 512 | node: User! 513 | 514 | """A cursor for use in pagination.""" 515 | cursor: String! 516 | } 517 | 518 | enum UserOrderByInput { 519 | id_ASC 520 | id_DESC 521 | email_ASC 522 | email_DESC 523 | password_ASC 524 | password_DESC 525 | name_ASC 526 | name_DESC 527 | updatedAt_ASC 528 | updatedAt_DESC 529 | createdAt_ASC 530 | createdAt_DESC 531 | } 532 | 533 | type UserPreviousValues { 534 | id: ID! 535 | email: String! 536 | password: String! 537 | name: String! 538 | } 539 | 540 | type UserSubscriptionPayload { 541 | mutation: MutationType! 542 | node: User 543 | updatedFields: [String!] 544 | previousValues: UserPreviousValues 545 | } 546 | 547 | input UserSubscriptionWhereInput { 548 | """Logical AND on all given filters.""" 549 | AND: [UserSubscriptionWhereInput!] 550 | 551 | """Logical OR on all given filters.""" 552 | OR: [UserSubscriptionWhereInput!] 553 | 554 | """Logical NOT on all given filters combined by AND.""" 555 | NOT: [UserSubscriptionWhereInput!] 556 | 557 | """ 558 | The subscription event gets dispatched when it's listed in mutation_in 559 | """ 560 | mutation_in: [MutationType!] 561 | 562 | """ 563 | The subscription event gets only dispatched when one of the updated fields names is included in this list 564 | """ 565 | updatedFields_contains: String 566 | 567 | """ 568 | The subscription event gets only dispatched when all of the field names included in this list have been updated 569 | """ 570 | updatedFields_contains_every: [String!] 571 | 572 | """ 573 | The subscription event gets only dispatched when some of the field names included in this list have been updated 574 | """ 575 | updatedFields_contains_some: [String!] 576 | node: UserWhereInput 577 | } 578 | 579 | input UserUpdateInput { 580 | email: String 581 | password: String 582 | name: String 583 | posts: PostUpdateManyWithoutAuthorInput 584 | } 585 | 586 | input UserUpdateOneWithoutPostsInput { 587 | create: UserCreateWithoutPostsInput 588 | connect: UserWhereUniqueInput 589 | delete: Boolean 590 | update: UserUpdateWithoutPostsDataInput 591 | upsert: UserUpsertWithoutPostsInput 592 | } 593 | 594 | input UserUpdateWithoutPostsDataInput { 595 | email: String 596 | password: String 597 | name: String 598 | } 599 | 600 | input UserUpsertWithoutPostsInput { 601 | update: UserUpdateWithoutPostsDataInput! 602 | create: UserCreateWithoutPostsInput! 603 | } 604 | 605 | input UserWhereInput { 606 | """Logical AND on all given filters.""" 607 | AND: [UserWhereInput!] 608 | 609 | """Logical OR on all given filters.""" 610 | OR: [UserWhereInput!] 611 | 612 | """Logical NOT on all given filters combined by AND.""" 613 | NOT: [UserWhereInput!] 614 | id: ID 615 | 616 | """All values that are not equal to given value.""" 617 | id_not: ID 618 | 619 | """All values that are contained in given list.""" 620 | id_in: [ID!] 621 | 622 | """All values that are not contained in given list.""" 623 | id_not_in: [ID!] 624 | 625 | """All values less than the given value.""" 626 | id_lt: ID 627 | 628 | """All values less than or equal the given value.""" 629 | id_lte: ID 630 | 631 | """All values greater than the given value.""" 632 | id_gt: ID 633 | 634 | """All values greater than or equal the given value.""" 635 | id_gte: ID 636 | 637 | """All values containing the given string.""" 638 | id_contains: ID 639 | 640 | """All values not containing the given string.""" 641 | id_not_contains: ID 642 | 643 | """All values starting with the given string.""" 644 | id_starts_with: ID 645 | 646 | """All values not starting with the given string.""" 647 | id_not_starts_with: ID 648 | 649 | """All values ending with the given string.""" 650 | id_ends_with: ID 651 | 652 | """All values not ending with the given string.""" 653 | id_not_ends_with: ID 654 | email: String 655 | 656 | """All values that are not equal to given value.""" 657 | email_not: String 658 | 659 | """All values that are contained in given list.""" 660 | email_in: [String!] 661 | 662 | """All values that are not contained in given list.""" 663 | email_not_in: [String!] 664 | 665 | """All values less than the given value.""" 666 | email_lt: String 667 | 668 | """All values less than or equal the given value.""" 669 | email_lte: String 670 | 671 | """All values greater than the given value.""" 672 | email_gt: String 673 | 674 | """All values greater than or equal the given value.""" 675 | email_gte: String 676 | 677 | """All values containing the given string.""" 678 | email_contains: String 679 | 680 | """All values not containing the given string.""" 681 | email_not_contains: String 682 | 683 | """All values starting with the given string.""" 684 | email_starts_with: String 685 | 686 | """All values not starting with the given string.""" 687 | email_not_starts_with: String 688 | 689 | """All values ending with the given string.""" 690 | email_ends_with: String 691 | 692 | """All values not ending with the given string.""" 693 | email_not_ends_with: String 694 | password: String 695 | 696 | """All values that are not equal to given value.""" 697 | password_not: String 698 | 699 | """All values that are contained in given list.""" 700 | password_in: [String!] 701 | 702 | """All values that are not contained in given list.""" 703 | password_not_in: [String!] 704 | 705 | """All values less than the given value.""" 706 | password_lt: String 707 | 708 | """All values less than or equal the given value.""" 709 | password_lte: String 710 | 711 | """All values greater than the given value.""" 712 | password_gt: String 713 | 714 | """All values greater than or equal the given value.""" 715 | password_gte: String 716 | 717 | """All values containing the given string.""" 718 | password_contains: String 719 | 720 | """All values not containing the given string.""" 721 | password_not_contains: String 722 | 723 | """All values starting with the given string.""" 724 | password_starts_with: String 725 | 726 | """All values not starting with the given string.""" 727 | password_not_starts_with: String 728 | 729 | """All values ending with the given string.""" 730 | password_ends_with: String 731 | 732 | """All values not ending with the given string.""" 733 | password_not_ends_with: String 734 | name: String 735 | 736 | """All values that are not equal to given value.""" 737 | name_not: String 738 | 739 | """All values that are contained in given list.""" 740 | name_in: [String!] 741 | 742 | """All values that are not contained in given list.""" 743 | name_not_in: [String!] 744 | 745 | """All values less than the given value.""" 746 | name_lt: String 747 | 748 | """All values less than or equal the given value.""" 749 | name_lte: String 750 | 751 | """All values greater than the given value.""" 752 | name_gt: String 753 | 754 | """All values greater than or equal the given value.""" 755 | name_gte: String 756 | 757 | """All values containing the given string.""" 758 | name_contains: String 759 | 760 | """All values not containing the given string.""" 761 | name_not_contains: String 762 | 763 | """All values starting with the given string.""" 764 | name_starts_with: String 765 | 766 | """All values not starting with the given string.""" 767 | name_not_starts_with: String 768 | 769 | """All values ending with the given string.""" 770 | name_ends_with: String 771 | 772 | """All values not ending with the given string.""" 773 | name_not_ends_with: String 774 | posts_every: PostWhereInput 775 | posts_some: PostWhereInput 776 | posts_none: PostWhereInput 777 | } 778 | 779 | input UserWhereUniqueInput { 780 | id: ID 781 | email: String 782 | } 783 | ` 784 | 785 | export const Prisma = makePrismaBindingClass>({typeDefs}) 786 | 787 | /** 788 | * Types 789 | */ 790 | 791 | export type PostOrderByInput = 'id_ASC' | 792 | 'id_DESC' | 793 | 'createdAt_ASC' | 794 | 'createdAt_DESC' | 795 | 'updatedAt_ASC' | 796 | 'updatedAt_DESC' | 797 | 'isPublished_ASC' | 798 | 'isPublished_DESC' | 799 | 'title_ASC' | 800 | 'title_DESC' | 801 | 'text_ASC' | 802 | 'text_DESC' 803 | 804 | export type UserOrderByInput = 'id_ASC' | 805 | 'id_DESC' | 806 | 'email_ASC' | 807 | 'email_DESC' | 808 | 'password_ASC' | 809 | 'password_DESC' | 810 | 'name_ASC' | 811 | 'name_DESC' | 812 | 'updatedAt_ASC' | 813 | 'updatedAt_DESC' | 814 | 'createdAt_ASC' | 815 | 'createdAt_DESC' 816 | 817 | export type MutationType = 'CREATED' | 818 | 'UPDATED' | 819 | 'DELETED' 820 | 821 | export interface UserCreateOneWithoutPostsInput { 822 | create?: UserCreateWithoutPostsInput 823 | connect?: UserWhereUniqueInput 824 | } 825 | 826 | export interface PostWhereInput { 827 | AND?: PostWhereInput[] | PostWhereInput 828 | OR?: PostWhereInput[] | PostWhereInput 829 | NOT?: PostWhereInput[] | PostWhereInput 830 | id?: ID_Input 831 | id_not?: ID_Input 832 | id_in?: ID_Input[] | ID_Input 833 | id_not_in?: ID_Input[] | ID_Input 834 | id_lt?: ID_Input 835 | id_lte?: ID_Input 836 | id_gt?: ID_Input 837 | id_gte?: ID_Input 838 | id_contains?: ID_Input 839 | id_not_contains?: ID_Input 840 | id_starts_with?: ID_Input 841 | id_not_starts_with?: ID_Input 842 | id_ends_with?: ID_Input 843 | id_not_ends_with?: ID_Input 844 | createdAt?: DateTime 845 | createdAt_not?: DateTime 846 | createdAt_in?: DateTime[] | DateTime 847 | createdAt_not_in?: DateTime[] | DateTime 848 | createdAt_lt?: DateTime 849 | createdAt_lte?: DateTime 850 | createdAt_gt?: DateTime 851 | createdAt_gte?: DateTime 852 | updatedAt?: DateTime 853 | updatedAt_not?: DateTime 854 | updatedAt_in?: DateTime[] | DateTime 855 | updatedAt_not_in?: DateTime[] | DateTime 856 | updatedAt_lt?: DateTime 857 | updatedAt_lte?: DateTime 858 | updatedAt_gt?: DateTime 859 | updatedAt_gte?: DateTime 860 | isPublished?: Boolean 861 | isPublished_not?: Boolean 862 | title?: String 863 | title_not?: String 864 | title_in?: String[] | String 865 | title_not_in?: String[] | String 866 | title_lt?: String 867 | title_lte?: String 868 | title_gt?: String 869 | title_gte?: String 870 | title_contains?: String 871 | title_not_contains?: String 872 | title_starts_with?: String 873 | title_not_starts_with?: String 874 | title_ends_with?: String 875 | title_not_ends_with?: String 876 | text?: String 877 | text_not?: String 878 | text_in?: String[] | String 879 | text_not_in?: String[] | String 880 | text_lt?: String 881 | text_lte?: String 882 | text_gt?: String 883 | text_gte?: String 884 | text_contains?: String 885 | text_not_contains?: String 886 | text_starts_with?: String 887 | text_not_starts_with?: String 888 | text_ends_with?: String 889 | text_not_ends_with?: String 890 | author?: UserWhereInput 891 | } 892 | 893 | export interface PostCreateManyWithoutAuthorInput { 894 | create?: PostCreateWithoutAuthorInput[] | PostCreateWithoutAuthorInput 895 | connect?: PostWhereUniqueInput[] | PostWhereUniqueInput 896 | } 897 | 898 | export interface UserWhereInput { 899 | AND?: UserWhereInput[] | UserWhereInput 900 | OR?: UserWhereInput[] | UserWhereInput 901 | NOT?: UserWhereInput[] | UserWhereInput 902 | id?: ID_Input 903 | id_not?: ID_Input 904 | id_in?: ID_Input[] | ID_Input 905 | id_not_in?: ID_Input[] | ID_Input 906 | id_lt?: ID_Input 907 | id_lte?: ID_Input 908 | id_gt?: ID_Input 909 | id_gte?: ID_Input 910 | id_contains?: ID_Input 911 | id_not_contains?: ID_Input 912 | id_starts_with?: ID_Input 913 | id_not_starts_with?: ID_Input 914 | id_ends_with?: ID_Input 915 | id_not_ends_with?: ID_Input 916 | email?: String 917 | email_not?: String 918 | email_in?: String[] | String 919 | email_not_in?: String[] | String 920 | email_lt?: String 921 | email_lte?: String 922 | email_gt?: String 923 | email_gte?: String 924 | email_contains?: String 925 | email_not_contains?: String 926 | email_starts_with?: String 927 | email_not_starts_with?: String 928 | email_ends_with?: String 929 | email_not_ends_with?: String 930 | password?: String 931 | password_not?: String 932 | password_in?: String[] | String 933 | password_not_in?: String[] | String 934 | password_lt?: String 935 | password_lte?: String 936 | password_gt?: String 937 | password_gte?: String 938 | password_contains?: String 939 | password_not_contains?: String 940 | password_starts_with?: String 941 | password_not_starts_with?: String 942 | password_ends_with?: String 943 | password_not_ends_with?: String 944 | name?: String 945 | name_not?: String 946 | name_in?: String[] | String 947 | name_not_in?: String[] | String 948 | name_lt?: String 949 | name_lte?: String 950 | name_gt?: String 951 | name_gte?: String 952 | name_contains?: String 953 | name_not_contains?: String 954 | name_starts_with?: String 955 | name_not_starts_with?: String 956 | name_ends_with?: String 957 | name_not_ends_with?: String 958 | posts_every?: PostWhereInput 959 | posts_some?: PostWhereInput 960 | posts_none?: PostWhereInput 961 | } 962 | 963 | export interface PostUpdateManyWithoutAuthorInput { 964 | create?: PostCreateWithoutAuthorInput[] | PostCreateWithoutAuthorInput 965 | connect?: PostWhereUniqueInput[] | PostWhereUniqueInput 966 | disconnect?: PostWhereUniqueInput[] | PostWhereUniqueInput 967 | delete?: PostWhereUniqueInput[] | PostWhereUniqueInput 968 | update?: PostUpdateWithWhereUniqueWithoutAuthorInput[] | PostUpdateWithWhereUniqueWithoutAuthorInput 969 | upsert?: PostUpsertWithWhereUniqueWithoutAuthorInput[] | PostUpsertWithWhereUniqueWithoutAuthorInput 970 | } 971 | 972 | export interface PostUpdateInput { 973 | isPublished?: Boolean 974 | title?: String 975 | text?: String 976 | author?: UserUpdateOneWithoutPostsInput 977 | } 978 | 979 | export interface UserUpdateInput { 980 | email?: String 981 | password?: String 982 | name?: String 983 | posts?: PostUpdateManyWithoutAuthorInput 984 | } 985 | 986 | export interface PostCreateWithoutAuthorInput { 987 | isPublished?: Boolean 988 | title: String 989 | text: String 990 | } 991 | 992 | export interface UserUpsertWithoutPostsInput { 993 | update: UserUpdateWithoutPostsDataInput 994 | create: UserCreateWithoutPostsInput 995 | } 996 | 997 | export interface UserSubscriptionWhereInput { 998 | AND?: UserSubscriptionWhereInput[] | UserSubscriptionWhereInput 999 | OR?: UserSubscriptionWhereInput[] | UserSubscriptionWhereInput 1000 | NOT?: UserSubscriptionWhereInput[] | UserSubscriptionWhereInput 1001 | mutation_in?: MutationType[] | MutationType 1002 | updatedFields_contains?: String 1003 | updatedFields_contains_every?: String[] | String 1004 | updatedFields_contains_some?: String[] | String 1005 | node?: UserWhereInput 1006 | } 1007 | 1008 | export interface UserUpdateWithoutPostsDataInput { 1009 | email?: String 1010 | password?: String 1011 | name?: String 1012 | } 1013 | 1014 | export interface PostWhereUniqueInput { 1015 | id?: ID_Input 1016 | } 1017 | 1018 | export interface PostUpsertWithWhereUniqueWithoutAuthorInput { 1019 | where: PostWhereUniqueInput 1020 | update: PostUpdateWithoutAuthorDataInput 1021 | create: PostCreateWithoutAuthorInput 1022 | } 1023 | 1024 | export interface UserCreateInput { 1025 | email: String 1026 | password: String 1027 | name: String 1028 | posts?: PostCreateManyWithoutAuthorInput 1029 | } 1030 | 1031 | export interface UserCreateWithoutPostsInput { 1032 | email: String 1033 | password: String 1034 | name: String 1035 | } 1036 | 1037 | export interface UserUpdateOneWithoutPostsInput { 1038 | create?: UserCreateWithoutPostsInput 1039 | connect?: UserWhereUniqueInput 1040 | delete?: Boolean 1041 | update?: UserUpdateWithoutPostsDataInput 1042 | upsert?: UserUpsertWithoutPostsInput 1043 | } 1044 | 1045 | export interface PostCreateInput { 1046 | isPublished?: Boolean 1047 | title: String 1048 | text: String 1049 | author: UserCreateOneWithoutPostsInput 1050 | } 1051 | 1052 | export interface PostUpdateWithoutAuthorDataInput { 1053 | isPublished?: Boolean 1054 | title?: String 1055 | text?: String 1056 | } 1057 | 1058 | export interface UserWhereUniqueInput { 1059 | id?: ID_Input 1060 | email?: String 1061 | } 1062 | 1063 | export interface PostSubscriptionWhereInput { 1064 | AND?: PostSubscriptionWhereInput[] | PostSubscriptionWhereInput 1065 | OR?: PostSubscriptionWhereInput[] | PostSubscriptionWhereInput 1066 | NOT?: PostSubscriptionWhereInput[] | PostSubscriptionWhereInput 1067 | mutation_in?: MutationType[] | MutationType 1068 | updatedFields_contains?: String 1069 | updatedFields_contains_every?: String[] | String 1070 | updatedFields_contains_some?: String[] | String 1071 | node?: PostWhereInput 1072 | } 1073 | 1074 | export interface PostUpdateWithWhereUniqueWithoutAuthorInput { 1075 | where: PostWhereUniqueInput 1076 | data: PostUpdateWithoutAuthorDataInput 1077 | } 1078 | 1079 | /* 1080 | * An object with an ID 1081 | 1082 | */ 1083 | export interface Node { 1084 | id: ID_Output 1085 | } 1086 | 1087 | export interface UserPreviousValues { 1088 | id: ID_Output 1089 | email: String 1090 | password: String 1091 | name: String 1092 | } 1093 | 1094 | /* 1095 | * A connection to a list of items. 1096 | 1097 | */ 1098 | export interface PostConnection { 1099 | pageInfo: PageInfo 1100 | edges: PostEdge[] 1101 | aggregate: AggregatePost 1102 | } 1103 | 1104 | export interface Post extends Node { 1105 | id: ID_Output 1106 | createdAt: DateTime 1107 | updatedAt: DateTime 1108 | isPublished: Boolean 1109 | title: String 1110 | text: String 1111 | author: User 1112 | } 1113 | 1114 | /* 1115 | * Information about pagination in a connection. 1116 | 1117 | */ 1118 | export interface PageInfo { 1119 | hasNextPage: Boolean 1120 | hasPreviousPage: Boolean 1121 | startCursor?: String 1122 | endCursor?: String 1123 | } 1124 | 1125 | export interface PostSubscriptionPayload { 1126 | mutation: MutationType 1127 | node?: Post 1128 | updatedFields?: String[] 1129 | previousValues?: PostPreviousValues 1130 | } 1131 | 1132 | export interface BatchPayload { 1133 | count: Long 1134 | } 1135 | 1136 | export interface PostPreviousValues { 1137 | id: ID_Output 1138 | createdAt: DateTime 1139 | updatedAt: DateTime 1140 | isPublished: Boolean 1141 | title: String 1142 | text: String 1143 | } 1144 | 1145 | export interface User extends Node { 1146 | id: ID_Output 1147 | email: String 1148 | password: String 1149 | name: String 1150 | posts?: Post[] 1151 | } 1152 | 1153 | export interface AggregateUser { 1154 | count: Int 1155 | } 1156 | 1157 | export interface UserSubscriptionPayload { 1158 | mutation: MutationType 1159 | node?: User 1160 | updatedFields?: String[] 1161 | previousValues?: UserPreviousValues 1162 | } 1163 | 1164 | /* 1165 | * An edge in a connection. 1166 | 1167 | */ 1168 | export interface UserEdge { 1169 | node: User 1170 | cursor: String 1171 | } 1172 | 1173 | /* 1174 | * An edge in a connection. 1175 | 1176 | */ 1177 | export interface PostEdge { 1178 | node: Post 1179 | cursor: String 1180 | } 1181 | 1182 | export interface AggregatePost { 1183 | count: Int 1184 | } 1185 | 1186 | /* 1187 | * A connection to a list of items. 1188 | 1189 | */ 1190 | export interface UserConnection { 1191 | pageInfo: PageInfo 1192 | edges: UserEdge[] 1193 | aggregate: AggregateUser 1194 | } 1195 | 1196 | /* 1197 | The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. 1198 | */ 1199 | export type Int = number 1200 | 1201 | /* 1202 | The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `"4"`) or integer (such as `4`) input value will be accepted as an ID. 1203 | */ 1204 | export type ID_Input = string | number 1205 | export type ID_Output = string 1206 | 1207 | /* 1208 | The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text. 1209 | */ 1210 | export type String = string 1211 | 1212 | /* 1213 | The `Long` scalar type represents non-fractional signed whole numeric values. 1214 | Long can represent values between -(2^63) and 2^63 - 1. 1215 | */ 1216 | export type Long = string 1217 | 1218 | /* 1219 | The `Boolean` scalar type represents `true` or `false`. 1220 | */ 1221 | export type Boolean = boolean 1222 | 1223 | export type DateTime = Date | string --------------------------------------------------------------------------------