├── .autorc ├── .eslintrc.js ├── .gitignore ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── LICENSE ├── Naph.png ├── README.md ├── dist ├── example.06783b46.js ├── index.html └── node.1501a258.css ├── example ├── App.tsx ├── data.ts ├── index.html ├── index.tsx └── node.css ├── now.json ├── package-lock.json ├── package.json ├── src ├── .DS_Store ├── context.tsx ├── hooks │ ├── useClickAway.tsx │ └── util.ts ├── index.tsx ├── lib │ ├── Node.tsx │ ├── NodeField.tsx │ ├── NodeFields.tsx │ ├── SVGComponent.tsx │ ├── Spline.tsx │ ├── TrashIcon.tsx │ └── util.tsx └── types.ts └── tsconfig.json /.autorc: -------------------------------------------------------------------------------- 1 | { 2 | "owner": "williamluke4", 3 | "repo": "naph", 4 | "plugins": [ 5 | "npm", 6 | "conventional-commits" 7 | ] 8 | } -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | parser: '@typescript-eslint/parser', 3 | parserOptions: { 4 | ecmaVersion: 6, 5 | sourceType: 'module', 6 | ecmaFeatures: { 7 | jsx: true, 8 | }, 9 | }, 10 | settings: { 11 | react: { 12 | version: 'detect', 13 | }, 14 | }, 15 | extends: [ 16 | 'plugin:@typescript-eslint/recommended', 17 | 'prettier', 18 | 'prettier/react', 19 | 'prettier/@typescript-eslint', 20 | ], 21 | plugins: ['react', 'react-hooks', 'pretty-imports', '@typescript-eslint'], 22 | rules: { 23 | '@typescript-eslint/explicit-function-return-type': 0, 24 | '@typescript-eslint/explicit-member-accessibility': 0, 25 | '@typescript-eslint/no-non-null-assertion': 0, 26 | '@typescript-eslint/no-explicit-any': 0, 27 | // in scripts and config files it's required to use dynamic require 28 | '@typescript-eslint/no-var-requires': 0, 29 | 'react/no-children-prop': 0, 30 | 'react/jsx-uses-vars': 2, 31 | 'react/jsx-uses-react': 2, 32 | 'pretty-imports/sorted': 'warn', 33 | '@typescript-eslint/no-use-before-define': 'warn', 34 | 'react-hooks/rules-of-hooks': 'error', 35 | 'react-hooks/exhaustive-deps': 'warn', 36 | '@typescript-eslint/no-namespace': 'off', 37 | '@typescript-eslint/no-unused-vars': [ 38 | 'error', 39 | { vars: 'all', args: 'after-used', argsIgnorePattern: '^_', ignoreRestSiblings: true }, 40 | ], 41 | }, 42 | }; 43 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.log 2 | node_modules 3 | .DS_Store 4 | .idea 5 | build/ 6 | *.env 7 | *.sublime-* 8 | .cache 9 | *.map -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # v0.3.1 (Mon Dec 16 2019) 2 | 3 | #### 🐛 Bug Fix 4 | 5 | - fix(WARNING): WIP (william@ordino.ai) 6 | 7 | #### Authors: 1 8 | 9 | - William Luke (william@ordino.ai) 10 | 11 | --- 12 | 13 | # v0.3.0 (Sat Dec 14 2019) 14 | 15 | #### 🚀 Enhancement 16 | 17 | - feat: Migrate to Context based State (william@ordino.ai) 18 | 19 | #### Authors: 1 20 | 21 | - William Luke (william@ordino.ai) 22 | 23 | --- 24 | 25 | # v0.2.2 (Fri Dec 13 2019) 26 | 27 | #### 🐛 Bug Fix 28 | 29 | - fix(Misc): Npm Repo Link and Export Types (william@ordino.ai) 30 | 31 | #### Authors: 1 32 | 33 | - William Luke (william@ordino.ai) 34 | 35 | --- 36 | 37 | # v0.2.1 (Fri Dec 13 2019) 38 | 39 | #### 🐛 Bug Fix 40 | 41 | - fix(Build): * (william@ordino.ai) 42 | - fix(Spline): Jumping Issue when adding or removing a spline (william@ordino.ai) 43 | - Create CODE_OF_CONDUCT.md [#2](https://github.com/williamluke4/Naph/pull/2) (william@ordino.ai) 44 | 45 | #### ⚠️ Pushed to master 46 | 47 | - docs: Add Screen Shot (william@ordino.ai) 48 | - docs: Clean Read Me (william@ordino.ai) 49 | 50 | #### Authors: 1 51 | 52 | - William Luke ([@williamluke4](https://github.com/williamluke4)) 53 | 54 | --- 55 | 56 | # v0.2.0 (Fri Dec 13 2019) 57 | 58 | #### 🚀 Enhancement 59 | 60 | - feat: Fix Various Issues (william@ordino.ai) 61 | 62 | #### 🐛 Bug Fix 63 | 64 | - fix: Remove Maps (william@ordino.ai) 65 | 66 | #### Authors: 1 67 | 68 | - William Luke (william@ordino.ai) 69 | 70 | --- 71 | 72 | # v0.1.0 (Fri Dec 13 2019) 73 | 74 | #### 🚀 Enhancement 75 | 76 | - feat: Build (william@ordino.ai) 77 | 78 | #### Authors: 1 79 | 80 | - William Luke (william@ordino.ai) 81 | 82 | --- 83 | 84 | # v0.0.1 (Fri Dec 13 2019) 85 | 86 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at william@atto-byte.com. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | 75 | For answers to common questions about this code of conduct, see 76 | https://www.contributor-covenant.org/faq 77 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Lights in the Sky 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Naph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/williamluke4/Naph/04c3c2f9415c5c5ddb865ba981ee00f1f30cc109/Naph.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Naph 2 | 3 | ## Experimental - _Use at your own peril!_ 4 | 5 |

6 | 7 |

8 | 9 | [![npm version](https://badge.fury.io/js/naph.svg)](https://badge.fury.io/js/naph) 10 | [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/williamluke4/Naph) 11 | ======= 12 | 13 | 14 | ## Install 15 | 16 | #### NPM: 17 | 18 | ```sh 19 | npm install --save naph 20 | ``` 21 | 22 | ## Usage 23 | 24 | ```jsx 25 | import NaphGraph, { NaphProvider } from "naph"; 26 | 27 | const example = { 28 | nodes: [ 29 | { 30 | nid: 1, 31 | title: "User", 32 | x: 50, 33 | y: 50, 34 | fields: [ 35 | { name: "id", type: "@id" }, 36 | { name: "firstname", type: "String" }, 37 | { name: "surname", type: "String" }, 38 | { name: "posts", type: "Post[]" }, 39 | { name: "comments", type: "Comment[ ]" } 40 | ] 41 | }, 42 | { 43 | nid: 3, 44 | title: "Comment", 45 | x: 500, 46 | y: 300, 47 | fields: [ 48 | { name: "id", type: "@id" }, 49 | { name: "post", type: "Post" }, 50 | { name: "user", type: "User" }, 51 | { name: "data", type: "String" } 52 | ] 53 | }, 54 | { 55 | nid: 2, 56 | title: "Post", 57 | x: 400, 58 | y: 100, 59 | fields: [ 60 | { name: "id", type: "@id" }, 61 | { name: "user", type: "User" }, 62 | { name: "comments", type: "Comment[]" }, 63 | { name: "data", type: "String" } 64 | ] 65 | } 66 | ], 67 | connections: [ 68 | { 69 | from_node_id: 1, 70 | from_field_name: "posts", 71 | to_node_id: 2, 72 | to_field_name: "user" 73 | }, 74 | { 75 | from_node_id: 1, 76 | from_field_name: "comments", 77 | to_node_id: 3, 78 | to_field_name: "user" 79 | }, 80 | { 81 | from_node_id: 2, 82 | from_field_name: "comments", 83 | to_node_id: 3, 84 | to_field_name: "post" 85 | } 86 | ] 87 | }; 88 | 89 | export const Naph = () => ( 90 | 91 | onNodeMove(nid, pos)} 93 | onNodeStartMove={nid => onNodeStartMove(nid)} 94 | onNewConnector={(n1, o, n2, i) => onNewConnector(n1, o, n2, i)} 95 | onRemoveConnector={connector => onRemoveConnector(connector)} 96 | onNodeSelect={nid => { 97 | handleNodeSelect(nid); 98 | }} 99 | onNodeDeselect={nid => { 100 | handleNodeDeselect(nid); 101 | }} 102 | /> 103 | 104 | ); 105 | ``` 106 | -------------------------------------------------------------------------------- /dist/index.html: -------------------------------------------------------------------------------- 1 | Naph
-------------------------------------------------------------------------------- /dist/node.1501a258.css: -------------------------------------------------------------------------------- 1 | body{font-family:Source Sans Pro,sans-serif;color:#323232;line-height:20px;overflow-x:hidden;font-size:14px;margin:0;font-weight:400;background-color:#f4f8fa;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-font-smoothing:antialiased}.node{position:absolute;width:200px;border-radius:4px;-webkit-box-shadow:6px 6px 28px -2px rgba(0,0,0,.4);-moz-box-shadow:6px 6px 28px -2px rgba(0,0,0,.4);box-shadow:6px 6px 28px -2px rgba(0,0,0,.4);background-color:#fff;user-select:none}.node.selected{border:0 solid #15bd76;box-shadow:0 0 10px 0 rgba(21,189,118,.37)}.node-seperator{color:#eff3f5;border-color:#eff3f5}.node-content{padding:10px}.node-title{font-size:10px}.node-header{cursor:all-scroll;background:#15bd76;padding-left:10px;text-transform:uppercase;border-top-left-radius:4px;border-top-right-radius:4px;border-bottom:1px solid hsla(0,0%,50.2%,.69);padding-top:3px;height:23px;font-size:13px;letter-spacing:1px;color:#fff;font-weight:600}.connector{fill:none;stroke:#dadada;stroke-width:2;-webkit-box-shadow:6px 6px 28px -2px rgba(0,0,0,.75);-moz-box-shadow:6px 6px 28px -2px rgba(0,0,0,.75);box-shadow:6px 6px 28px -2px rgba(0,0,0,.75);-webkit-filter:drop-shadow(-5px -5px 5px #000);filter:drop-shadow(-5px -5px 5px #000)}.connector-click-area{cursor:pointer;fill:none;stroke:transparent;stroke-width:15}.connector-click-area:hover+.connector,.connector:hover{cursor:pointer;stroke-width:4}.connector.selected{stroke:#15bd76}.trash-icon .trash-icon-trashcan{opacity:.8}.trash-icon:hover{cursor:pointer}.trash-icon:hover .trash-icon-bg{stroke:#15bd76;stroke-width:2;opacity:.5}.trash-icon:hover .trash-icon-trashcan{opacity:1}.nodeInputWrapper{width:50%;float:left}.nodeOutputWrapper{width:50%;float:right;text-align:right}.nodeInputList,.nodeOutputList{list-style:none;padding:0;margin-top:0;margin-bottom:10px}.nodeOutputList li{cursor:pointer}.nodeOutputList li a{font-size:10px;text-decoration:none;background:transparent;box-sizing:border-box;color:#337ab7}.nodeOutputList li a i{padding-left:6px}.nodeOutputList li:hover a i{vertical-align:top;font-size:15px;margin-top:3px;margin-right:-2px;padding-left:3px}.nodeOutputList li:hover a{vertical-align:top;font-weight:700}.nodeInputList li a{cursor:default;font-size:10px;color:#999;display:block;text-decoration:none;background:transparent;box-sizing:border-box}.nodeInputList li a i{padding-right:6px}.dragging .nodeInputList li a i.hover{vertical-align:top;font-size:15px;color:#fff;margin-top:2px;margin-left:-2px;padding-right:3px}.dragging .nodeInputList li a i.hover+span{vertical-align:top;font-weight:700;color:#fff}.inputDot{width:12px;height:12px;display:inline-block;position:absolute;background:#e6e6e6;border-radius:50%;top:0;right:3px;left:auto;border:2px solid #fff}.EndPoint{fill:none;stroke:#888;stroke-width:2}.pin-input{background:transparent;padding:5px;width:50px;display:inline-block;margin-left:16px;border-color:#333}.node-menu{display:block;z-index:10020} -------------------------------------------------------------------------------- /example/App.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | 3 | import NaphGraph, { NaphProvider, Connection, Data } from '../src'; 4 | var exampleGraph: Data = { 5 | "nodes":[ 6 | {"nid":1,"title":"User","x":50,"y":50,"fields":[ 7 | {"name":"id", "type": "@id"}, 8 | {"name":"firstname", "type": "String"}, 9 | {"name":"surname", "type": "String"}, 10 | {"name":"posts", type: "Post[]"}, 11 | {"name":"comments", type: "Comment[ ]"} 12 | ], 13 | }, 14 | {"nid":3,"title":"Comment","x":500,"y":300,"fields":[ 15 | {"name":"id", "type":"@id"}, 16 | {"name":"post", "type":"Post"}, 17 | {"name":"user", "type":"User"}, 18 | {"name":"data", "type":"String"}, 19 | ], 20 | }, 21 | {"nid":2,"title":"Post","x":400,"y":100,"fields":[ 22 | {"name":"id", "type":"@id"}, 23 | {"name":"user", "type":"User"}, 24 | {"name":"comments", "type":"Comment[]"}, 25 | {"name":"data", "type":"String"}, 26 | ], 27 | }, 28 | ], 29 | "connections":[ 30 | { 31 | from_node_id: 1, 32 | from_field_name: "posts", 33 | to_node_id: 2, 34 | to_field_name: "user", 35 | }, 36 | { 37 | from_node_id: 1, 38 | from_field_name:"comments", 39 | to_node_id: 3, 40 | to_field_name: "user", 41 | }, 42 | { 43 | from_node_id: 2, 44 | from_field_name: "comments", 45 | to_node_id: 3, 46 | to_field_name: "post", 47 | } 48 | ] 49 | }; 50 | 51 | export default () => { 52 | function onNewConnector(connector: Connection) { 53 | // console.log("New Connector Added"); 54 | } 55 | 56 | function onRemoveConnector(connector) { 57 | // console.log("Connector Removed"); 58 | } 59 | 60 | function onNodeMove(nid, pos) { 61 | // console.log('end move : ' + nid, pos) 62 | } 63 | 64 | function onNodeStartMove(nid) { 65 | // console.log('start move : ' + nid) 66 | } 67 | 68 | function handleNodeSelect(nid) { 69 | // console.log('node selected : ' + nid) 70 | } 71 | 72 | function handleNodeDeselect(nid) { 73 | // console.log('node deselected : ' + nid) 74 | } 75 | 76 | return ( 77 | 78 | 79 | onNodeMove(nid, pos)} 81 | onNodeStartMove={(nid)=>onNodeStartMove(nid)} 82 | onNewConnector={(connector)=>onNewConnector(connector)} 83 | onRemoveConnector={(connector)=>onRemoveConnector(connector)} 84 | onNodeSelect={(nid) => {handleNodeSelect(nid)}} 85 | onNodeDeselect={(nid) => {handleNodeDeselect(nid)}} 86 | /> 87 | 88 | ); 89 | } -------------------------------------------------------------------------------- /example/data.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | "datamodel": { 3 | "enums": [], 4 | "models": [ 5 | { 6 | "name": "User", 7 | "isEmbedded": false, 8 | "dbName": null, 9 | "fields": [ 10 | { 11 | "name": "id", 12 | "kind": "scalar", 13 | "dbName": null, 14 | "isList": false, 15 | "isRequired": true, 16 | "isUnique": false, 17 | "isId": true, 18 | "type": "String", 19 | "default": { "name": "cuid", "returnType": "String", "args": [] }, 20 | "isGenerated": false, 21 | "isUpdatedAt": false 22 | }, 23 | { 24 | "name": "email", 25 | "kind": "scalar", 26 | "dbName": null, 27 | "isList": false, 28 | "isRequired": true, 29 | "isUnique": true, 30 | "isId": false, 31 | "type": "String", 32 | "isGenerated": false, 33 | "isUpdatedAt": false 34 | }, 35 | { 36 | "name": "name", 37 | "kind": "scalar", 38 | "dbName": null, 39 | "isList": false, 40 | "isRequired": false, 41 | "isUnique": false, 42 | "isId": false, 43 | "type": "String", 44 | "isGenerated": false, 45 | "isUpdatedAt": false 46 | }, 47 | { 48 | "name": "posts", 49 | "kind": "object", 50 | "dbName": null, 51 | "isList": true, 52 | "isRequired": false, 53 | "isUnique": false, 54 | "isId": false, 55 | "type": "Post", 56 | "relationName": "PostToUser", 57 | "relationToFields": [], 58 | "relationOnDelete": "NONE", 59 | "isGenerated": false, 60 | "isUpdatedAt": false 61 | } 62 | ], 63 | "isGenerated": false, 64 | "idFields": [] 65 | }, 66 | { 67 | "name": "Post", 68 | "isEmbedded": false, 69 | "dbName": null, 70 | "fields": [ 71 | { 72 | "name": "id", 73 | "kind": "scalar", 74 | "dbName": null, 75 | "isList": false, 76 | "isRequired": true, 77 | "isUnique": false, 78 | "isId": true, 79 | "type": "String", 80 | "default": { "name": "cuid", "returnType": "String", "args": [] }, 81 | "isGenerated": false, 82 | "isUpdatedAt": false 83 | }, 84 | { 85 | "name": "createdAt", 86 | "kind": "scalar", 87 | "dbName": null, 88 | "isList": false, 89 | "isRequired": true, 90 | "isUnique": false, 91 | "isId": false, 92 | "type": "DateTime", 93 | "default": { "name": "now", "returnType": "DateTime", "args": [] }, 94 | "isGenerated": false, 95 | "isUpdatedAt": false 96 | }, 97 | { 98 | "name": "updatedAt", 99 | "kind": "scalar", 100 | "dbName": null, 101 | "isList": false, 102 | "isRequired": true, 103 | "isUnique": false, 104 | "isId": false, 105 | "type": "DateTime", 106 | "isGenerated": false, 107 | "isUpdatedAt": true 108 | }, 109 | { 110 | "name": "published", 111 | "kind": "scalar", 112 | "dbName": null, 113 | "isList": false, 114 | "isRequired": true, 115 | "isUnique": false, 116 | "isId": false, 117 | "type": "Boolean", 118 | "isGenerated": false, 119 | "isUpdatedAt": false 120 | }, 121 | { 122 | "name": "title", 123 | "kind": "scalar", 124 | "dbName": null, 125 | "isList": false, 126 | "isRequired": true, 127 | "isUnique": false, 128 | "isId": false, 129 | "type": "String", 130 | "isGenerated": false, 131 | "isUpdatedAt": false 132 | }, 133 | { 134 | "name": "content", 135 | "kind": "scalar", 136 | "dbName": null, 137 | "isList": false, 138 | "isRequired": false, 139 | "isUnique": false, 140 | "isId": false, 141 | "type": "String", 142 | "isGenerated": false, 143 | "isUpdatedAt": false 144 | }, 145 | { 146 | "name": "author", 147 | "kind": "object", 148 | "dbName": null, 149 | "isList": false, 150 | "isRequired": false, 151 | "isUnique": false, 152 | "isId": false, 153 | "type": "User", 154 | "relationName": "PostToUser", 155 | "relationToFields": ["id"], 156 | "relationOnDelete": "NONE", 157 | "isGenerated": false, 158 | "isUpdatedAt": false 159 | } 160 | ], 161 | "isGenerated": false, 162 | "idFields": [] 163 | } 164 | ] 165 | }, 166 | "schema": { 167 | "rootQueryType": "Query", 168 | "rootMutationType": "Mutation", 169 | "inputTypes": [ 170 | { 171 | "name": "PostWhereInput", 172 | "fields": [ 173 | { 174 | "name": "AND", 175 | "inputType": { 176 | "type": "PostWhereInput", 177 | "kind": "object", 178 | "isRequired": false, 179 | "isList": true 180 | } 181 | }, 182 | { 183 | "name": "OR", 184 | "inputType": { 185 | "type": "PostWhereInput", 186 | "kind": "object", 187 | "isRequired": false, 188 | "isList": true 189 | } 190 | }, 191 | { 192 | "name": "NOT", 193 | "inputType": { 194 | "type": "PostWhereInput", 195 | "kind": "object", 196 | "isRequired": false, 197 | "isList": true 198 | } 199 | }, 200 | { 201 | "name": "id", 202 | "inputType": { 203 | "type": "ID", 204 | "kind": "scalar", 205 | "isRequired": false, 206 | "isList": false 207 | } 208 | }, 209 | { 210 | "name": "id_not", 211 | "inputType": { 212 | "type": "ID", 213 | "kind": "scalar", 214 | "isRequired": false, 215 | "isList": false 216 | } 217 | }, 218 | { 219 | "name": "id_in", 220 | "inputType": { 221 | "type": "ID", 222 | "kind": "scalar", 223 | "isRequired": false, 224 | "isList": true 225 | } 226 | }, 227 | { 228 | "name": "id_not_in", 229 | "inputType": { 230 | "type": "ID", 231 | "kind": "scalar", 232 | "isRequired": false, 233 | "isList": true 234 | } 235 | }, 236 | { 237 | "name": "id_lt", 238 | "inputType": { 239 | "type": "ID", 240 | "kind": "scalar", 241 | "isRequired": false, 242 | "isList": false 243 | } 244 | }, 245 | { 246 | "name": "id_lte", 247 | "inputType": { 248 | "type": "ID", 249 | "kind": "scalar", 250 | "isRequired": false, 251 | "isList": false 252 | } 253 | }, 254 | { 255 | "name": "id_gt", 256 | "inputType": { 257 | "type": "ID", 258 | "kind": "scalar", 259 | "isRequired": false, 260 | "isList": false 261 | } 262 | }, 263 | { 264 | "name": "id_gte", 265 | "inputType": { 266 | "type": "ID", 267 | "kind": "scalar", 268 | "isRequired": false, 269 | "isList": false 270 | } 271 | }, 272 | { 273 | "name": "id_contains", 274 | "inputType": { 275 | "type": "ID", 276 | "kind": "scalar", 277 | "isRequired": false, 278 | "isList": false 279 | } 280 | }, 281 | { 282 | "name": "id_not_contains", 283 | "inputType": { 284 | "type": "ID", 285 | "kind": "scalar", 286 | "isRequired": false, 287 | "isList": false 288 | } 289 | }, 290 | { 291 | "name": "id_starts_with", 292 | "inputType": { 293 | "type": "ID", 294 | "kind": "scalar", 295 | "isRequired": false, 296 | "isList": false 297 | } 298 | }, 299 | { 300 | "name": "id_not_starts_with", 301 | "inputType": { 302 | "type": "ID", 303 | "kind": "scalar", 304 | "isRequired": false, 305 | "isList": false 306 | } 307 | }, 308 | { 309 | "name": "id_ends_with", 310 | "inputType": { 311 | "type": "ID", 312 | "kind": "scalar", 313 | "isRequired": false, 314 | "isList": false 315 | } 316 | }, 317 | { 318 | "name": "id_not_ends_with", 319 | "inputType": { 320 | "type": "ID", 321 | "kind": "scalar", 322 | "isRequired": false, 323 | "isList": false 324 | } 325 | }, 326 | { 327 | "name": "createdAt", 328 | "inputType": { 329 | "type": "DateTime", 330 | "kind": "scalar", 331 | "isRequired": false, 332 | "isList": false 333 | } 334 | }, 335 | { 336 | "name": "createdAt_not", 337 | "inputType": { 338 | "type": "DateTime", 339 | "kind": "scalar", 340 | "isRequired": false, 341 | "isList": false 342 | } 343 | }, 344 | { 345 | "name": "createdAt_in", 346 | "inputType": { 347 | "type": "DateTime", 348 | "kind": "scalar", 349 | "isRequired": false, 350 | "isList": true 351 | } 352 | }, 353 | { 354 | "name": "createdAt_not_in", 355 | "inputType": { 356 | "type": "DateTime", 357 | "kind": "scalar", 358 | "isRequired": false, 359 | "isList": true 360 | } 361 | }, 362 | { 363 | "name": "createdAt_lt", 364 | "inputType": { 365 | "type": "DateTime", 366 | "kind": "scalar", 367 | "isRequired": false, 368 | "isList": false 369 | } 370 | }, 371 | { 372 | "name": "createdAt_lte", 373 | "inputType": { 374 | "type": "DateTime", 375 | "kind": "scalar", 376 | "isRequired": false, 377 | "isList": false 378 | } 379 | }, 380 | { 381 | "name": "createdAt_gt", 382 | "inputType": { 383 | "type": "DateTime", 384 | "kind": "scalar", 385 | "isRequired": false, 386 | "isList": false 387 | } 388 | }, 389 | { 390 | "name": "createdAt_gte", 391 | "inputType": { 392 | "type": "DateTime", 393 | "kind": "scalar", 394 | "isRequired": false, 395 | "isList": false 396 | } 397 | }, 398 | { 399 | "name": "updatedAt", 400 | "inputType": { 401 | "type": "DateTime", 402 | "kind": "scalar", 403 | "isRequired": false, 404 | "isList": false 405 | } 406 | }, 407 | { 408 | "name": "updatedAt_not", 409 | "inputType": { 410 | "type": "DateTime", 411 | "kind": "scalar", 412 | "isRequired": false, 413 | "isList": false 414 | } 415 | }, 416 | { 417 | "name": "updatedAt_in", 418 | "inputType": { 419 | "type": "DateTime", 420 | "kind": "scalar", 421 | "isRequired": false, 422 | "isList": true 423 | } 424 | }, 425 | { 426 | "name": "updatedAt_not_in", 427 | "inputType": { 428 | "type": "DateTime", 429 | "kind": "scalar", 430 | "isRequired": false, 431 | "isList": true 432 | } 433 | }, 434 | { 435 | "name": "updatedAt_lt", 436 | "inputType": { 437 | "type": "DateTime", 438 | "kind": "scalar", 439 | "isRequired": false, 440 | "isList": false 441 | } 442 | }, 443 | { 444 | "name": "updatedAt_lte", 445 | "inputType": { 446 | "type": "DateTime", 447 | "kind": "scalar", 448 | "isRequired": false, 449 | "isList": false 450 | } 451 | }, 452 | { 453 | "name": "updatedAt_gt", 454 | "inputType": { 455 | "type": "DateTime", 456 | "kind": "scalar", 457 | "isRequired": false, 458 | "isList": false 459 | } 460 | }, 461 | { 462 | "name": "updatedAt_gte", 463 | "inputType": { 464 | "type": "DateTime", 465 | "kind": "scalar", 466 | "isRequired": false, 467 | "isList": false 468 | } 469 | }, 470 | { 471 | "name": "published", 472 | "inputType": { 473 | "type": "Boolean", 474 | "kind": "scalar", 475 | "isRequired": false, 476 | "isList": false 477 | } 478 | }, 479 | { 480 | "name": "published_not", 481 | "inputType": { 482 | "type": "Boolean", 483 | "kind": "scalar", 484 | "isRequired": false, 485 | "isList": false 486 | } 487 | }, 488 | { 489 | "name": "title", 490 | "inputType": { 491 | "type": "String", 492 | "kind": "scalar", 493 | "isRequired": false, 494 | "isList": false 495 | } 496 | }, 497 | { 498 | "name": "title_not", 499 | "inputType": { 500 | "type": "String", 501 | "kind": "scalar", 502 | "isRequired": false, 503 | "isList": false 504 | } 505 | }, 506 | { 507 | "name": "title_in", 508 | "inputType": { 509 | "type": "String", 510 | "kind": "scalar", 511 | "isRequired": false, 512 | "isList": true 513 | } 514 | }, 515 | { 516 | "name": "title_not_in", 517 | "inputType": { 518 | "type": "String", 519 | "kind": "scalar", 520 | "isRequired": false, 521 | "isList": true 522 | } 523 | }, 524 | { 525 | "name": "title_lt", 526 | "inputType": { 527 | "type": "String", 528 | "kind": "scalar", 529 | "isRequired": false, 530 | "isList": false 531 | } 532 | }, 533 | { 534 | "name": "title_lte", 535 | "inputType": { 536 | "type": "String", 537 | "kind": "scalar", 538 | "isRequired": false, 539 | "isList": false 540 | } 541 | }, 542 | { 543 | "name": "title_gt", 544 | "inputType": { 545 | "type": "String", 546 | "kind": "scalar", 547 | "isRequired": false, 548 | "isList": false 549 | } 550 | }, 551 | { 552 | "name": "title_gte", 553 | "inputType": { 554 | "type": "String", 555 | "kind": "scalar", 556 | "isRequired": false, 557 | "isList": false 558 | } 559 | }, 560 | { 561 | "name": "title_contains", 562 | "inputType": { 563 | "type": "String", 564 | "kind": "scalar", 565 | "isRequired": false, 566 | "isList": false 567 | } 568 | }, 569 | { 570 | "name": "title_not_contains", 571 | "inputType": { 572 | "type": "String", 573 | "kind": "scalar", 574 | "isRequired": false, 575 | "isList": false 576 | } 577 | }, 578 | { 579 | "name": "title_starts_with", 580 | "inputType": { 581 | "type": "String", 582 | "kind": "scalar", 583 | "isRequired": false, 584 | "isList": false 585 | } 586 | }, 587 | { 588 | "name": "title_not_starts_with", 589 | "inputType": { 590 | "type": "String", 591 | "kind": "scalar", 592 | "isRequired": false, 593 | "isList": false 594 | } 595 | }, 596 | { 597 | "name": "title_ends_with", 598 | "inputType": { 599 | "type": "String", 600 | "kind": "scalar", 601 | "isRequired": false, 602 | "isList": false 603 | } 604 | }, 605 | { 606 | "name": "title_not_ends_with", 607 | "inputType": { 608 | "type": "String", 609 | "kind": "scalar", 610 | "isRequired": false, 611 | "isList": false 612 | } 613 | }, 614 | { 615 | "name": "content", 616 | "inputType": { 617 | "type": "String", 618 | "kind": "scalar", 619 | "isRequired": false, 620 | "isList": false 621 | } 622 | }, 623 | { 624 | "name": "content_not", 625 | "inputType": { 626 | "type": "String", 627 | "kind": "scalar", 628 | "isRequired": false, 629 | "isList": false 630 | } 631 | }, 632 | { 633 | "name": "content_in", 634 | "inputType": { 635 | "type": "String", 636 | "kind": "scalar", 637 | "isRequired": false, 638 | "isList": true 639 | } 640 | }, 641 | { 642 | "name": "content_not_in", 643 | "inputType": { 644 | "type": "String", 645 | "kind": "scalar", 646 | "isRequired": false, 647 | "isList": true 648 | } 649 | }, 650 | { 651 | "name": "content_lt", 652 | "inputType": { 653 | "type": "String", 654 | "kind": "scalar", 655 | "isRequired": false, 656 | "isList": false 657 | } 658 | }, 659 | { 660 | "name": "content_lte", 661 | "inputType": { 662 | "type": "String", 663 | "kind": "scalar", 664 | "isRequired": false, 665 | "isList": false 666 | } 667 | }, 668 | { 669 | "name": "content_gt", 670 | "inputType": { 671 | "type": "String", 672 | "kind": "scalar", 673 | "isRequired": false, 674 | "isList": false 675 | } 676 | }, 677 | { 678 | "name": "content_gte", 679 | "inputType": { 680 | "type": "String", 681 | "kind": "scalar", 682 | "isRequired": false, 683 | "isList": false 684 | } 685 | }, 686 | { 687 | "name": "content_contains", 688 | "inputType": { 689 | "type": "String", 690 | "kind": "scalar", 691 | "isRequired": false, 692 | "isList": false 693 | } 694 | }, 695 | { 696 | "name": "content_not_contains", 697 | "inputType": { 698 | "type": "String", 699 | "kind": "scalar", 700 | "isRequired": false, 701 | "isList": false 702 | } 703 | }, 704 | { 705 | "name": "content_starts_with", 706 | "inputType": { 707 | "type": "String", 708 | "kind": "scalar", 709 | "isRequired": false, 710 | "isList": false 711 | } 712 | }, 713 | { 714 | "name": "content_not_starts_with", 715 | "inputType": { 716 | "type": "String", 717 | "kind": "scalar", 718 | "isRequired": false, 719 | "isList": false 720 | } 721 | }, 722 | { 723 | "name": "content_ends_with", 724 | "inputType": { 725 | "type": "String", 726 | "kind": "scalar", 727 | "isRequired": false, 728 | "isList": false 729 | } 730 | }, 731 | { 732 | "name": "content_not_ends_with", 733 | "inputType": { 734 | "type": "String", 735 | "kind": "scalar", 736 | "isRequired": false, 737 | "isList": false 738 | } 739 | }, 740 | { 741 | "name": "author", 742 | "inputType": { 743 | "type": "UserWhereInput", 744 | "kind": "object", 745 | "isRequired": false, 746 | "isList": false 747 | } 748 | } 749 | ] 750 | }, 751 | { 752 | "name": "UserWhereInput", 753 | "fields": [ 754 | { 755 | "name": "AND", 756 | "inputType": { 757 | "type": "UserWhereInput", 758 | "kind": "object", 759 | "isRequired": false, 760 | "isList": true 761 | } 762 | }, 763 | { 764 | "name": "OR", 765 | "inputType": { 766 | "type": "UserWhereInput", 767 | "kind": "object", 768 | "isRequired": false, 769 | "isList": true 770 | } 771 | }, 772 | { 773 | "name": "NOT", 774 | "inputType": { 775 | "type": "UserWhereInput", 776 | "kind": "object", 777 | "isRequired": false, 778 | "isList": true 779 | } 780 | }, 781 | { 782 | "name": "id", 783 | "inputType": { 784 | "type": "ID", 785 | "kind": "scalar", 786 | "isRequired": false, 787 | "isList": false 788 | } 789 | }, 790 | { 791 | "name": "id_not", 792 | "inputType": { 793 | "type": "ID", 794 | "kind": "scalar", 795 | "isRequired": false, 796 | "isList": false 797 | } 798 | }, 799 | { 800 | "name": "id_in", 801 | "inputType": { 802 | "type": "ID", 803 | "kind": "scalar", 804 | "isRequired": false, 805 | "isList": true 806 | } 807 | }, 808 | { 809 | "name": "id_not_in", 810 | "inputType": { 811 | "type": "ID", 812 | "kind": "scalar", 813 | "isRequired": false, 814 | "isList": true 815 | } 816 | }, 817 | { 818 | "name": "id_lt", 819 | "inputType": { 820 | "type": "ID", 821 | "kind": "scalar", 822 | "isRequired": false, 823 | "isList": false 824 | } 825 | }, 826 | { 827 | "name": "id_lte", 828 | "inputType": { 829 | "type": "ID", 830 | "kind": "scalar", 831 | "isRequired": false, 832 | "isList": false 833 | } 834 | }, 835 | { 836 | "name": "id_gt", 837 | "inputType": { 838 | "type": "ID", 839 | "kind": "scalar", 840 | "isRequired": false, 841 | "isList": false 842 | } 843 | }, 844 | { 845 | "name": "id_gte", 846 | "inputType": { 847 | "type": "ID", 848 | "kind": "scalar", 849 | "isRequired": false, 850 | "isList": false 851 | } 852 | }, 853 | { 854 | "name": "id_contains", 855 | "inputType": { 856 | "type": "ID", 857 | "kind": "scalar", 858 | "isRequired": false, 859 | "isList": false 860 | } 861 | }, 862 | { 863 | "name": "id_not_contains", 864 | "inputType": { 865 | "type": "ID", 866 | "kind": "scalar", 867 | "isRequired": false, 868 | "isList": false 869 | } 870 | }, 871 | { 872 | "name": "id_starts_with", 873 | "inputType": { 874 | "type": "ID", 875 | "kind": "scalar", 876 | "isRequired": false, 877 | "isList": false 878 | } 879 | }, 880 | { 881 | "name": "id_not_starts_with", 882 | "inputType": { 883 | "type": "ID", 884 | "kind": "scalar", 885 | "isRequired": false, 886 | "isList": false 887 | } 888 | }, 889 | { 890 | "name": "id_ends_with", 891 | "inputType": { 892 | "type": "ID", 893 | "kind": "scalar", 894 | "isRequired": false, 895 | "isList": false 896 | } 897 | }, 898 | { 899 | "name": "id_not_ends_with", 900 | "inputType": { 901 | "type": "ID", 902 | "kind": "scalar", 903 | "isRequired": false, 904 | "isList": false 905 | } 906 | }, 907 | { 908 | "name": "email", 909 | "inputType": { 910 | "type": "String", 911 | "kind": "scalar", 912 | "isRequired": false, 913 | "isList": false 914 | } 915 | }, 916 | { 917 | "name": "email_not", 918 | "inputType": { 919 | "type": "String", 920 | "kind": "scalar", 921 | "isRequired": false, 922 | "isList": false 923 | } 924 | }, 925 | { 926 | "name": "email_in", 927 | "inputType": { 928 | "type": "String", 929 | "kind": "scalar", 930 | "isRequired": false, 931 | "isList": true 932 | } 933 | }, 934 | { 935 | "name": "email_not_in", 936 | "inputType": { 937 | "type": "String", 938 | "kind": "scalar", 939 | "isRequired": false, 940 | "isList": true 941 | } 942 | }, 943 | { 944 | "name": "email_lt", 945 | "inputType": { 946 | "type": "String", 947 | "kind": "scalar", 948 | "isRequired": false, 949 | "isList": false 950 | } 951 | }, 952 | { 953 | "name": "email_lte", 954 | "inputType": { 955 | "type": "String", 956 | "kind": "scalar", 957 | "isRequired": false, 958 | "isList": false 959 | } 960 | }, 961 | { 962 | "name": "email_gt", 963 | "inputType": { 964 | "type": "String", 965 | "kind": "scalar", 966 | "isRequired": false, 967 | "isList": false 968 | } 969 | }, 970 | { 971 | "name": "email_gte", 972 | "inputType": { 973 | "type": "String", 974 | "kind": "scalar", 975 | "isRequired": false, 976 | "isList": false 977 | } 978 | }, 979 | { 980 | "name": "email_contains", 981 | "inputType": { 982 | "type": "String", 983 | "kind": "scalar", 984 | "isRequired": false, 985 | "isList": false 986 | } 987 | }, 988 | { 989 | "name": "email_not_contains", 990 | "inputType": { 991 | "type": "String", 992 | "kind": "scalar", 993 | "isRequired": false, 994 | "isList": false 995 | } 996 | }, 997 | { 998 | "name": "email_starts_with", 999 | "inputType": { 1000 | "type": "String", 1001 | "kind": "scalar", 1002 | "isRequired": false, 1003 | "isList": false 1004 | } 1005 | }, 1006 | { 1007 | "name": "email_not_starts_with", 1008 | "inputType": { 1009 | "type": "String", 1010 | "kind": "scalar", 1011 | "isRequired": false, 1012 | "isList": false 1013 | } 1014 | }, 1015 | { 1016 | "name": "email_ends_with", 1017 | "inputType": { 1018 | "type": "String", 1019 | "kind": "scalar", 1020 | "isRequired": false, 1021 | "isList": false 1022 | } 1023 | }, 1024 | { 1025 | "name": "email_not_ends_with", 1026 | "inputType": { 1027 | "type": "String", 1028 | "kind": "scalar", 1029 | "isRequired": false, 1030 | "isList": false 1031 | } 1032 | }, 1033 | { 1034 | "name": "name", 1035 | "inputType": { 1036 | "type": "String", 1037 | "kind": "scalar", 1038 | "isRequired": false, 1039 | "isList": false 1040 | } 1041 | }, 1042 | { 1043 | "name": "name_not", 1044 | "inputType": { 1045 | "type": "String", 1046 | "kind": "scalar", 1047 | "isRequired": false, 1048 | "isList": false 1049 | } 1050 | }, 1051 | { 1052 | "name": "name_in", 1053 | "inputType": { 1054 | "type": "String", 1055 | "kind": "scalar", 1056 | "isRequired": false, 1057 | "isList": true 1058 | } 1059 | }, 1060 | { 1061 | "name": "name_not_in", 1062 | "inputType": { 1063 | "type": "String", 1064 | "kind": "scalar", 1065 | "isRequired": false, 1066 | "isList": true 1067 | } 1068 | }, 1069 | { 1070 | "name": "name_lt", 1071 | "inputType": { 1072 | "type": "String", 1073 | "kind": "scalar", 1074 | "isRequired": false, 1075 | "isList": false 1076 | } 1077 | }, 1078 | { 1079 | "name": "name_lte", 1080 | "inputType": { 1081 | "type": "String", 1082 | "kind": "scalar", 1083 | "isRequired": false, 1084 | "isList": false 1085 | } 1086 | }, 1087 | { 1088 | "name": "name_gt", 1089 | "inputType": { 1090 | "type": "String", 1091 | "kind": "scalar", 1092 | "isRequired": false, 1093 | "isList": false 1094 | } 1095 | }, 1096 | { 1097 | "name": "name_gte", 1098 | "inputType": { 1099 | "type": "String", 1100 | "kind": "scalar", 1101 | "isRequired": false, 1102 | "isList": false 1103 | } 1104 | }, 1105 | { 1106 | "name": "name_contains", 1107 | "inputType": { 1108 | "type": "String", 1109 | "kind": "scalar", 1110 | "isRequired": false, 1111 | "isList": false 1112 | } 1113 | }, 1114 | { 1115 | "name": "name_not_contains", 1116 | "inputType": { 1117 | "type": "String", 1118 | "kind": "scalar", 1119 | "isRequired": false, 1120 | "isList": false 1121 | } 1122 | }, 1123 | { 1124 | "name": "name_starts_with", 1125 | "inputType": { 1126 | "type": "String", 1127 | "kind": "scalar", 1128 | "isRequired": false, 1129 | "isList": false 1130 | } 1131 | }, 1132 | { 1133 | "name": "name_not_starts_with", 1134 | "inputType": { 1135 | "type": "String", 1136 | "kind": "scalar", 1137 | "isRequired": false, 1138 | "isList": false 1139 | } 1140 | }, 1141 | { 1142 | "name": "name_ends_with", 1143 | "inputType": { 1144 | "type": "String", 1145 | "kind": "scalar", 1146 | "isRequired": false, 1147 | "isList": false 1148 | } 1149 | }, 1150 | { 1151 | "name": "name_not_ends_with", 1152 | "inputType": { 1153 | "type": "String", 1154 | "kind": "scalar", 1155 | "isRequired": false, 1156 | "isList": false 1157 | } 1158 | }, 1159 | { 1160 | "name": "posts_every", 1161 | "inputType": { 1162 | "type": "PostWhereInput", 1163 | "kind": "object", 1164 | "isRequired": false, 1165 | "isList": false 1166 | } 1167 | }, 1168 | { 1169 | "name": "posts_some", 1170 | "inputType": { 1171 | "type": "PostWhereInput", 1172 | "kind": "object", 1173 | "isRequired": false, 1174 | "isList": false 1175 | } 1176 | }, 1177 | { 1178 | "name": "posts_none", 1179 | "inputType": { 1180 | "type": "PostWhereInput", 1181 | "kind": "object", 1182 | "isRequired": false, 1183 | "isList": false 1184 | } 1185 | } 1186 | ] 1187 | }, 1188 | { 1189 | "name": "UserWhereUniqueInput", 1190 | "fields": [ 1191 | { 1192 | "name": "id", 1193 | "inputType": { 1194 | "type": "ID", 1195 | "kind": "scalar", 1196 | "isRequired": false, 1197 | "isList": false 1198 | } 1199 | }, 1200 | { 1201 | "name": "email", 1202 | "inputType": { 1203 | "type": "String", 1204 | "kind": "scalar", 1205 | "isRequired": false, 1206 | "isList": false 1207 | } 1208 | } 1209 | ] 1210 | }, 1211 | { 1212 | "name": "PostWhereUniqueInput", 1213 | "fields": [ 1214 | { 1215 | "name": "id", 1216 | "inputType": { 1217 | "type": "ID", 1218 | "kind": "scalar", 1219 | "isRequired": false, 1220 | "isList": false 1221 | } 1222 | } 1223 | ] 1224 | }, 1225 | { 1226 | "name": "PostCreateWithoutAuthorInput", 1227 | "fields": [ 1228 | { 1229 | "name": "id", 1230 | "inputType": { 1231 | "type": "ID", 1232 | "kind": "scalar", 1233 | "isRequired": false, 1234 | "isList": false 1235 | } 1236 | }, 1237 | { 1238 | "name": "createdAt", 1239 | "inputType": { 1240 | "type": "DateTime", 1241 | "kind": "scalar", 1242 | "isRequired": false, 1243 | "isList": false 1244 | } 1245 | }, 1246 | { 1247 | "name": "updatedAt", 1248 | "inputType": { 1249 | "type": "DateTime", 1250 | "kind": "scalar", 1251 | "isRequired": false, 1252 | "isList": false 1253 | } 1254 | }, 1255 | { 1256 | "name": "published", 1257 | "inputType": { 1258 | "type": "Boolean", 1259 | "kind": "scalar", 1260 | "isRequired": true, 1261 | "isList": false 1262 | } 1263 | }, 1264 | { 1265 | "name": "title", 1266 | "inputType": { 1267 | "type": "String", 1268 | "kind": "scalar", 1269 | "isRequired": true, 1270 | "isList": false 1271 | } 1272 | }, 1273 | { 1274 | "name": "content", 1275 | "inputType": { 1276 | "type": "String", 1277 | "kind": "scalar", 1278 | "isRequired": false, 1279 | "isList": false 1280 | } 1281 | } 1282 | ] 1283 | }, 1284 | { 1285 | "name": "PostCreateManyWithoutPostsInput", 1286 | "fields": [ 1287 | { 1288 | "name": "create", 1289 | "inputType": { 1290 | "type": "PostCreateWithoutAuthorInput", 1291 | "kind": "object", 1292 | "isRequired": false, 1293 | "isList": true 1294 | } 1295 | }, 1296 | { 1297 | "name": "connect", 1298 | "inputType": { 1299 | "type": "PostWhereUniqueInput", 1300 | "kind": "object", 1301 | "isRequired": false, 1302 | "isList": true 1303 | } 1304 | } 1305 | ] 1306 | }, 1307 | { 1308 | "name": "UserCreateInput", 1309 | "fields": [ 1310 | { 1311 | "name": "id", 1312 | "inputType": { 1313 | "type": "ID", 1314 | "kind": "scalar", 1315 | "isRequired": false, 1316 | "isList": false 1317 | } 1318 | }, 1319 | { 1320 | "name": "email", 1321 | "inputType": { 1322 | "type": "String", 1323 | "kind": "scalar", 1324 | "isRequired": true, 1325 | "isList": false 1326 | } 1327 | }, 1328 | { 1329 | "name": "name", 1330 | "inputType": { 1331 | "type": "String", 1332 | "kind": "scalar", 1333 | "isRequired": false, 1334 | "isList": false 1335 | } 1336 | }, 1337 | { 1338 | "name": "posts", 1339 | "inputType": { 1340 | "type": "PostCreateManyWithoutPostsInput", 1341 | "kind": "object", 1342 | "isRequired": false, 1343 | "isList": false 1344 | } 1345 | } 1346 | ] 1347 | }, 1348 | { 1349 | "name": "PostUpdateWithoutAuthorDataInput", 1350 | "fields": [ 1351 | { 1352 | "name": "id", 1353 | "inputType": { 1354 | "type": "ID", 1355 | "kind": "scalar", 1356 | "isRequired": false, 1357 | "isList": false 1358 | } 1359 | }, 1360 | { 1361 | "name": "createdAt", 1362 | "inputType": { 1363 | "type": "DateTime", 1364 | "kind": "scalar", 1365 | "isRequired": false, 1366 | "isList": false 1367 | } 1368 | }, 1369 | { 1370 | "name": "updatedAt", 1371 | "inputType": { 1372 | "type": "DateTime", 1373 | "kind": "scalar", 1374 | "isRequired": false, 1375 | "isList": false 1376 | } 1377 | }, 1378 | { 1379 | "name": "published", 1380 | "inputType": { 1381 | "type": "Boolean", 1382 | "kind": "scalar", 1383 | "isRequired": false, 1384 | "isList": false 1385 | } 1386 | }, 1387 | { 1388 | "name": "title", 1389 | "inputType": { 1390 | "type": "String", 1391 | "kind": "scalar", 1392 | "isRequired": false, 1393 | "isList": false 1394 | } 1395 | }, 1396 | { 1397 | "name": "content", 1398 | "inputType": { 1399 | "type": "String", 1400 | "kind": "scalar", 1401 | "isRequired": false, 1402 | "isList": false 1403 | } 1404 | } 1405 | ] 1406 | }, 1407 | { 1408 | "name": "PostUpdateWithWhereUniqueWithoutAuthorInput", 1409 | "fields": [ 1410 | { 1411 | "name": "where", 1412 | "inputType": { 1413 | "type": "PostWhereUniqueInput", 1414 | "kind": "object", 1415 | "isRequired": true, 1416 | "isList": false 1417 | } 1418 | }, 1419 | { 1420 | "name": "data", 1421 | "inputType": { 1422 | "type": "PostUpdateWithoutAuthorDataInput", 1423 | "kind": "object", 1424 | "isRequired": true, 1425 | "isList": false 1426 | } 1427 | } 1428 | ] 1429 | }, 1430 | { 1431 | "name": "PostScalarWhereInput", 1432 | "fields": [ 1433 | { 1434 | "name": "AND", 1435 | "inputType": { 1436 | "type": "PostScalarWhereInput", 1437 | "kind": "object", 1438 | "isRequired": false, 1439 | "isList": true 1440 | } 1441 | }, 1442 | { 1443 | "name": "OR", 1444 | "inputType": { 1445 | "type": "PostScalarWhereInput", 1446 | "kind": "object", 1447 | "isRequired": false, 1448 | "isList": true 1449 | } 1450 | }, 1451 | { 1452 | "name": "NOT", 1453 | "inputType": { 1454 | "type": "PostScalarWhereInput", 1455 | "kind": "object", 1456 | "isRequired": false, 1457 | "isList": true 1458 | } 1459 | }, 1460 | { 1461 | "name": "id", 1462 | "inputType": { 1463 | "type": "ID", 1464 | "kind": "scalar", 1465 | "isRequired": false, 1466 | "isList": false 1467 | } 1468 | }, 1469 | { 1470 | "name": "id_not", 1471 | "inputType": { 1472 | "type": "ID", 1473 | "kind": "scalar", 1474 | "isRequired": false, 1475 | "isList": false 1476 | } 1477 | }, 1478 | { 1479 | "name": "id_in", 1480 | "inputType": { 1481 | "type": "ID", 1482 | "kind": "scalar", 1483 | "isRequired": false, 1484 | "isList": true 1485 | } 1486 | }, 1487 | { 1488 | "name": "id_not_in", 1489 | "inputType": { 1490 | "type": "ID", 1491 | "kind": "scalar", 1492 | "isRequired": false, 1493 | "isList": true 1494 | } 1495 | }, 1496 | { 1497 | "name": "id_lt", 1498 | "inputType": { 1499 | "type": "ID", 1500 | "kind": "scalar", 1501 | "isRequired": false, 1502 | "isList": false 1503 | } 1504 | }, 1505 | { 1506 | "name": "id_lte", 1507 | "inputType": { 1508 | "type": "ID", 1509 | "kind": "scalar", 1510 | "isRequired": false, 1511 | "isList": false 1512 | } 1513 | }, 1514 | { 1515 | "name": "id_gt", 1516 | "inputType": { 1517 | "type": "ID", 1518 | "kind": "scalar", 1519 | "isRequired": false, 1520 | "isList": false 1521 | } 1522 | }, 1523 | { 1524 | "name": "id_gte", 1525 | "inputType": { 1526 | "type": "ID", 1527 | "kind": "scalar", 1528 | "isRequired": false, 1529 | "isList": false 1530 | } 1531 | }, 1532 | { 1533 | "name": "id_contains", 1534 | "inputType": { 1535 | "type": "ID", 1536 | "kind": "scalar", 1537 | "isRequired": false, 1538 | "isList": false 1539 | } 1540 | }, 1541 | { 1542 | "name": "id_not_contains", 1543 | "inputType": { 1544 | "type": "ID", 1545 | "kind": "scalar", 1546 | "isRequired": false, 1547 | "isList": false 1548 | } 1549 | }, 1550 | { 1551 | "name": "id_starts_with", 1552 | "inputType": { 1553 | "type": "ID", 1554 | "kind": "scalar", 1555 | "isRequired": false, 1556 | "isList": false 1557 | } 1558 | }, 1559 | { 1560 | "name": "id_not_starts_with", 1561 | "inputType": { 1562 | "type": "ID", 1563 | "kind": "scalar", 1564 | "isRequired": false, 1565 | "isList": false 1566 | } 1567 | }, 1568 | { 1569 | "name": "id_ends_with", 1570 | "inputType": { 1571 | "type": "ID", 1572 | "kind": "scalar", 1573 | "isRequired": false, 1574 | "isList": false 1575 | } 1576 | }, 1577 | { 1578 | "name": "id_not_ends_with", 1579 | "inputType": { 1580 | "type": "ID", 1581 | "kind": "scalar", 1582 | "isRequired": false, 1583 | "isList": false 1584 | } 1585 | }, 1586 | { 1587 | "name": "createdAt", 1588 | "inputType": { 1589 | "type": "DateTime", 1590 | "kind": "scalar", 1591 | "isRequired": false, 1592 | "isList": false 1593 | } 1594 | }, 1595 | { 1596 | "name": "createdAt_not", 1597 | "inputType": { 1598 | "type": "DateTime", 1599 | "kind": "scalar", 1600 | "isRequired": false, 1601 | "isList": false 1602 | } 1603 | }, 1604 | { 1605 | "name": "createdAt_in", 1606 | "inputType": { 1607 | "type": "DateTime", 1608 | "kind": "scalar", 1609 | "isRequired": false, 1610 | "isList": true 1611 | } 1612 | }, 1613 | { 1614 | "name": "createdAt_not_in", 1615 | "inputType": { 1616 | "type": "DateTime", 1617 | "kind": "scalar", 1618 | "isRequired": false, 1619 | "isList": true 1620 | } 1621 | }, 1622 | { 1623 | "name": "createdAt_lt", 1624 | "inputType": { 1625 | "type": "DateTime", 1626 | "kind": "scalar", 1627 | "isRequired": false, 1628 | "isList": false 1629 | } 1630 | }, 1631 | { 1632 | "name": "createdAt_lte", 1633 | "inputType": { 1634 | "type": "DateTime", 1635 | "kind": "scalar", 1636 | "isRequired": false, 1637 | "isList": false 1638 | } 1639 | }, 1640 | { 1641 | "name": "createdAt_gt", 1642 | "inputType": { 1643 | "type": "DateTime", 1644 | "kind": "scalar", 1645 | "isRequired": false, 1646 | "isList": false 1647 | } 1648 | }, 1649 | { 1650 | "name": "createdAt_gte", 1651 | "inputType": { 1652 | "type": "DateTime", 1653 | "kind": "scalar", 1654 | "isRequired": false, 1655 | "isList": false 1656 | } 1657 | }, 1658 | { 1659 | "name": "updatedAt", 1660 | "inputType": { 1661 | "type": "DateTime", 1662 | "kind": "scalar", 1663 | "isRequired": false, 1664 | "isList": false 1665 | } 1666 | }, 1667 | { 1668 | "name": "updatedAt_not", 1669 | "inputType": { 1670 | "type": "DateTime", 1671 | "kind": "scalar", 1672 | "isRequired": false, 1673 | "isList": false 1674 | } 1675 | }, 1676 | { 1677 | "name": "updatedAt_in", 1678 | "inputType": { 1679 | "type": "DateTime", 1680 | "kind": "scalar", 1681 | "isRequired": false, 1682 | "isList": true 1683 | } 1684 | }, 1685 | { 1686 | "name": "updatedAt_not_in", 1687 | "inputType": { 1688 | "type": "DateTime", 1689 | "kind": "scalar", 1690 | "isRequired": false, 1691 | "isList": true 1692 | } 1693 | }, 1694 | { 1695 | "name": "updatedAt_lt", 1696 | "inputType": { 1697 | "type": "DateTime", 1698 | "kind": "scalar", 1699 | "isRequired": false, 1700 | "isList": false 1701 | } 1702 | }, 1703 | { 1704 | "name": "updatedAt_lte", 1705 | "inputType": { 1706 | "type": "DateTime", 1707 | "kind": "scalar", 1708 | "isRequired": false, 1709 | "isList": false 1710 | } 1711 | }, 1712 | { 1713 | "name": "updatedAt_gt", 1714 | "inputType": { 1715 | "type": "DateTime", 1716 | "kind": "scalar", 1717 | "isRequired": false, 1718 | "isList": false 1719 | } 1720 | }, 1721 | { 1722 | "name": "updatedAt_gte", 1723 | "inputType": { 1724 | "type": "DateTime", 1725 | "kind": "scalar", 1726 | "isRequired": false, 1727 | "isList": false 1728 | } 1729 | }, 1730 | { 1731 | "name": "published", 1732 | "inputType": { 1733 | "type": "Boolean", 1734 | "kind": "scalar", 1735 | "isRequired": false, 1736 | "isList": false 1737 | } 1738 | }, 1739 | { 1740 | "name": "published_not", 1741 | "inputType": { 1742 | "type": "Boolean", 1743 | "kind": "scalar", 1744 | "isRequired": false, 1745 | "isList": false 1746 | } 1747 | }, 1748 | { 1749 | "name": "title", 1750 | "inputType": { 1751 | "type": "String", 1752 | "kind": "scalar", 1753 | "isRequired": false, 1754 | "isList": false 1755 | } 1756 | }, 1757 | { 1758 | "name": "title_not", 1759 | "inputType": { 1760 | "type": "String", 1761 | "kind": "scalar", 1762 | "isRequired": false, 1763 | "isList": false 1764 | } 1765 | }, 1766 | { 1767 | "name": "title_in", 1768 | "inputType": { 1769 | "type": "String", 1770 | "kind": "scalar", 1771 | "isRequired": false, 1772 | "isList": true 1773 | } 1774 | }, 1775 | { 1776 | "name": "title_not_in", 1777 | "inputType": { 1778 | "type": "String", 1779 | "kind": "scalar", 1780 | "isRequired": false, 1781 | "isList": true 1782 | } 1783 | }, 1784 | { 1785 | "name": "title_lt", 1786 | "inputType": { 1787 | "type": "String", 1788 | "kind": "scalar", 1789 | "isRequired": false, 1790 | "isList": false 1791 | } 1792 | }, 1793 | { 1794 | "name": "title_lte", 1795 | "inputType": { 1796 | "type": "String", 1797 | "kind": "scalar", 1798 | "isRequired": false, 1799 | "isList": false 1800 | } 1801 | }, 1802 | { 1803 | "name": "title_gt", 1804 | "inputType": { 1805 | "type": "String", 1806 | "kind": "scalar", 1807 | "isRequired": false, 1808 | "isList": false 1809 | } 1810 | }, 1811 | { 1812 | "name": "title_gte", 1813 | "inputType": { 1814 | "type": "String", 1815 | "kind": "scalar", 1816 | "isRequired": false, 1817 | "isList": false 1818 | } 1819 | }, 1820 | { 1821 | "name": "title_contains", 1822 | "inputType": { 1823 | "type": "String", 1824 | "kind": "scalar", 1825 | "isRequired": false, 1826 | "isList": false 1827 | } 1828 | }, 1829 | { 1830 | "name": "title_not_contains", 1831 | "inputType": { 1832 | "type": "String", 1833 | "kind": "scalar", 1834 | "isRequired": false, 1835 | "isList": false 1836 | } 1837 | }, 1838 | { 1839 | "name": "title_starts_with", 1840 | "inputType": { 1841 | "type": "String", 1842 | "kind": "scalar", 1843 | "isRequired": false, 1844 | "isList": false 1845 | } 1846 | }, 1847 | { 1848 | "name": "title_not_starts_with", 1849 | "inputType": { 1850 | "type": "String", 1851 | "kind": "scalar", 1852 | "isRequired": false, 1853 | "isList": false 1854 | } 1855 | }, 1856 | { 1857 | "name": "title_ends_with", 1858 | "inputType": { 1859 | "type": "String", 1860 | "kind": "scalar", 1861 | "isRequired": false, 1862 | "isList": false 1863 | } 1864 | }, 1865 | { 1866 | "name": "title_not_ends_with", 1867 | "inputType": { 1868 | "type": "String", 1869 | "kind": "scalar", 1870 | "isRequired": false, 1871 | "isList": false 1872 | } 1873 | }, 1874 | { 1875 | "name": "content", 1876 | "inputType": { 1877 | "type": "String", 1878 | "kind": "scalar", 1879 | "isRequired": false, 1880 | "isList": false 1881 | } 1882 | }, 1883 | { 1884 | "name": "content_not", 1885 | "inputType": { 1886 | "type": "String", 1887 | "kind": "scalar", 1888 | "isRequired": false, 1889 | "isList": false 1890 | } 1891 | }, 1892 | { 1893 | "name": "content_in", 1894 | "inputType": { 1895 | "type": "String", 1896 | "kind": "scalar", 1897 | "isRequired": false, 1898 | "isList": true 1899 | } 1900 | }, 1901 | { 1902 | "name": "content_not_in", 1903 | "inputType": { 1904 | "type": "String", 1905 | "kind": "scalar", 1906 | "isRequired": false, 1907 | "isList": true 1908 | } 1909 | }, 1910 | { 1911 | "name": "content_lt", 1912 | "inputType": { 1913 | "type": "String", 1914 | "kind": "scalar", 1915 | "isRequired": false, 1916 | "isList": false 1917 | } 1918 | }, 1919 | { 1920 | "name": "content_lte", 1921 | "inputType": { 1922 | "type": "String", 1923 | "kind": "scalar", 1924 | "isRequired": false, 1925 | "isList": false 1926 | } 1927 | }, 1928 | { 1929 | "name": "content_gt", 1930 | "inputType": { 1931 | "type": "String", 1932 | "kind": "scalar", 1933 | "isRequired": false, 1934 | "isList": false 1935 | } 1936 | }, 1937 | { 1938 | "name": "content_gte", 1939 | "inputType": { 1940 | "type": "String", 1941 | "kind": "scalar", 1942 | "isRequired": false, 1943 | "isList": false 1944 | } 1945 | }, 1946 | { 1947 | "name": "content_contains", 1948 | "inputType": { 1949 | "type": "String", 1950 | "kind": "scalar", 1951 | "isRequired": false, 1952 | "isList": false 1953 | } 1954 | }, 1955 | { 1956 | "name": "content_not_contains", 1957 | "inputType": { 1958 | "type": "String", 1959 | "kind": "scalar", 1960 | "isRequired": false, 1961 | "isList": false 1962 | } 1963 | }, 1964 | { 1965 | "name": "content_starts_with", 1966 | "inputType": { 1967 | "type": "String", 1968 | "kind": "scalar", 1969 | "isRequired": false, 1970 | "isList": false 1971 | } 1972 | }, 1973 | { 1974 | "name": "content_not_starts_with", 1975 | "inputType": { 1976 | "type": "String", 1977 | "kind": "scalar", 1978 | "isRequired": false, 1979 | "isList": false 1980 | } 1981 | }, 1982 | { 1983 | "name": "content_ends_with", 1984 | "inputType": { 1985 | "type": "String", 1986 | "kind": "scalar", 1987 | "isRequired": false, 1988 | "isList": false 1989 | } 1990 | }, 1991 | { 1992 | "name": "content_not_ends_with", 1993 | "inputType": { 1994 | "type": "String", 1995 | "kind": "scalar", 1996 | "isRequired": false, 1997 | "isList": false 1998 | } 1999 | } 2000 | ] 2001 | }, 2002 | { 2003 | "name": "PostUpdateManyDataInput", 2004 | "fields": [ 2005 | { 2006 | "name": "id", 2007 | "inputType": { 2008 | "type": "ID", 2009 | "kind": "scalar", 2010 | "isRequired": false, 2011 | "isList": false 2012 | } 2013 | }, 2014 | { 2015 | "name": "createdAt", 2016 | "inputType": { 2017 | "type": "DateTime", 2018 | "kind": "scalar", 2019 | "isRequired": false, 2020 | "isList": false 2021 | } 2022 | }, 2023 | { 2024 | "name": "updatedAt", 2025 | "inputType": { 2026 | "type": "DateTime", 2027 | "kind": "scalar", 2028 | "isRequired": false, 2029 | "isList": false 2030 | } 2031 | }, 2032 | { 2033 | "name": "published", 2034 | "inputType": { 2035 | "type": "Boolean", 2036 | "kind": "scalar", 2037 | "isRequired": false, 2038 | "isList": false 2039 | } 2040 | }, 2041 | { 2042 | "name": "title", 2043 | "inputType": { 2044 | "type": "String", 2045 | "kind": "scalar", 2046 | "isRequired": false, 2047 | "isList": false 2048 | } 2049 | }, 2050 | { 2051 | "name": "content", 2052 | "inputType": { 2053 | "type": "String", 2054 | "kind": "scalar", 2055 | "isRequired": false, 2056 | "isList": false 2057 | } 2058 | } 2059 | ] 2060 | }, 2061 | { 2062 | "name": "PostUpdateManyWithWhereNestedInput", 2063 | "fields": [ 2064 | { 2065 | "name": "where", 2066 | "inputType": { 2067 | "type": "PostScalarWhereInput", 2068 | "kind": "object", 2069 | "isRequired": true, 2070 | "isList": false 2071 | } 2072 | }, 2073 | { 2074 | "name": "data", 2075 | "inputType": { 2076 | "type": "PostUpdateManyDataInput", 2077 | "kind": "object", 2078 | "isRequired": true, 2079 | "isList": false 2080 | } 2081 | } 2082 | ] 2083 | }, 2084 | { 2085 | "name": "PostUpsertWithWhereUniqueWithoutAuthorInput", 2086 | "fields": [ 2087 | { 2088 | "name": "where", 2089 | "inputType": { 2090 | "type": "PostWhereUniqueInput", 2091 | "kind": "object", 2092 | "isRequired": true, 2093 | "isList": false 2094 | } 2095 | }, 2096 | { 2097 | "name": "update", 2098 | "inputType": { 2099 | "type": "PostUpdateWithoutAuthorDataInput", 2100 | "kind": "object", 2101 | "isRequired": true, 2102 | "isList": false 2103 | } 2104 | }, 2105 | { 2106 | "name": "create", 2107 | "inputType": { 2108 | "type": "PostCreateWithoutAuthorInput", 2109 | "kind": "object", 2110 | "isRequired": true, 2111 | "isList": false 2112 | } 2113 | } 2114 | ] 2115 | }, 2116 | { 2117 | "name": "PostUpdateManyWithoutAuthorInput", 2118 | "fields": [ 2119 | { 2120 | "name": "create", 2121 | "inputType": { 2122 | "type": "PostCreateWithoutAuthorInput", 2123 | "kind": "object", 2124 | "isRequired": false, 2125 | "isList": true 2126 | } 2127 | }, 2128 | { 2129 | "name": "connect", 2130 | "inputType": { 2131 | "type": "PostWhereUniqueInput", 2132 | "kind": "object", 2133 | "isRequired": false, 2134 | "isList": true 2135 | } 2136 | }, 2137 | { 2138 | "name": "set", 2139 | "inputType": { 2140 | "type": "PostWhereUniqueInput", 2141 | "kind": "object", 2142 | "isRequired": false, 2143 | "isList": true 2144 | } 2145 | }, 2146 | { 2147 | "name": "disconnect", 2148 | "inputType": { 2149 | "type": "PostWhereUniqueInput", 2150 | "kind": "object", 2151 | "isRequired": false, 2152 | "isList": true 2153 | } 2154 | }, 2155 | { 2156 | "name": "delete", 2157 | "inputType": { 2158 | "type": "PostWhereUniqueInput", 2159 | "kind": "object", 2160 | "isRequired": false, 2161 | "isList": true 2162 | } 2163 | }, 2164 | { 2165 | "name": "update", 2166 | "inputType": { 2167 | "type": "PostUpdateWithWhereUniqueWithoutAuthorInput", 2168 | "kind": "object", 2169 | "isRequired": false, 2170 | "isList": true 2171 | } 2172 | }, 2173 | { 2174 | "name": "updateMany", 2175 | "inputType": { 2176 | "type": "PostUpdateManyWithWhereNestedInput", 2177 | "kind": "object", 2178 | "isRequired": false, 2179 | "isList": true 2180 | } 2181 | }, 2182 | { 2183 | "name": "deleteMany", 2184 | "inputType": { 2185 | "type": "PostScalarWhereInput", 2186 | "kind": "object", 2187 | "isRequired": false, 2188 | "isList": true 2189 | } 2190 | }, 2191 | { 2192 | "name": "upsert", 2193 | "inputType": { 2194 | "type": "PostUpsertWithWhereUniqueWithoutAuthorInput", 2195 | "kind": "object", 2196 | "isRequired": false, 2197 | "isList": true 2198 | } 2199 | } 2200 | ] 2201 | }, 2202 | { 2203 | "name": "UserUpdateInput", 2204 | "fields": [ 2205 | { 2206 | "name": "id", 2207 | "inputType": { 2208 | "type": "ID", 2209 | "kind": "scalar", 2210 | "isRequired": false, 2211 | "isList": false 2212 | } 2213 | }, 2214 | { 2215 | "name": "email", 2216 | "inputType": { 2217 | "type": "String", 2218 | "kind": "scalar", 2219 | "isRequired": false, 2220 | "isList": false 2221 | } 2222 | }, 2223 | { 2224 | "name": "name", 2225 | "inputType": { 2226 | "type": "String", 2227 | "kind": "scalar", 2228 | "isRequired": false, 2229 | "isList": false 2230 | } 2231 | }, 2232 | { 2233 | "name": "posts", 2234 | "inputType": { 2235 | "type": "PostUpdateManyWithoutAuthorInput", 2236 | "kind": "object", 2237 | "isRequired": false, 2238 | "isList": false 2239 | } 2240 | } 2241 | ] 2242 | }, 2243 | { 2244 | "name": "UserUpdateManyMutationInput", 2245 | "fields": [ 2246 | { 2247 | "name": "id", 2248 | "inputType": { 2249 | "type": "ID", 2250 | "kind": "scalar", 2251 | "isRequired": false, 2252 | "isList": false 2253 | } 2254 | }, 2255 | { 2256 | "name": "email", 2257 | "inputType": { 2258 | "type": "String", 2259 | "kind": "scalar", 2260 | "isRequired": false, 2261 | "isList": false 2262 | } 2263 | }, 2264 | { 2265 | "name": "name", 2266 | "inputType": { 2267 | "type": "String", 2268 | "kind": "scalar", 2269 | "isRequired": false, 2270 | "isList": false 2271 | } 2272 | } 2273 | ] 2274 | }, 2275 | { 2276 | "name": "UserCreateWithoutPostsInput", 2277 | "fields": [ 2278 | { 2279 | "name": "id", 2280 | "inputType": { 2281 | "type": "ID", 2282 | "kind": "scalar", 2283 | "isRequired": false, 2284 | "isList": false 2285 | } 2286 | }, 2287 | { 2288 | "name": "email", 2289 | "inputType": { 2290 | "type": "String", 2291 | "kind": "scalar", 2292 | "isRequired": true, 2293 | "isList": false 2294 | } 2295 | }, 2296 | { 2297 | "name": "name", 2298 | "inputType": { 2299 | "type": "String", 2300 | "kind": "scalar", 2301 | "isRequired": false, 2302 | "isList": false 2303 | } 2304 | } 2305 | ] 2306 | }, 2307 | { 2308 | "name": "UserCreateOneWithoutAuthorInput", 2309 | "fields": [ 2310 | { 2311 | "name": "create", 2312 | "inputType": { 2313 | "type": "UserCreateWithoutPostsInput", 2314 | "kind": "object", 2315 | "isRequired": false, 2316 | "isList": false 2317 | } 2318 | }, 2319 | { 2320 | "name": "connect", 2321 | "inputType": { 2322 | "type": "UserWhereUniqueInput", 2323 | "kind": "object", 2324 | "isRequired": false, 2325 | "isList": false 2326 | } 2327 | } 2328 | ] 2329 | }, 2330 | { 2331 | "name": "PostCreateInput", 2332 | "fields": [ 2333 | { 2334 | "name": "id", 2335 | "inputType": { 2336 | "type": "ID", 2337 | "kind": "scalar", 2338 | "isRequired": false, 2339 | "isList": false 2340 | } 2341 | }, 2342 | { 2343 | "name": "createdAt", 2344 | "inputType": { 2345 | "type": "DateTime", 2346 | "kind": "scalar", 2347 | "isRequired": false, 2348 | "isList": false 2349 | } 2350 | }, 2351 | { 2352 | "name": "updatedAt", 2353 | "inputType": { 2354 | "type": "DateTime", 2355 | "kind": "scalar", 2356 | "isRequired": false, 2357 | "isList": false 2358 | } 2359 | }, 2360 | { 2361 | "name": "published", 2362 | "inputType": { 2363 | "type": "Boolean", 2364 | "kind": "scalar", 2365 | "isRequired": true, 2366 | "isList": false 2367 | } 2368 | }, 2369 | { 2370 | "name": "title", 2371 | "inputType": { 2372 | "type": "String", 2373 | "kind": "scalar", 2374 | "isRequired": true, 2375 | "isList": false 2376 | } 2377 | }, 2378 | { 2379 | "name": "content", 2380 | "inputType": { 2381 | "type": "String", 2382 | "kind": "scalar", 2383 | "isRequired": false, 2384 | "isList": false 2385 | } 2386 | }, 2387 | { 2388 | "name": "author", 2389 | "inputType": { 2390 | "type": "UserCreateOneWithoutAuthorInput", 2391 | "kind": "object", 2392 | "isRequired": false, 2393 | "isList": false 2394 | } 2395 | } 2396 | ] 2397 | }, 2398 | { 2399 | "name": "UserUpdateWithoutPostsDataInput", 2400 | "fields": [ 2401 | { 2402 | "name": "id", 2403 | "inputType": { 2404 | "type": "ID", 2405 | "kind": "scalar", 2406 | "isRequired": false, 2407 | "isList": false 2408 | } 2409 | }, 2410 | { 2411 | "name": "email", 2412 | "inputType": { 2413 | "type": "String", 2414 | "kind": "scalar", 2415 | "isRequired": false, 2416 | "isList": false 2417 | } 2418 | }, 2419 | { 2420 | "name": "name", 2421 | "inputType": { 2422 | "type": "String", 2423 | "kind": "scalar", 2424 | "isRequired": false, 2425 | "isList": false 2426 | } 2427 | } 2428 | ] 2429 | }, 2430 | { 2431 | "name": "UserUpsertWithoutPostsInput", 2432 | "fields": [ 2433 | { 2434 | "name": "update", 2435 | "inputType": { 2436 | "type": "UserUpdateWithoutPostsDataInput", 2437 | "kind": "object", 2438 | "isRequired": true, 2439 | "isList": false 2440 | } 2441 | }, 2442 | { 2443 | "name": "create", 2444 | "inputType": { 2445 | "type": "UserCreateWithoutPostsInput", 2446 | "kind": "object", 2447 | "isRequired": true, 2448 | "isList": false 2449 | } 2450 | } 2451 | ] 2452 | }, 2453 | { 2454 | "name": "UserUpdateOneWithoutPostsInput", 2455 | "fields": [ 2456 | { 2457 | "name": "create", 2458 | "inputType": { 2459 | "type": "UserCreateWithoutPostsInput", 2460 | "kind": "object", 2461 | "isRequired": false, 2462 | "isList": false 2463 | } 2464 | }, 2465 | { 2466 | "name": "connect", 2467 | "inputType": { 2468 | "type": "UserWhereUniqueInput", 2469 | "kind": "object", 2470 | "isRequired": false, 2471 | "isList": false 2472 | } 2473 | }, 2474 | { 2475 | "name": "disconnect", 2476 | "inputType": { 2477 | "type": "Boolean", 2478 | "kind": "scalar", 2479 | "isRequired": false, 2480 | "isList": false 2481 | } 2482 | }, 2483 | { 2484 | "name": "delete", 2485 | "inputType": { 2486 | "type": "Boolean", 2487 | "kind": "scalar", 2488 | "isRequired": false, 2489 | "isList": false 2490 | } 2491 | }, 2492 | { 2493 | "name": "update", 2494 | "inputType": { 2495 | "type": "UserUpdateWithoutPostsDataInput", 2496 | "kind": "object", 2497 | "isRequired": false, 2498 | "isList": false 2499 | } 2500 | }, 2501 | { 2502 | "name": "upsert", 2503 | "inputType": { 2504 | "type": "UserUpsertWithoutPostsInput", 2505 | "kind": "object", 2506 | "isRequired": false, 2507 | "isList": false 2508 | } 2509 | } 2510 | ] 2511 | }, 2512 | { 2513 | "name": "PostUpdateInput", 2514 | "fields": [ 2515 | { 2516 | "name": "id", 2517 | "inputType": { 2518 | "type": "ID", 2519 | "kind": "scalar", 2520 | "isRequired": false, 2521 | "isList": false 2522 | } 2523 | }, 2524 | { 2525 | "name": "createdAt", 2526 | "inputType": { 2527 | "type": "DateTime", 2528 | "kind": "scalar", 2529 | "isRequired": false, 2530 | "isList": false 2531 | } 2532 | }, 2533 | { 2534 | "name": "updatedAt", 2535 | "inputType": { 2536 | "type": "DateTime", 2537 | "kind": "scalar", 2538 | "isRequired": false, 2539 | "isList": false 2540 | } 2541 | }, 2542 | { 2543 | "name": "published", 2544 | "inputType": { 2545 | "type": "Boolean", 2546 | "kind": "scalar", 2547 | "isRequired": false, 2548 | "isList": false 2549 | } 2550 | }, 2551 | { 2552 | "name": "title", 2553 | "inputType": { 2554 | "type": "String", 2555 | "kind": "scalar", 2556 | "isRequired": false, 2557 | "isList": false 2558 | } 2559 | }, 2560 | { 2561 | "name": "content", 2562 | "inputType": { 2563 | "type": "String", 2564 | "kind": "scalar", 2565 | "isRequired": false, 2566 | "isList": false 2567 | } 2568 | }, 2569 | { 2570 | "name": "author", 2571 | "inputType": { 2572 | "type": "UserUpdateOneWithoutPostsInput", 2573 | "kind": "object", 2574 | "isRequired": false, 2575 | "isList": false 2576 | } 2577 | } 2578 | ] 2579 | }, 2580 | { 2581 | "name": "PostUpdateManyMutationInput", 2582 | "fields": [ 2583 | { 2584 | "name": "id", 2585 | "inputType": { 2586 | "type": "ID", 2587 | "kind": "scalar", 2588 | "isRequired": false, 2589 | "isList": false 2590 | } 2591 | }, 2592 | { 2593 | "name": "createdAt", 2594 | "inputType": { 2595 | "type": "DateTime", 2596 | "kind": "scalar", 2597 | "isRequired": false, 2598 | "isList": false 2599 | } 2600 | }, 2601 | { 2602 | "name": "updatedAt", 2603 | "inputType": { 2604 | "type": "DateTime", 2605 | "kind": "scalar", 2606 | "isRequired": false, 2607 | "isList": false 2608 | } 2609 | }, 2610 | { 2611 | "name": "published", 2612 | "inputType": { 2613 | "type": "Boolean", 2614 | "kind": "scalar", 2615 | "isRequired": false, 2616 | "isList": false 2617 | } 2618 | }, 2619 | { 2620 | "name": "title", 2621 | "inputType": { 2622 | "type": "String", 2623 | "kind": "scalar", 2624 | "isRequired": false, 2625 | "isList": false 2626 | } 2627 | }, 2628 | { 2629 | "name": "content", 2630 | "inputType": { 2631 | "type": "String", 2632 | "kind": "scalar", 2633 | "isRequired": false, 2634 | "isList": false 2635 | } 2636 | } 2637 | ] 2638 | } 2639 | ], 2640 | "outputTypes": [ 2641 | { 2642 | "name": "Post", 2643 | "fields": [ 2644 | { 2645 | "name": "id", 2646 | "args": [], 2647 | "outputType": { 2648 | "type": "ID", 2649 | "kind": "scalar", 2650 | "isRequired": true, 2651 | "isList": false 2652 | } 2653 | }, 2654 | { 2655 | "name": "createdAt", 2656 | "args": [], 2657 | "outputType": { 2658 | "type": "DateTime", 2659 | "kind": "scalar", 2660 | "isRequired": true, 2661 | "isList": false 2662 | } 2663 | }, 2664 | { 2665 | "name": "updatedAt", 2666 | "args": [], 2667 | "outputType": { 2668 | "type": "DateTime", 2669 | "kind": "scalar", 2670 | "isRequired": true, 2671 | "isList": false 2672 | } 2673 | }, 2674 | { 2675 | "name": "published", 2676 | "args": [], 2677 | "outputType": { 2678 | "type": "Boolean", 2679 | "kind": "scalar", 2680 | "isRequired": true, 2681 | "isList": false 2682 | } 2683 | }, 2684 | { 2685 | "name": "title", 2686 | "args": [], 2687 | "outputType": { 2688 | "type": "String", 2689 | "kind": "scalar", 2690 | "isRequired": true, 2691 | "isList": false 2692 | } 2693 | }, 2694 | { 2695 | "name": "content", 2696 | "args": [], 2697 | "outputType": { 2698 | "type": "String", 2699 | "kind": "scalar", 2700 | "isRequired": false, 2701 | "isList": false 2702 | } 2703 | }, 2704 | { 2705 | "name": "author", 2706 | "args": [], 2707 | "outputType": { 2708 | "type": "User", 2709 | "kind": "object", 2710 | "isRequired": false, 2711 | "isList": false 2712 | } 2713 | } 2714 | ] 2715 | }, 2716 | { 2717 | "name": "User", 2718 | "fields": [ 2719 | { 2720 | "name": "id", 2721 | "args": [], 2722 | "outputType": { 2723 | "type": "ID", 2724 | "kind": "scalar", 2725 | "isRequired": true, 2726 | "isList": false 2727 | } 2728 | }, 2729 | { 2730 | "name": "email", 2731 | "args": [], 2732 | "outputType": { 2733 | "type": "String", 2734 | "kind": "scalar", 2735 | "isRequired": true, 2736 | "isList": false 2737 | } 2738 | }, 2739 | { 2740 | "name": "name", 2741 | "args": [], 2742 | "outputType": { 2743 | "type": "String", 2744 | "kind": "scalar", 2745 | "isRequired": false, 2746 | "isList": false 2747 | } 2748 | }, 2749 | { 2750 | "name": "posts", 2751 | "args": [ 2752 | { 2753 | "name": "where", 2754 | "inputType": { 2755 | "type": "PostWhereInput", 2756 | "kind": "object", 2757 | "isRequired": false, 2758 | "isList": false 2759 | } 2760 | }, 2761 | { 2762 | "name": "orderBy", 2763 | "inputType": { 2764 | "type": "PostOrderByInput", 2765 | "kind": "enum", 2766 | "isRequired": false, 2767 | "isList": false 2768 | } 2769 | }, 2770 | { 2771 | "name": "skip", 2772 | "inputType": { 2773 | "type": "Int", 2774 | "kind": "scalar", 2775 | "isRequired": false, 2776 | "isList": false 2777 | } 2778 | }, 2779 | { 2780 | "name": "after", 2781 | "inputType": { 2782 | "type": "ID", 2783 | "kind": "scalar", 2784 | "isRequired": false, 2785 | "isList": false 2786 | } 2787 | }, 2788 | { 2789 | "name": "before", 2790 | "inputType": { 2791 | "type": "ID", 2792 | "kind": "scalar", 2793 | "isRequired": false, 2794 | "isList": false 2795 | } 2796 | }, 2797 | { 2798 | "name": "first", 2799 | "inputType": { 2800 | "type": "Int", 2801 | "kind": "scalar", 2802 | "isRequired": false, 2803 | "isList": false 2804 | } 2805 | }, 2806 | { 2807 | "name": "last", 2808 | "inputType": { 2809 | "type": "Int", 2810 | "kind": "scalar", 2811 | "isRequired": false, 2812 | "isList": false 2813 | } 2814 | } 2815 | ], 2816 | "outputType": { 2817 | "type": "Post", 2818 | "kind": "object", 2819 | "isRequired": false, 2820 | "isList": true 2821 | } 2822 | } 2823 | ] 2824 | }, 2825 | { 2826 | "name": "AggregateUser", 2827 | "fields": [ 2828 | { 2829 | "name": "count", 2830 | "args": [], 2831 | "outputType": { 2832 | "type": "Int", 2833 | "kind": "scalar", 2834 | "isRequired": true, 2835 | "isList": false 2836 | } 2837 | } 2838 | ] 2839 | }, 2840 | { 2841 | "name": "AggregatePost", 2842 | "fields": [ 2843 | { 2844 | "name": "count", 2845 | "args": [], 2846 | "outputType": { 2847 | "type": "Int", 2848 | "kind": "scalar", 2849 | "isRequired": true, 2850 | "isList": false 2851 | } 2852 | } 2853 | ] 2854 | }, 2855 | { 2856 | "name": "Query", 2857 | "fields": [ 2858 | { 2859 | "name": "findManyUser", 2860 | "args": [ 2861 | { 2862 | "name": "where", 2863 | "inputType": { 2864 | "type": "UserWhereInput", 2865 | "kind": "object", 2866 | "isRequired": false, 2867 | "isList": false 2868 | } 2869 | }, 2870 | { 2871 | "name": "orderBy", 2872 | "inputType": { 2873 | "type": "UserOrderByInput", 2874 | "kind": "enum", 2875 | "isRequired": false, 2876 | "isList": false 2877 | } 2878 | }, 2879 | { 2880 | "name": "skip", 2881 | "inputType": { 2882 | "type": "Int", 2883 | "kind": "scalar", 2884 | "isRequired": false, 2885 | "isList": false 2886 | } 2887 | }, 2888 | { 2889 | "name": "after", 2890 | "inputType": { 2891 | "type": "ID", 2892 | "kind": "scalar", 2893 | "isRequired": false, 2894 | "isList": false 2895 | } 2896 | }, 2897 | { 2898 | "name": "before", 2899 | "inputType": { 2900 | "type": "ID", 2901 | "kind": "scalar", 2902 | "isRequired": false, 2903 | "isList": false 2904 | } 2905 | }, 2906 | { 2907 | "name": "first", 2908 | "inputType": { 2909 | "type": "Int", 2910 | "kind": "scalar", 2911 | "isRequired": false, 2912 | "isList": false 2913 | } 2914 | }, 2915 | { 2916 | "name": "last", 2917 | "inputType": { 2918 | "type": "Int", 2919 | "kind": "scalar", 2920 | "isRequired": false, 2921 | "isList": false 2922 | } 2923 | } 2924 | ], 2925 | "outputType": { 2926 | "type": "User", 2927 | "kind": "object", 2928 | "isRequired": true, 2929 | "isList": true 2930 | } 2931 | }, 2932 | { 2933 | "name": "aggregateUser", 2934 | "args": [], 2935 | "outputType": { 2936 | "type": "AggregateUser", 2937 | "kind": "object", 2938 | "isRequired": true, 2939 | "isList": false 2940 | } 2941 | }, 2942 | { 2943 | "name": "findOneUser", 2944 | "args": [ 2945 | { 2946 | "name": "where", 2947 | "inputType": { 2948 | "type": "UserWhereUniqueInput", 2949 | "kind": "object", 2950 | "isRequired": true, 2951 | "isList": false 2952 | } 2953 | } 2954 | ], 2955 | "outputType": { 2956 | "type": "User", 2957 | "kind": "object", 2958 | "isRequired": false, 2959 | "isList": false 2960 | } 2961 | }, 2962 | { 2963 | "name": "findManyPost", 2964 | "args": [ 2965 | { 2966 | "name": "where", 2967 | "inputType": { 2968 | "type": "PostWhereInput", 2969 | "kind": "object", 2970 | "isRequired": false, 2971 | "isList": false 2972 | } 2973 | }, 2974 | { 2975 | "name": "orderBy", 2976 | "inputType": { 2977 | "type": "PostOrderByInput", 2978 | "kind": "enum", 2979 | "isRequired": false, 2980 | "isList": false 2981 | } 2982 | }, 2983 | { 2984 | "name": "skip", 2985 | "inputType": { 2986 | "type": "Int", 2987 | "kind": "scalar", 2988 | "isRequired": false, 2989 | "isList": false 2990 | } 2991 | }, 2992 | { 2993 | "name": "after", 2994 | "inputType": { 2995 | "type": "ID", 2996 | "kind": "scalar", 2997 | "isRequired": false, 2998 | "isList": false 2999 | } 3000 | }, 3001 | { 3002 | "name": "before", 3003 | "inputType": { 3004 | "type": "ID", 3005 | "kind": "scalar", 3006 | "isRequired": false, 3007 | "isList": false 3008 | } 3009 | }, 3010 | { 3011 | "name": "first", 3012 | "inputType": { 3013 | "type": "Int", 3014 | "kind": "scalar", 3015 | "isRequired": false, 3016 | "isList": false 3017 | } 3018 | }, 3019 | { 3020 | "name": "last", 3021 | "inputType": { 3022 | "type": "Int", 3023 | "kind": "scalar", 3024 | "isRequired": false, 3025 | "isList": false 3026 | } 3027 | } 3028 | ], 3029 | "outputType": { 3030 | "type": "Post", 3031 | "kind": "object", 3032 | "isRequired": true, 3033 | "isList": true 3034 | } 3035 | }, 3036 | { 3037 | "name": "aggregatePost", 3038 | "args": [], 3039 | "outputType": { 3040 | "type": "AggregatePost", 3041 | "kind": "object", 3042 | "isRequired": true, 3043 | "isList": false 3044 | } 3045 | }, 3046 | { 3047 | "name": "findOnePost", 3048 | "args": [ 3049 | { 3050 | "name": "where", 3051 | "inputType": { 3052 | "type": "PostWhereUniqueInput", 3053 | "kind": "object", 3054 | "isRequired": true, 3055 | "isList": false 3056 | } 3057 | } 3058 | ], 3059 | "outputType": { 3060 | "type": "Post", 3061 | "kind": "object", 3062 | "isRequired": false, 3063 | "isList": false 3064 | } 3065 | } 3066 | ] 3067 | }, 3068 | { 3069 | "name": "BatchPayload", 3070 | "fields": [ 3071 | { 3072 | "name": "count", 3073 | "args": [], 3074 | "outputType": { 3075 | "type": "Int", 3076 | "kind": "scalar", 3077 | "isRequired": true, 3078 | "isList": false 3079 | } 3080 | } 3081 | ] 3082 | }, 3083 | { 3084 | "name": "Mutation", 3085 | "fields": [ 3086 | { 3087 | "name": "createOneUser", 3088 | "args": [ 3089 | { 3090 | "name": "data", 3091 | "inputType": { 3092 | "type": "UserCreateInput", 3093 | "kind": "object", 3094 | "isRequired": true, 3095 | "isList": false 3096 | } 3097 | } 3098 | ], 3099 | "outputType": { 3100 | "type": "User", 3101 | "kind": "object", 3102 | "isRequired": true, 3103 | "isList": false 3104 | } 3105 | }, 3106 | { 3107 | "name": "deleteOneUser", 3108 | "args": [ 3109 | { 3110 | "name": "where", 3111 | "inputType": { 3112 | "type": "UserWhereUniqueInput", 3113 | "kind": "object", 3114 | "isRequired": true, 3115 | "isList": false 3116 | } 3117 | } 3118 | ], 3119 | "outputType": { 3120 | "type": "User", 3121 | "kind": "object", 3122 | "isRequired": false, 3123 | "isList": false 3124 | } 3125 | }, 3126 | { 3127 | "name": "updateOneUser", 3128 | "args": [ 3129 | { 3130 | "name": "data", 3131 | "inputType": { 3132 | "type": "UserUpdateInput", 3133 | "kind": "object", 3134 | "isRequired": true, 3135 | "isList": false 3136 | } 3137 | }, 3138 | { 3139 | "name": "where", 3140 | "inputType": { 3141 | "type": "UserWhereUniqueInput", 3142 | "kind": "object", 3143 | "isRequired": true, 3144 | "isList": false 3145 | } 3146 | } 3147 | ], 3148 | "outputType": { 3149 | "type": "User", 3150 | "kind": "object", 3151 | "isRequired": false, 3152 | "isList": false 3153 | } 3154 | }, 3155 | { 3156 | "name": "upsertOneUser", 3157 | "args": [ 3158 | { 3159 | "name": "where", 3160 | "inputType": { 3161 | "type": "UserWhereUniqueInput", 3162 | "kind": "object", 3163 | "isRequired": true, 3164 | "isList": false 3165 | } 3166 | }, 3167 | { 3168 | "name": "create", 3169 | "inputType": { 3170 | "type": "UserCreateInput", 3171 | "kind": "object", 3172 | "isRequired": true, 3173 | "isList": false 3174 | } 3175 | }, 3176 | { 3177 | "name": "update", 3178 | "inputType": { 3179 | "type": "UserUpdateInput", 3180 | "kind": "object", 3181 | "isRequired": true, 3182 | "isList": false 3183 | } 3184 | } 3185 | ], 3186 | "outputType": { 3187 | "type": "User", 3188 | "kind": "object", 3189 | "isRequired": true, 3190 | "isList": false 3191 | } 3192 | }, 3193 | { 3194 | "name": "updateManyUser", 3195 | "args": [ 3196 | { 3197 | "name": "data", 3198 | "inputType": { 3199 | "type": "UserUpdateManyMutationInput", 3200 | "kind": "object", 3201 | "isRequired": true, 3202 | "isList": false 3203 | } 3204 | }, 3205 | { 3206 | "name": "where", 3207 | "inputType": { 3208 | "type": "UserWhereInput", 3209 | "kind": "object", 3210 | "isRequired": false, 3211 | "isList": false 3212 | } 3213 | } 3214 | ], 3215 | "outputType": { 3216 | "type": "BatchPayload", 3217 | "kind": "object", 3218 | "isRequired": true, 3219 | "isList": false 3220 | } 3221 | }, 3222 | { 3223 | "name": "deleteManyUser", 3224 | "args": [ 3225 | { 3226 | "name": "where", 3227 | "inputType": { 3228 | "type": "UserWhereInput", 3229 | "kind": "object", 3230 | "isRequired": false, 3231 | "isList": false 3232 | } 3233 | } 3234 | ], 3235 | "outputType": { 3236 | "type": "BatchPayload", 3237 | "kind": "object", 3238 | "isRequired": true, 3239 | "isList": false 3240 | } 3241 | }, 3242 | { 3243 | "name": "createOnePost", 3244 | "args": [ 3245 | { 3246 | "name": "data", 3247 | "inputType": { 3248 | "type": "PostCreateInput", 3249 | "kind": "object", 3250 | "isRequired": true, 3251 | "isList": false 3252 | } 3253 | } 3254 | ], 3255 | "outputType": { 3256 | "type": "Post", 3257 | "kind": "object", 3258 | "isRequired": true, 3259 | "isList": false 3260 | } 3261 | }, 3262 | { 3263 | "name": "deleteOnePost", 3264 | "args": [ 3265 | { 3266 | "name": "where", 3267 | "inputType": { 3268 | "type": "PostWhereUniqueInput", 3269 | "kind": "object", 3270 | "isRequired": true, 3271 | "isList": false 3272 | } 3273 | } 3274 | ], 3275 | "outputType": { 3276 | "type": "Post", 3277 | "kind": "object", 3278 | "isRequired": false, 3279 | "isList": false 3280 | } 3281 | }, 3282 | { 3283 | "name": "updateOnePost", 3284 | "args": [ 3285 | { 3286 | "name": "data", 3287 | "inputType": { 3288 | "type": "PostUpdateInput", 3289 | "kind": "object", 3290 | "isRequired": true, 3291 | "isList": false 3292 | } 3293 | }, 3294 | { 3295 | "name": "where", 3296 | "inputType": { 3297 | "type": "PostWhereUniqueInput", 3298 | "kind": "object", 3299 | "isRequired": true, 3300 | "isList": false 3301 | } 3302 | } 3303 | ], 3304 | "outputType": { 3305 | "type": "Post", 3306 | "kind": "object", 3307 | "isRequired": false, 3308 | "isList": false 3309 | } 3310 | }, 3311 | { 3312 | "name": "upsertOnePost", 3313 | "args": [ 3314 | { 3315 | "name": "where", 3316 | "inputType": { 3317 | "type": "PostWhereUniqueInput", 3318 | "kind": "object", 3319 | "isRequired": true, 3320 | "isList": false 3321 | } 3322 | }, 3323 | { 3324 | "name": "create", 3325 | "inputType": { 3326 | "type": "PostCreateInput", 3327 | "kind": "object", 3328 | "isRequired": true, 3329 | "isList": false 3330 | } 3331 | }, 3332 | { 3333 | "name": "update", 3334 | "inputType": { 3335 | "type": "PostUpdateInput", 3336 | "kind": "object", 3337 | "isRequired": true, 3338 | "isList": false 3339 | } 3340 | } 3341 | ], 3342 | "outputType": { 3343 | "type": "Post", 3344 | "kind": "object", 3345 | "isRequired": true, 3346 | "isList": false 3347 | } 3348 | }, 3349 | { 3350 | "name": "updateManyPost", 3351 | "args": [ 3352 | { 3353 | "name": "data", 3354 | "inputType": { 3355 | "type": "PostUpdateManyMutationInput", 3356 | "kind": "object", 3357 | "isRequired": true, 3358 | "isList": false 3359 | } 3360 | }, 3361 | { 3362 | "name": "where", 3363 | "inputType": { 3364 | "type": "PostWhereInput", 3365 | "kind": "object", 3366 | "isRequired": false, 3367 | "isList": false 3368 | } 3369 | } 3370 | ], 3371 | "outputType": { 3372 | "type": "BatchPayload", 3373 | "kind": "object", 3374 | "isRequired": true, 3375 | "isList": false 3376 | } 3377 | }, 3378 | { 3379 | "name": "deleteManyPost", 3380 | "args": [ 3381 | { 3382 | "name": "where", 3383 | "inputType": { 3384 | "type": "PostWhereInput", 3385 | "kind": "object", 3386 | "isRequired": false, 3387 | "isList": false 3388 | } 3389 | } 3390 | ], 3391 | "outputType": { 3392 | "type": "BatchPayload", 3393 | "kind": "object", 3394 | "isRequired": true, 3395 | "isList": false 3396 | } 3397 | } 3398 | ] 3399 | } 3400 | ], 3401 | "enums": [ 3402 | { 3403 | "name": "UserOrderByInput", 3404 | "values": [ 3405 | "id_ASC", 3406 | "id_DESC", 3407 | "email_ASC", 3408 | "email_DESC", 3409 | "name_ASC", 3410 | "name_DESC" 3411 | ] 3412 | }, 3413 | { 3414 | "name": "PostOrderByInput", 3415 | "values": [ 3416 | "id_ASC", 3417 | "id_DESC", 3418 | "createdAt_ASC", 3419 | "createdAt_DESC", 3420 | "updatedAt_ASC", 3421 | "updatedAt_DESC", 3422 | "published_ASC", 3423 | "published_DESC", 3424 | "title_ASC", 3425 | "title_DESC", 3426 | "content_ASC", 3427 | "content_DESC" 3428 | ] 3429 | } 3430 | ] 3431 | }, 3432 | "mappings": [ 3433 | { 3434 | "model": "User", 3435 | "aggregate": "aggregateUser", 3436 | "createOne": "createOneUser", 3437 | "deleteMany": "deleteManyUser", 3438 | "deleteOne": "deleteOneUser", 3439 | "findMany": "findManyUser", 3440 | "findOne": "findOneUser", 3441 | "updateMany": "updateManyUser", 3442 | "updateOne": "updateOneUser", 3443 | "upsertOne": "upsertOneUser" 3444 | }, 3445 | { 3446 | "model": "Post", 3447 | "aggregate": "aggregatePost", 3448 | "createOne": "createOnePost", 3449 | "deleteMany": "deleteManyPost", 3450 | "deleteOne": "deleteOnePost", 3451 | "findMany": "findManyPost", 3452 | "findOne": "findOnePost", 3453 | "updateMany": "updateManyPost", 3454 | "updateOne": "updateOnePost", 3455 | "upsertOne": "upsertOnePost" 3456 | } 3457 | ] 3458 | } 3459 | -------------------------------------------------------------------------------- /example/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Naph 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | -------------------------------------------------------------------------------- /example/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom'; 3 | import App from './App'; 4 | 5 | 6 | ReactDOM.render( 7 | , 8 | document.getElementById('reactroot') 9 | ); 10 | -------------------------------------------------------------------------------- /example/node.css: -------------------------------------------------------------------------------- 1 | /* node stuff */ 2 | 3 | 4 | body { 5 | font-family: 'Source Sans Pro', sans-serif; 6 | color: #323232; 7 | line-height: 20px; 8 | overflow-x: hidden; 9 | font-size: 14px; 10 | margin: 0; 11 | font-weight: 400; 12 | background-color:rgb(244, 248, 250); 13 | text-rendering:optimizeLegibility; 14 | -webkit-font-smoothing: antialiased; 15 | -moz-font-smoothing: antialiased; 16 | } 17 | 18 | 19 | .node { 20 | position: absolute; 21 | width:200px; 22 | border-radius: 4px; 23 | -webkit-box-shadow: 6px 6px 28px -2px rgba(0,0,0,0.4); 24 | -moz-box-shadow: 6px 6px 28px -2px rgba(0,0,0,0.4); 25 | box-shadow: 6px 6px 28px -2px rgba(0,0,0,0.4); 26 | background-color:white; 27 | user-select: none; 28 | } 29 | 30 | .node.selected { 31 | border: 0px solid #15BD76; 32 | box-shadow: 0 0 10px 0px #15bd765e; 33 | } 34 | 35 | .node-seperator { 36 | color: rgb(239, 243, 245);; 37 | border-color: rgb(239, 243, 245);; 38 | } 39 | 40 | .node-content { 41 | padding: 10px; 42 | } 43 | 44 | .node-title { 45 | font-size:10px; 46 | } 47 | 48 | .node-header { 49 | cursor: all-scroll; 50 | 51 | background: #15BD76; 52 | 53 | padding-left: 10px; 54 | text-transform: uppercase; 55 | 56 | border-top-left-radius: 4px; 57 | border-top-right-radius: 4px; 58 | 59 | border-bottom: 1px solid #808080af; 60 | 61 | padding-top: 3px; 62 | height: 23px; 63 | 64 | font-size: 13px; 65 | letter-spacing: 1px; 66 | 67 | color:white; 68 | font-weight: 600; 69 | } 70 | 71 | .connector { 72 | fill:none; 73 | stroke:#dadada; 74 | stroke-width:2; 75 | -webkit-box-shadow: 6px 6px 28px -2px rgba(0,0,0,0.75); 76 | -moz-box-shadow: 6px 6px 28px -2px rgba(0,0,0,0.75); 77 | box-shadow: 6px 6px 28px -2px rgba(0,0,0,0.75); 78 | -webkit-filter: drop-shadow( -5px -5px 5px #000 ); 79 | filter: drop-shadow( -5px -5px 5px #000 ); 80 | } 81 | 82 | .connector-click-area { 83 | cursor: pointer; 84 | fill:none; 85 | stroke:transparent; 86 | stroke-width:15; 87 | } 88 | 89 | .connector-click-area:hover + .connector, 90 | .connector:hover { 91 | cursor: pointer; 92 | stroke-width: 4; 93 | } 94 | 95 | .connector.selected { 96 | stroke: #15BD76;; 97 | } 98 | 99 | .trash-icon .trash-icon-trashcan { 100 | opacity: 0.8; 101 | } 102 | 103 | .trash-icon:hover { 104 | cursor: pointer; 105 | } 106 | 107 | .trash-icon:hover .trash-icon-bg { 108 | stroke:#15BD76;; 109 | stroke-width: 2; 110 | opacity: 0.5; 111 | } 112 | 113 | .trash-icon:hover .trash-icon-trashcan { 114 | opacity: 1; 115 | } 116 | 117 | .nodeInputWrapper { 118 | width : 50%; 119 | float: left; 120 | } 121 | 122 | .nodeOutputWrapper { 123 | width : 50%; 124 | float: right; 125 | text-align: right; 126 | } 127 | 128 | 129 | .nodeInputList, .nodeOutputList { 130 | list-style: none; 131 | padding: 0; 132 | margin-top: 0; 133 | margin-bottom: 10px; 134 | } 135 | 136 | .nodeOutputList li { 137 | cursor: pointer; 138 | } 139 | 140 | .nodeOutputList li a { 141 | font-size:10px; 142 | text-decoration: none; 143 | background: transparent; 144 | box-sizing: border-box; 145 | color: #337ab7; 146 | } 147 | 148 | .nodeOutputList li a i { 149 | padding-left: 6px; 150 | } 151 | 152 | .nodeOutputList li:hover a i { 153 | vertical-align: top; 154 | font-size: 15px; 155 | margin-top: 3px; 156 | margin-right: -2px; 157 | padding-left: 3px; 158 | } 159 | 160 | .nodeOutputList li:hover a { 161 | vertical-align: top; 162 | font-weight: bold; 163 | } 164 | 165 | .nodeInputList li a { 166 | cursor: default; 167 | font-size:10px; 168 | color: #999999; 169 | display: block; 170 | text-decoration: none; 171 | background: transparent; 172 | box-sizing: border-box; 173 | } 174 | .nodeInputList li a i { 175 | padding-right: 6px; 176 | } 177 | 178 | .dragging .nodeInputList li a i.hover { 179 | vertical-align: top; 180 | font-size: 15px; 181 | color: #ffffff; 182 | margin-top: 2px; 183 | margin-left: -2px; 184 | padding-right: 3px; 185 | } 186 | 187 | .dragging .nodeInputList li a i.hover + span { 188 | vertical-align: top; 189 | font-weight: bold; 190 | color: #ffffff; 191 | } 192 | 193 | .inputDot { 194 | width: 12px; 195 | height: 12px; 196 | display: inline-block; 197 | position: absolute; 198 | background: #e6e6e6; 199 | border-radius: 50%; 200 | top: 0; 201 | right: 3px; 202 | left: auto; 203 | border: 2px solid #fff; 204 | } 205 | 206 | 207 | .EndPoint { fill:none; stroke:#888888; stroke-width:2 } 208 | 209 | .pin-input { 210 | background: transparent; 211 | padding: 5px; 212 | width: 50px; 213 | display: inline-block; 214 | margin-left: 16px; 215 | border-color: #333333; 216 | } 217 | 218 | .node-menu { 219 | display: block; 220 | z-index: 10020; 221 | } 222 | 223 | 224 | -------------------------------------------------------------------------------- /now.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "naph", 3 | "version": 2, 4 | "builds": [ 5 | { "src": "dist/*", "use": "@now/static" } 6 | ], 7 | "routes": [ 8 | { "src": "/", "dest": "dist/index.html" }, 9 | { "src": "/(.*)", "dest": "dist/$1" } 10 | ] 11 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "naph", 3 | "version": "0.3.1", 4 | "description": "UI for rendering Node Graphs.", 5 | "main": "build/index.js", 6 | "files": [ 7 | "build/**/*", 8 | "src/**/*" 9 | ], 10 | "peerDependencies": { 11 | "react": "^16.12.0", 12 | "react-dom": "^16.12.0" 13 | }, 14 | "devDependencies": { 15 | "@auto-it/conventional-commits": "^7.13.1", 16 | "@types/lodash.clonedeep": "^4.5.6", 17 | "@types/react": "^16.9.16", 18 | "@types/react-onclickoutside": "^6.7.3", 19 | "@typescript-eslint/eslint-plugin": "^2.11.0", 20 | "@typescript-eslint/parser": "^2.11.0", 21 | "@zeit/ncc": "^0.20.5", 22 | "auto": "^7.13.1", 23 | "eslint-plugin-react": "^7.12.4", 24 | "eslint-plugin-react-hooks": "^1.6.0", 25 | "parcel-bundler": "^1.12.4", 26 | "react": "^16.12.0", 27 | "react-hot-loader": "^4.12.18", 28 | "tslib": "^1.10.0", 29 | "typescript": "^3.7.3", 30 | "eslint": "^6.0.0" 31 | }, 32 | "dependencies": { 33 | "lodash.clonedeep": "^4.5.0", 34 | "react-dom": "^16.12.0", 35 | "react-draggable": "^3.3.2" 36 | }, 37 | "scripts": { 38 | "build:src": "tsc -d", 39 | "build:example": "parcel build example/index.html --no-source-maps", 40 | "build": "rm -rf ./dist && npm run build:src && npm run build:example", 41 | "release": "auto shipit", 42 | "dev": "rm -rf ./dist && parcel example/index.html" 43 | }, 44 | "repository": { 45 | "type": "git", 46 | "url": "https://github.com/williamluke4/Naph.git" 47 | }, 48 | "keywords": [ 49 | "react", 50 | "component", 51 | "react-component", 52 | "node", 53 | "graph", 54 | "ui" 55 | ], 56 | "author": "William Luke", 57 | "license": "MIT" 58 | } 59 | -------------------------------------------------------------------------------- /src/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/williamluke4/Naph/04c3c2f9415c5c5ddb865ba981ee00f1f30cc109/src/.DS_Store -------------------------------------------------------------------------------- /src/context.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react' 2 | import { Data, Position, Connection, NodeType, Field } from './types' 3 | 4 | interface NaphProviderStore { 5 | 6 | connections: Connection[]; 7 | setConnections: React.Dispatch> 8 | addConnector: (Connection: Connection) => void; 9 | removeConnector: (Connection: Connection) => void; 10 | nodes: NodeType[]; 11 | setNodes: React.Dispatch> 12 | mousePos: Position; 13 | setMousePos: React.Dispatch> 14 | source: { 15 | nid: number; 16 | field: Field; 17 | }; 18 | setSource: React.Dispatch> 22 | dragging: boolean; 23 | setDragging: React.Dispatch> 24 | } 25 | 26 | interface NaphProviderProps { 27 | data: Data; 28 | } 29 | export const NaphContext = React.createContext({} as NaphProviderStore) 30 | export const NaphProvider: React.FC = (props) => { 31 | const [connections, setConnections] = React.useState(props.data.connections); 32 | const [nodes, setNodes] = React.useState(props.data.nodes); 33 | const [mousePos, setMousePos] = React.useState({ x: 0, y: 0 }); 34 | const [source, setSource] = React.useState({} as NaphProviderStore['source']); 35 | const [dragging, setDragging] = React.useState(false); 36 | 37 | function addConnector(connection: Connection) { 38 | let _connections = [...connections, connection] 39 | setConnections(_connections) 40 | } 41 | 42 | function removeConnector(connector: Connection) { 43 | let _connections = [...connections] 44 | _connections = connections.filter((connection) => { 45 | return connection != connector 46 | }) 47 | 48 | setConnections(_connections) 49 | } 50 | 51 | React.useEffect(() => { 52 | setConnections(props.data.connections) 53 | setNodes(props.data.nodes) 54 | }, [props.data]); 55 | const store = { 56 | addConnector, 57 | removeConnector, 58 | connections, setConnections, 59 | nodes, setNodes, 60 | mousePos, setMousePos, 61 | source, setSource, 62 | dragging, setDragging, 63 | } 64 | return ( 65 | 66 | {props.children} 67 | 68 | ) 69 | } -------------------------------------------------------------------------------- /src/hooks/useClickAway.tsx: -------------------------------------------------------------------------------- 1 | import { RefObject, useEffect, useRef } from 'react'; 2 | import { off, on } from './util'; 3 | 4 | const defaultEvents = ['mousedown', 'touchstart']; 5 | 6 | export const useClickAway = ( 7 | ref: RefObject, 8 | onClickAway: (event: KeyboardEvent) => void, 9 | events: string[] = defaultEvents 10 | ) => { 11 | const savedCallback = useRef(onClickAway); 12 | useEffect(() => { 13 | savedCallback.current = onClickAway; 14 | }, [onClickAway]); 15 | useEffect(() => { 16 | const handler = (event: any) => { 17 | const { current: el } = ref; 18 | el && !el.contains(event.target) && savedCallback.current(event); 19 | }; 20 | for (const eventName of events) { 21 | on(document, eventName, handler); 22 | } 23 | return () => { 24 | for (const eventName of events) { 25 | off(document, eventName, handler); 26 | } 27 | }; 28 | }, [events, ref]); 29 | }; 30 | 31 | export default useClickAway; -------------------------------------------------------------------------------- /src/hooks/util.ts: -------------------------------------------------------------------------------- 1 | export const on = (obj: any, ...args: any[]) => obj.addEventListener(...args); 2 | 3 | export const off = (obj: any, ...args: any[]) => obj.removeEventListener(...args); -------------------------------------------------------------------------------- /src/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { useEffect, useRef, useCallback, useState } from "react"; 2 | import cloneDeep from "lodash.clonedeep"; 3 | import Spline from "./lib/Spline"; 4 | import SVGComponent from "./lib/SVGComponent"; 5 | import Node from "./lib/Node"; 6 | import { NodeType, Data, Position, Field, Connection } from "./types"; 7 | import { 8 | computeOutOffsetByIndex, 9 | computeInOffsetByIndex, 10 | } from "./lib/util"; 11 | import { NaphContext } from "./context"; 12 | 13 | export const getNodebyId = (nodes: NodeType[], nid: number) => { 14 | let reval = 0; 15 | 16 | for (let node of nodes) { 17 | if (node.nid === nid) { 18 | return nodes[reval]; 19 | } else { 20 | reval++; 21 | } 22 | } 23 | }; 24 | interface ReactNodeGraphProps { 25 | onNodeStartMove: (nid: number) => void; 26 | onNodeMove: (nid: number, position: Position) => void; 27 | onNodeSelect: (nid: number) => void; 28 | onNodeDeselect: (nid: number) => void; 29 | onNewConnector: (connector: Connection) => void; 30 | onRemoveConnector: (connector: Connection) => void; 31 | } 32 | const ReactNodeGraph = ({ 33 | onNodeStartMove, 34 | onNodeMove, 35 | onNodeSelect, 36 | onNodeDeselect, 37 | onNewConnector, 38 | onRemoveConnector 39 | }: ReactNodeGraphProps) => { 40 | const naphContext = React.useContext(NaphContext); 41 | const svgRef = useRef() as React.MutableRefObject; 42 | useEffect(() => { 43 | function handleMouseUp() { 44 | naphContext.setDragging(false); 45 | } 46 | 47 | function handleMouseMove(e: MouseEvent) { 48 | e.stopPropagation(); 49 | e.preventDefault(); 50 | 51 | //Get svg element position to substract offset top and left 52 | const svgRect = svgRef.current.getBoundingClientRect(); 53 | 54 | naphContext.setMousePos({ 55 | x: e.pageX - svgRect.left, 56 | y: e.pageY - svgRect.top 57 | }); 58 | } 59 | 60 | document.addEventListener("mousemove", handleMouseMove); 61 | document.addEventListener("mouseup", handleMouseUp); 62 | 63 | return () => { 64 | document.removeEventListener("mousemove", handleMouseUp); 65 | document.removeEventListener("mouseup", handleMouseMove); 66 | }; 67 | }, []); 68 | 69 | const handleNodeStart = onNodeStartMove; 70 | const handleNodeStop = () => null; 71 | //onNodeStop; 72 | 73 | const handleNodeMove = (nodeIndex: number, pos: Position) => { 74 | let nodes = cloneDeep(naphContext.nodes); 75 | 76 | nodes[nodeIndex].x = pos.x; 77 | nodes[nodeIndex].y = pos.y; 78 | onNodeMove(nodeIndex, pos) 79 | naphContext.setNodes(nodes); 80 | }; 81 | 82 | const handleStartConnector = (nid: number, outputField: Field) => { 83 | naphContext.setDragging(true); 84 | naphContext.setSource({nid, field:outputField}); 85 | }; 86 | 87 | const handleCompleteConnector = (nid: number, field: Field) => { 88 | if (naphContext.dragging) { 89 | let nodes = naphContext.nodes; 90 | let fromNode = getNodebyId(nodes, naphContext.source.nid); 91 | let toNode = getNodebyId(nodes, nid); 92 | if (fromNode && toNode) { 93 | const newConnector = { 94 | from_field_name: naphContext.source.field.name, 95 | from_node_id: fromNode.nid, 96 | to_field_name: field.name, 97 | to_node_id: toNode.nid 98 | } 99 | naphContext.addConnector(newConnector) 100 | onNewConnector(newConnector); 101 | } 102 | } 103 | 104 | naphContext.setDragging(false); 105 | }; 106 | 107 | const handleRemoveConnector = (connector: Connection) => { 108 | naphContext.removeConnector(connector) 109 | if (onRemoveConnector) { 110 | onRemoveConnector(connector); 111 | } 112 | }; 113 | 114 | const handleNodeSelect = (nid: number) => { 115 | if (onNodeSelect) { 116 | onNodeSelect(nid); 117 | } 118 | }; 119 | 120 | const handleNodeDeselect = (nid: number) => { 121 | if (onNodeDeselect) { 122 | onNodeDeselect(nid); 123 | } 124 | }; 125 | 126 | const computeFieldIndexfromFieldName = (fields: Field[], field_name: string) => { 127 | let reval = 0; 128 | 129 | for (let f of fields) { 130 | if (f.name === field_name) { 131 | return reval; 132 | } else { 133 | reval++; 134 | } 135 | } 136 | }; 137 | 138 | const renderComponents = () => { 139 | let nodes = naphContext.nodes; 140 | let newConnector = null; 141 | 142 | if (naphContext.dragging) { 143 | let sourceNode = getNodebyId(nodes, naphContext.source.nid); 144 | if (sourceNode) { 145 | let connectorStart = computeOutOffsetByIndex( 146 | sourceNode.x, 147 | sourceNode.y, 148 | sourceNode.fields.findIndex(f => f.name === naphContext.source.field.name) 149 | ); 150 | let connectorEnd = naphContext.mousePos; 151 | 152 | newConnector = ; 153 | } 154 | } 155 | 156 | return ( 157 |
158 | {nodes.map((node, i) => { 159 | return ( 160 | 175 | ); 176 | })} 177 | 178 | {/* render our connectors */} 179 | 180 | 181 | {naphContext.connections.map((connector, connectorIndex) => { 182 | const fromNode = getNodebyId(nodes, connector.from_node_id); 183 | const toNode = getNodebyId(nodes, connector.to_node_id); 184 | 185 | if (fromNode && toNode) { 186 | const startPinIndex = computeFieldIndexfromFieldName( 187 | fromNode.fields, 188 | connector.from_field_name 189 | ); 190 | const endPinIndex = computeFieldIndexfromFieldName( 191 | toNode.fields, 192 | connector.to_field_name 193 | ); 194 | if ( 195 | typeof startPinIndex === "number" && 196 | typeof endPinIndex === "number" 197 | ) { 198 | const splineStart = computeOutOffsetByIndex( 199 | fromNode.x, 200 | fromNode.y, 201 | startPinIndex 202 | ); 203 | const splineEnd = computeInOffsetByIndex( 204 | toNode.x, 205 | toNode.y, 206 | endPinIndex 207 | ); 208 | return ( 209 | handleRemoveConnector(connector)} 215 | /> 216 | ); 217 | } 218 | } 219 | return null; 220 | })} 221 | 222 | {/* this is our new connector that only appears on dragging */} 223 | {newConnector} 224 | 225 |
226 | ); 227 | }; 228 | return renderComponents(); 229 | }; 230 | export * from './types'; 231 | export * from './context'; 232 | 233 | export default React.memo(ReactNodeGraph); 234 | -------------------------------------------------------------------------------- /src/lib/Node.tsx: -------------------------------------------------------------------------------- 1 | import React, { useState, useCallback, useMemo, useRef } from "react"; 2 | import Draggable, { DraggableData, DraggableEvent } from "react-draggable"; 3 | import { Position, Field } from '../types'; 4 | import useClickAway from "../hooks/useClickAway"; 5 | import NodeFields from "./NodeFields"; 6 | interface NodeProps { 7 | nid: number; 8 | pos: Position; 9 | title: string; 10 | fields: Field[]; 11 | onNodeStart: (nid: number, ui: DraggableData) => void; 12 | onNodeStop: (nid: number, position: Position) => void; 13 | onNodeMove: (nid: number, position: Position) => void; 14 | onNodeSelect: (nid: number) => void; 15 | onNodeDeselect: (nid: number) => void; 16 | onStartConnector: (nid: number, field: Field) => void; 17 | onCompleteConnector: (nid: number, field: Field) => void; 18 | index: number; 19 | } 20 | const Node = ({ 21 | nid, 22 | pos, 23 | title, 24 | fields, 25 | onNodeStart, 26 | onNodeStop, 27 | onNodeMove, 28 | onNodeSelect, 29 | onNodeDeselect, 30 | onStartConnector, 31 | onCompleteConnector, 32 | index: propIndex 33 | }: NodeProps) => { 34 | const [isSelected, setSelected] = useState(false); 35 | const ref = useRef() as React.MutableRefObject; 36 | 37 | const handleDragStart =(event: DraggableEvent, ui: DraggableData) => { 38 | onNodeStart(nid, ui); 39 | } 40 | 41 | const handleDragStop = (event: DraggableEvent, ui: DraggableData) => { 42 | onNodeStop(nid, {x:ui.x, y:ui.y}); 43 | } 44 | const handleDrag = (event: DraggableEvent, ui: DraggableData) => { 45 | onNodeMove(propIndex, {x:ui.x, y:ui.y}); 46 | } 47 | 48 | const handleStartConnector = (field: Field) => { 49 | onStartConnector(nid, field); 50 | } 51 | 52 | const handleCompleteConnector = (field: Field) => { 53 | onCompleteConnector(nid, field); 54 | } 55 | 56 | const handleClick = () => { 57 | setSelected(!isSelected); 58 | if (onNodeSelect) { 59 | onNodeSelect(nid); 60 | } 61 | } 62 | 63 | useClickAway(ref, () => { 64 | if (onNodeDeselect && isSelected) { 65 | onNodeDeselect(nid); 66 | } 67 | setSelected(false); 68 | }) 69 | 70 | 71 | 72 | const NodeClass = useMemo(() => "node" + (isSelected ? " selected" : ""), [ 73 | isSelected 74 | ]); 75 | 76 | return ( 77 |
78 | 85 |
86 |
87 | {title} 88 |
89 |
90 | 95 |
96 |
97 |
98 |
99 | ); 100 | }; 101 | 102 | 103 | export default Node; 104 | -------------------------------------------------------------------------------- /src/lib/NodeField.tsx: -------------------------------------------------------------------------------- 1 | import React, { useState, useCallback } from "react"; 2 | import { Field } from "../types"; 3 | interface NodeFieldProps { 4 | onMouseUp: (field: Field) => void; 5 | onMouseDown: (field: Field) => void; 6 | field: Field; 7 | } 8 | const NodeField = ({ onMouseUp, onMouseDown, field }: NodeFieldProps) => { 9 | const [isHover, setHover] = useState(false); 10 | 11 | const handleMouseUp = (e: any) => { 12 | noop(e) 13 | onMouseUp(field); 14 | } 15 | 16 | const handleMouseOver = () => { 17 | setHover(true); 18 | } 19 | 20 | const handleMouseOut = () => { 21 | setHover(false); 22 | } 23 | const handleMouseDown = (e: any) => { 24 | noop(e) 25 | onMouseDown(field); 26 | } 27 | const noop = (e: any) => { 28 | e.stopPropagation(); 29 | e.preventDefault(); 30 | } 31 | return ( 32 |
33 |
34 | 40 | {field.name} 41 |
42 |
43 | {field.type} 44 | 45 |
46 |
47 | ); 48 | }; 49 | 50 | export default React.memo(NodeField); 51 | -------------------------------------------------------------------------------- /src/lib/NodeFields.tsx: -------------------------------------------------------------------------------- 1 | import React, { useCallback } from "react"; 2 | import { Field } from "../types"; 3 | import NodeField from "./NodeField"; 4 | interface NodeFieldsProps { 5 | onCompleteConnector: (field: Field) => void; 6 | onStartConnector: (field: Field) => void; 7 | fields: Field[]; 8 | } 9 | const NodeFieldsList = ({ onCompleteConnector,onStartConnector, fields }: NodeFieldsProps) => { 10 | const handleMouseUp = (field: Field) => { 11 | onCompleteConnector(field); 12 | } 13 | const handleMouseDown = (field: Field) => { 14 | onStartConnector(field); 15 | } 16 | return ( 17 |
18 | {fields.map((field, index) => ( 19 | 25 | ))} 26 |
27 | ); 28 | }; 29 | 30 | export default React.memo(NodeFieldsList); -------------------------------------------------------------------------------- /src/lib/SVGComponent.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | const SVGComponent: React.FC<{ 4 | childRef: any; 5 | children?: React.ReactNode; 6 | } & React.SVGProps> = ({ children, childRef, ...rest }) => { 7 | return ( 8 | (childRef.current = svgRef)} 12 | > 13 | {children} 14 | 15 | ); 16 | }; 17 | 18 | export default React.memo(SVGComponent); 19 | -------------------------------------------------------------------------------- /src/lib/Spline.tsx: -------------------------------------------------------------------------------- 1 | import React, { useState, useCallback, useMemo, useRef } from "react"; 2 | import { Position } from "../types"; 3 | import TrashIcon from "./TrashIcon"; 4 | import useClickAway from "../hooks/useClickAway"; 5 | 6 | const bezierCurve = ( 7 | a: number, 8 | b: number, 9 | cp1x: number, 10 | cp1y: number, 11 | cp2x: number, 12 | cp2y: number, 13 | x: number, 14 | y: number 15 | ) => { 16 | const curve = `M${a},${b} C${cp1x},${cp1y} ${cp2x},${cp2y} ${x},${y}`; 17 | return curve; 18 | }; 19 | 20 | const distance = (a: Position, b: Position) => { 21 | const dist = Math.sqrt((b.x - a.x) * (b.x - a.x) + (b.y - a.y) * (b.y - a.y)); 22 | 23 | return dist ? dist : 0; 24 | }; 25 | interface SplineProps { 26 | mousePos?: Position; 27 | onClick?: (event: React.MouseEvent) => void; 28 | onRemove?: (event: React.MouseEvent) => void; 29 | start: Position; 30 | end: Position; 31 | } 32 | const Spline = ({ mousePos, onClick, onRemove, start, end }: SplineProps) => { 33 | const [selected, setSelected] = useState(false); 34 | const [position, setPosition] = useState({ x: 0, y: 0 }); 35 | const ref = useRef() as React.MutableRefObject; 36 | 37 | const handleClick = (e: any) => { 38 | setSelected(!selected); 39 | mousePos && setPosition(mousePos); 40 | if (onClick) { 41 | onClick(e); 42 | } 43 | }; 44 | 45 | useClickAway(ref, () => { 46 | setSelected(false); 47 | }); 48 | const handleRemove = (e: any) => { 49 | setSelected(false); 50 | 51 | if (onRemove) { 52 | onRemove(e); 53 | } 54 | }; 55 | 56 | const dist = useMemo(() => distance(start, end), [start, end]); 57 | 58 | const pathString = useMemo( 59 | () => 60 | bezierCurve( 61 | start.x || 0, // start x 62 | start.y || 0, // start y 63 | start.x + dist * 0.25 || 0, // cp1 x 64 | start.y || 0, // cp1 y 65 | end.x - dist * 0.75 || 0, // cp2 x 66 | end.y || 0, // cp2 y 67 | end.x || 0, // end x 68 | end.y || 0 69 | ), // end y 70 | [start, end] 71 | ); 72 | 73 | const className = useMemo(() => "connector" + (selected ? " selected" : ""), [ 74 | selected 75 | ]); 76 | 77 | return ( 78 | 79 | 80 | 81 | 86 | 87 | {selected && } 88 | 89 | ); 90 | }; 91 | 92 | export default Spline; 93 | -------------------------------------------------------------------------------- /src/lib/TrashIcon.tsx: -------------------------------------------------------------------------------- 1 | import React, { useCallback } from "react"; 2 | interface TrashIconProps { 3 | onClick: (event: React.MouseEvent) => void; 4 | position: any; 5 | } 6 | const TrashIcon = ({ onClick, position }: TrashIconProps) => { 7 | const handleClick = (e: any) => { 8 | if (onClick) { 9 | onClick(e); 10 | } 11 | }; 12 | 13 | return ( 14 | 22 | 23 | 28 | 32 | 33 | 34 | ); 35 | }; 36 | 37 | export default TrashIcon; 38 | -------------------------------------------------------------------------------- /src/lib/util.tsx: -------------------------------------------------------------------------------- 1 | import { useState } from "react"; 2 | import { Position } from "../types"; 3 | 4 | /* not bound to style, should be computed */ 5 | export function computeInOffsetByIndex(x: number, y: number, index: number) { 6 | let outx = x + 15; 7 | let outy = y + 47 + index * 20; 8 | 9 | return { x: outx, y: outy }; 10 | } 11 | 12 | export function computeOutOffsetByIndex(x: number, y: number, index: number) { 13 | let outx = x + 180; 14 | let outy = y + 49 + index * 20; 15 | 16 | return { x: outx, y: outy }; 17 | } 18 | 19 | export function useObjectState(initialState: T) { 20 | const [state, setState] = useState(initialState); 21 | function setSafeState( 22 | newState: Partial | ((prev:T) => Partial), 23 | callback?: () => void 24 | ){ 25 | if (typeof newState === "function") { 26 | setState(prevState => ({ 27 | ...prevState, 28 | ...newState(prevState) 29 | })); 30 | } else { 31 | setState(prevState => ({ 32 | ...prevState, 33 | ...newState 34 | })); 35 | } 36 | 37 | if (callback) { 38 | callback(); 39 | } 40 | }; 41 | return [state, setSafeState]; 42 | } 43 | -------------------------------------------------------------------------------- /src/types.ts: -------------------------------------------------------------------------------- 1 | export type Position = { 2 | x: number; 3 | y: number; 4 | } 5 | 6 | 7 | 8 | export interface Data { 9 | nodes: NodeType[]; 10 | connections: Connection[]; 11 | } 12 | 13 | export interface Connection { 14 | from_node_id: number; 15 | from_field_name: string; 16 | to_node_id: number; 17 | to_field_name: string; 18 | } 19 | 20 | export interface NodeType { 21 | nid: number; 22 | title: string; 23 | x: number; 24 | y: number; 25 | fields: Field[]; 26 | } 27 | 28 | export interface Field { 29 | name: string; 30 | type: string; 31 | } -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "outDir": "build", 5 | "declaration": true, 6 | "target": "es5", 7 | "lib": ["dom", "es2016"], 8 | "skipLibCheck": true, 9 | "jsx": "react", 10 | "moduleResolution": "node", 11 | "noImplicitAny": true, 12 | "strict": true, 13 | "allowSyntheticDefaultImports": true, 14 | "forceConsistentCasingInFileNames": true, 15 | "esModuleInterop": true, 16 | "suppressImplicitAnyIndexErrors": true, 17 | "resolveJsonModule": true 18 | }, 19 | "include": ["src/**/*.ts*"], 20 | "exclude": ["./src/__tests__/**/*", "build"] 21 | } 22 | --------------------------------------------------------------------------------