├── .github └── workflows │ └── rust.yml ├── .gitignore ├── Cargo.toml ├── LICENSE ├── README.md ├── graphql ├── schema.json ├── user-by-username.graphql └── user-create.graphql └── src ├── graphql.rs ├── helpers.rs ├── main.rs └── types.rs /.github/workflows/rust.yml: -------------------------------------------------------------------------------- 1 | name: Rust 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | env: 10 | CARGO_TERM_COLOR: always 11 | 12 | jobs: 13 | build: 14 | 15 | runs-on: ubuntu-latest 16 | 17 | steps: 18 | - uses: actions/checkout@v2 19 | - name: Build 20 | run: cargo build --verbose 21 | - name: Run tests 22 | run: cargo test --verbose 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Generated by Cargo 2 | # will have compiled files and executables 3 | /target/ 4 | 5 | # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries 6 | # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html 7 | Cargo.lock 8 | 9 | # These are backup files generated by rustfmt 10 | **/*.rs.bk 11 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rust-hasura" 3 | version = "0.1.0" 4 | edition = "2018" 5 | authors = ["ronanyeah"] 6 | repository = "https://github.com/ronanyeah/rust-hasura" 7 | description = "Rust / GraphQL / Hasura" 8 | license = "MIT" 9 | readme = "README.md" 10 | keywords = ["rust"] 11 | categories = ["rust"] 12 | 13 | [dependencies] 14 | juniper = "0.15.7" 15 | graphql_client = "0.10.0" 16 | serde = { version = "1.0.133", features = ["derive"] } 17 | serde_json = "1.0.74" 18 | # Required to rename uuid::Uuid -> uuid and avoid collision. 19 | uuid_ = { package = "uuid", version = "0.8.2", features = ["serde"] } 20 | jsonwebtoken = "7.2.0" 21 | reqwest = { version = "0.11.8", features = ["json"] } 22 | envy = "0.4.2" 23 | async-std = "1.10.0" 24 | tokio = { version = "1.15.0", features = ["full"] } 25 | warp = "0.3.2" 26 | cookie = "0.16.0" 27 | time = "0.3.5" 28 | 29 | [[bin]] 30 | name = "example" 31 | path = "src/main.rs" 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Rust + Hasura ![Rust](https://github.com/ronanyeah/rust-hasura/workflows/Rust/badge.svg) 2 | 3 | This is an example of a [Rust](https://www.rust-lang.org) server that functions as a [remote schema](https://hasura.io/docs/1.0/graphql/manual/remote-schemas/index.html) for [Hasura](https://hasura.io). 4 | 5 | It demonstrates: 6 | - user login + signup 7 | - [JWT authorization w/ refresh cookie](https://hasura.io/blog/best-practices-of-using-jwt-with-graphql/) 8 | - [typesafe GraphQL requests](https://docs.rs/graphql_client) 9 | - [uuid](https://docs.rs/uuid) package integration 10 | 11 | You can learn more about this stack from [this talk](https://www.youtube.com/watch?v=ly05IV5isf4). 12 | 13 | 14 | ## Package Manager 15 | 16 | [Cargo](https://doc.rust-lang.org/cargo/guide) 17 | 18 | 19 | ## Setup 20 | 21 | - Your Hasura schema must have a table `user`, with a `id` column of type `uuid`, and also a `username` column of type `text`. 22 | - Set an [`ADMIN_SECRET`](https://hasura.io/docs/1.0/graphql/manual/deployment/graphql-engine-flags/reference.html) and a [`JWT_SECRET`](https://hasura.io/docs/1.0/graphql/manual/auth/authentication/jwt.html) on the graphql engine, and share these with the Rust server as environment variables. 23 | - Use [graphqurl](https://www.npmjs.com/package/graphqurl) to generate `schema.json` 24 | - `gq $HASURA_ENDPOINT -H "x-hasura-admin-secret: $ADMIN_SECRET" --introspect --format json > ./graphql/schema.json` 25 | 26 | ## Start 27 | - `cargo run` 28 | 29 | 30 | ## Environment Variables 31 | 32 | Key | Example 33 | --- | --- 34 | `PORT` | `8000` 35 | `HASURA_ENDPOINT` | `http://127.0.0.1:8080/v1/graphql` 36 | `ADMIN_SECRET` | `foo` 37 | `JWT_SECRET` | `{"type":"HS256","key":"3QQ6FD+o0+c7tzQQVfjpMkNDi2yARAAKzQQk8O2IKoxQQ4nF7EdAh8s3TwpHwrdQQ6R"}` 38 | -------------------------------------------------------------------------------- /graphql/schema.json: -------------------------------------------------------------------------------- 1 | { 2 | "__schema": { 3 | "queryType": { 4 | "name": "query_root", 5 | "__typename": "__Type" 6 | }, 7 | "mutationType": { 8 | "name": "mutation_root", 9 | "__typename": "__Type" 10 | }, 11 | "subscriptionType": { 12 | "name": "subscription_root", 13 | "__typename": "__Type" 14 | }, 15 | "types": [ 16 | { 17 | "kind": "SCALAR", 18 | "name": "Boolean", 19 | "description": null, 20 | "fields": null, 21 | "inputFields": null, 22 | "interfaces": null, 23 | "enumValues": null, 24 | "possibleTypes": null, 25 | "__typename": "__Type" 26 | }, 27 | { 28 | "kind": "SCALAR", 29 | "name": "Float", 30 | "description": null, 31 | "fields": null, 32 | "inputFields": null, 33 | "interfaces": null, 34 | "enumValues": null, 35 | "possibleTypes": null, 36 | "__typename": "__Type" 37 | }, 38 | { 39 | "kind": "SCALAR", 40 | "name": "ID", 41 | "description": null, 42 | "fields": null, 43 | "inputFields": null, 44 | "interfaces": null, 45 | "enumValues": null, 46 | "possibleTypes": null, 47 | "__typename": "__Type" 48 | }, 49 | { 50 | "kind": "SCALAR", 51 | "name": "Int", 52 | "description": null, 53 | "fields": null, 54 | "inputFields": null, 55 | "interfaces": null, 56 | "enumValues": null, 57 | "possibleTypes": null, 58 | "__typename": "__Type" 59 | }, 60 | { 61 | "kind": "SCALAR", 62 | "name": "String", 63 | "description": null, 64 | "fields": null, 65 | "inputFields": null, 66 | "interfaces": null, 67 | "enumValues": null, 68 | "possibleTypes": null, 69 | "__typename": "__Type" 70 | }, 71 | { 72 | "kind": "INPUT_OBJECT", 73 | "name": "String_comparison_exp", 74 | "description": "expression to compare columns of type String. All fields are combined with logical 'AND'.", 75 | "fields": null, 76 | "inputFields": [ 77 | { 78 | "name": "_eq", 79 | "description": null, 80 | "type": { 81 | "kind": "SCALAR", 82 | "name": "String", 83 | "ofType": null, 84 | "__typename": "__Type" 85 | }, 86 | "defaultValue": null, 87 | "__typename": "__InputValue" 88 | }, 89 | { 90 | "name": "_gt", 91 | "description": null, 92 | "type": { 93 | "kind": "SCALAR", 94 | "name": "String", 95 | "ofType": null, 96 | "__typename": "__Type" 97 | }, 98 | "defaultValue": null, 99 | "__typename": "__InputValue" 100 | }, 101 | { 102 | "name": "_gte", 103 | "description": null, 104 | "type": { 105 | "kind": "SCALAR", 106 | "name": "String", 107 | "ofType": null, 108 | "__typename": "__Type" 109 | }, 110 | "defaultValue": null, 111 | "__typename": "__InputValue" 112 | }, 113 | { 114 | "name": "_ilike", 115 | "description": null, 116 | "type": { 117 | "kind": "SCALAR", 118 | "name": "String", 119 | "ofType": null, 120 | "__typename": "__Type" 121 | }, 122 | "defaultValue": null, 123 | "__typename": "__InputValue" 124 | }, 125 | { 126 | "name": "_in", 127 | "description": null, 128 | "type": { 129 | "kind": "LIST", 130 | "name": null, 131 | "ofType": { 132 | "kind": "NON_NULL", 133 | "name": null, 134 | "ofType": { 135 | "kind": "SCALAR", 136 | "name": "String", 137 | "ofType": null, 138 | "__typename": "__Type" 139 | }, 140 | "__typename": "__Type" 141 | }, 142 | "__typename": "__Type" 143 | }, 144 | "defaultValue": null, 145 | "__typename": "__InputValue" 146 | }, 147 | { 148 | "name": "_is_null", 149 | "description": null, 150 | "type": { 151 | "kind": "SCALAR", 152 | "name": "Boolean", 153 | "ofType": null, 154 | "__typename": "__Type" 155 | }, 156 | "defaultValue": null, 157 | "__typename": "__InputValue" 158 | }, 159 | { 160 | "name": "_like", 161 | "description": null, 162 | "type": { 163 | "kind": "SCALAR", 164 | "name": "String", 165 | "ofType": null, 166 | "__typename": "__Type" 167 | }, 168 | "defaultValue": null, 169 | "__typename": "__InputValue" 170 | }, 171 | { 172 | "name": "_lt", 173 | "description": null, 174 | "type": { 175 | "kind": "SCALAR", 176 | "name": "String", 177 | "ofType": null, 178 | "__typename": "__Type" 179 | }, 180 | "defaultValue": null, 181 | "__typename": "__InputValue" 182 | }, 183 | { 184 | "name": "_lte", 185 | "description": null, 186 | "type": { 187 | "kind": "SCALAR", 188 | "name": "String", 189 | "ofType": null, 190 | "__typename": "__Type" 191 | }, 192 | "defaultValue": null, 193 | "__typename": "__InputValue" 194 | }, 195 | { 196 | "name": "_neq", 197 | "description": null, 198 | "type": { 199 | "kind": "SCALAR", 200 | "name": "String", 201 | "ofType": null, 202 | "__typename": "__Type" 203 | }, 204 | "defaultValue": null, 205 | "__typename": "__InputValue" 206 | }, 207 | { 208 | "name": "_nilike", 209 | "description": null, 210 | "type": { 211 | "kind": "SCALAR", 212 | "name": "String", 213 | "ofType": null, 214 | "__typename": "__Type" 215 | }, 216 | "defaultValue": null, 217 | "__typename": "__InputValue" 218 | }, 219 | { 220 | "name": "_nin", 221 | "description": null, 222 | "type": { 223 | "kind": "LIST", 224 | "name": null, 225 | "ofType": { 226 | "kind": "NON_NULL", 227 | "name": null, 228 | "ofType": { 229 | "kind": "SCALAR", 230 | "name": "String", 231 | "ofType": null, 232 | "__typename": "__Type" 233 | }, 234 | "__typename": "__Type" 235 | }, 236 | "__typename": "__Type" 237 | }, 238 | "defaultValue": null, 239 | "__typename": "__InputValue" 240 | }, 241 | { 242 | "name": "_nlike", 243 | "description": null, 244 | "type": { 245 | "kind": "SCALAR", 246 | "name": "String", 247 | "ofType": null, 248 | "__typename": "__Type" 249 | }, 250 | "defaultValue": null, 251 | "__typename": "__InputValue" 252 | }, 253 | { 254 | "name": "_nsimilar", 255 | "description": null, 256 | "type": { 257 | "kind": "SCALAR", 258 | "name": "String", 259 | "ofType": null, 260 | "__typename": "__Type" 261 | }, 262 | "defaultValue": null, 263 | "__typename": "__InputValue" 264 | }, 265 | { 266 | "name": "_similar", 267 | "description": null, 268 | "type": { 269 | "kind": "SCALAR", 270 | "name": "String", 271 | "ofType": null, 272 | "__typename": "__Type" 273 | }, 274 | "defaultValue": null, 275 | "__typename": "__InputValue" 276 | } 277 | ], 278 | "interfaces": null, 279 | "enumValues": null, 280 | "possibleTypes": null, 281 | "__typename": "__Type" 282 | }, 283 | { 284 | "kind": "OBJECT", 285 | "name": "__Directive", 286 | "description": null, 287 | "fields": [ 288 | { 289 | "name": "args", 290 | "description": null, 291 | "args": [], 292 | "type": { 293 | "kind": "NON_NULL", 294 | "name": null, 295 | "ofType": { 296 | "kind": "LIST", 297 | "name": null, 298 | "ofType": { 299 | "kind": "NON_NULL", 300 | "name": null, 301 | "ofType": { 302 | "kind": "OBJECT", 303 | "name": "__InputValue", 304 | "ofType": null, 305 | "__typename": "__Type" 306 | }, 307 | "__typename": "__Type" 308 | }, 309 | "__typename": "__Type" 310 | }, 311 | "__typename": "__Type" 312 | }, 313 | "isDeprecated": false, 314 | "deprecationReason": null, 315 | "__typename": "__Field" 316 | }, 317 | { 318 | "name": "description", 319 | "description": null, 320 | "args": [], 321 | "type": { 322 | "kind": "SCALAR", 323 | "name": "String", 324 | "ofType": null, 325 | "__typename": "__Type" 326 | }, 327 | "isDeprecated": false, 328 | "deprecationReason": null, 329 | "__typename": "__Field" 330 | }, 331 | { 332 | "name": "locations", 333 | "description": null, 334 | "args": [], 335 | "type": { 336 | "kind": "NON_NULL", 337 | "name": null, 338 | "ofType": { 339 | "kind": "LIST", 340 | "name": null, 341 | "ofType": { 342 | "kind": "NON_NULL", 343 | "name": null, 344 | "ofType": { 345 | "kind": "ENUM", 346 | "name": "__DirectiveLocation", 347 | "ofType": null, 348 | "__typename": "__Type" 349 | }, 350 | "__typename": "__Type" 351 | }, 352 | "__typename": "__Type" 353 | }, 354 | "__typename": "__Type" 355 | }, 356 | "isDeprecated": false, 357 | "deprecationReason": null, 358 | "__typename": "__Field" 359 | }, 360 | { 361 | "name": "name", 362 | "description": null, 363 | "args": [], 364 | "type": { 365 | "kind": "NON_NULL", 366 | "name": null, 367 | "ofType": { 368 | "kind": "SCALAR", 369 | "name": "String", 370 | "ofType": null, 371 | "__typename": "__Type" 372 | }, 373 | "__typename": "__Type" 374 | }, 375 | "isDeprecated": false, 376 | "deprecationReason": null, 377 | "__typename": "__Field" 378 | } 379 | ], 380 | "inputFields": null, 381 | "interfaces": [], 382 | "enumValues": null, 383 | "possibleTypes": null, 384 | "__typename": "__Type" 385 | }, 386 | { 387 | "kind": "ENUM", 388 | "name": "__DirectiveLocation", 389 | "description": null, 390 | "fields": null, 391 | "inputFields": null, 392 | "interfaces": null, 393 | "enumValues": [ 394 | { 395 | "name": "ARGUMENT_DEFINITION", 396 | "description": null, 397 | "isDeprecated": false, 398 | "deprecationReason": null, 399 | "__typename": "__EnumValue" 400 | }, 401 | { 402 | "name": "ENUM", 403 | "description": null, 404 | "isDeprecated": false, 405 | "deprecationReason": null, 406 | "__typename": "__EnumValue" 407 | }, 408 | { 409 | "name": "ENUM_VALUE", 410 | "description": null, 411 | "isDeprecated": false, 412 | "deprecationReason": null, 413 | "__typename": "__EnumValue" 414 | }, 415 | { 416 | "name": "FIELD", 417 | "description": null, 418 | "isDeprecated": false, 419 | "deprecationReason": null, 420 | "__typename": "__EnumValue" 421 | }, 422 | { 423 | "name": "FIELD_DEFINITION", 424 | "description": null, 425 | "isDeprecated": false, 426 | "deprecationReason": null, 427 | "__typename": "__EnumValue" 428 | }, 429 | { 430 | "name": "FRAGMENT_DEFINITION", 431 | "description": null, 432 | "isDeprecated": false, 433 | "deprecationReason": null, 434 | "__typename": "__EnumValue" 435 | }, 436 | { 437 | "name": "FRAGMENT_SPREAD", 438 | "description": null, 439 | "isDeprecated": false, 440 | "deprecationReason": null, 441 | "__typename": "__EnumValue" 442 | }, 443 | { 444 | "name": "INLINE_FRAGMENT", 445 | "description": null, 446 | "isDeprecated": false, 447 | "deprecationReason": null, 448 | "__typename": "__EnumValue" 449 | }, 450 | { 451 | "name": "INPUT_FIELD_DEFINITION", 452 | "description": null, 453 | "isDeprecated": false, 454 | "deprecationReason": null, 455 | "__typename": "__EnumValue" 456 | }, 457 | { 458 | "name": "INPUT_OBJECT", 459 | "description": null, 460 | "isDeprecated": false, 461 | "deprecationReason": null, 462 | "__typename": "__EnumValue" 463 | }, 464 | { 465 | "name": "INTERFACE", 466 | "description": null, 467 | "isDeprecated": false, 468 | "deprecationReason": null, 469 | "__typename": "__EnumValue" 470 | }, 471 | { 472 | "name": "MUTATION", 473 | "description": null, 474 | "isDeprecated": false, 475 | "deprecationReason": null, 476 | "__typename": "__EnumValue" 477 | }, 478 | { 479 | "name": "OBJECT", 480 | "description": null, 481 | "isDeprecated": false, 482 | "deprecationReason": null, 483 | "__typename": "__EnumValue" 484 | }, 485 | { 486 | "name": "QUERY", 487 | "description": null, 488 | "isDeprecated": false, 489 | "deprecationReason": null, 490 | "__typename": "__EnumValue" 491 | }, 492 | { 493 | "name": "SCALAR", 494 | "description": null, 495 | "isDeprecated": false, 496 | "deprecationReason": null, 497 | "__typename": "__EnumValue" 498 | }, 499 | { 500 | "name": "SCHEMA", 501 | "description": null, 502 | "isDeprecated": false, 503 | "deprecationReason": null, 504 | "__typename": "__EnumValue" 505 | }, 506 | { 507 | "name": "SUBSCRIPTION", 508 | "description": null, 509 | "isDeprecated": false, 510 | "deprecationReason": null, 511 | "__typename": "__EnumValue" 512 | }, 513 | { 514 | "name": "UNION", 515 | "description": null, 516 | "isDeprecated": false, 517 | "deprecationReason": null, 518 | "__typename": "__EnumValue" 519 | } 520 | ], 521 | "possibleTypes": null, 522 | "__typename": "__Type" 523 | }, 524 | { 525 | "kind": "OBJECT", 526 | "name": "__EnumValue", 527 | "description": null, 528 | "fields": [ 529 | { 530 | "name": "deprecationReason", 531 | "description": null, 532 | "args": [], 533 | "type": { 534 | "kind": "SCALAR", 535 | "name": "String", 536 | "ofType": null, 537 | "__typename": "__Type" 538 | }, 539 | "isDeprecated": false, 540 | "deprecationReason": null, 541 | "__typename": "__Field" 542 | }, 543 | { 544 | "name": "description", 545 | "description": null, 546 | "args": [], 547 | "type": { 548 | "kind": "SCALAR", 549 | "name": "String", 550 | "ofType": null, 551 | "__typename": "__Type" 552 | }, 553 | "isDeprecated": false, 554 | "deprecationReason": null, 555 | "__typename": "__Field" 556 | }, 557 | { 558 | "name": "isDeprecated", 559 | "description": null, 560 | "args": [], 561 | "type": { 562 | "kind": "NON_NULL", 563 | "name": null, 564 | "ofType": { 565 | "kind": "SCALAR", 566 | "name": "Boolean", 567 | "ofType": null, 568 | "__typename": "__Type" 569 | }, 570 | "__typename": "__Type" 571 | }, 572 | "isDeprecated": false, 573 | "deprecationReason": null, 574 | "__typename": "__Field" 575 | }, 576 | { 577 | "name": "name", 578 | "description": null, 579 | "args": [], 580 | "type": { 581 | "kind": "NON_NULL", 582 | "name": null, 583 | "ofType": { 584 | "kind": "SCALAR", 585 | "name": "String", 586 | "ofType": null, 587 | "__typename": "__Type" 588 | }, 589 | "__typename": "__Type" 590 | }, 591 | "isDeprecated": false, 592 | "deprecationReason": null, 593 | "__typename": "__Field" 594 | } 595 | ], 596 | "inputFields": null, 597 | "interfaces": [], 598 | "enumValues": null, 599 | "possibleTypes": null, 600 | "__typename": "__Type" 601 | }, 602 | { 603 | "kind": "OBJECT", 604 | "name": "__Field", 605 | "description": null, 606 | "fields": [ 607 | { 608 | "name": "args", 609 | "description": null, 610 | "args": [], 611 | "type": { 612 | "kind": "NON_NULL", 613 | "name": null, 614 | "ofType": { 615 | "kind": "LIST", 616 | "name": null, 617 | "ofType": { 618 | "kind": "NON_NULL", 619 | "name": null, 620 | "ofType": { 621 | "kind": "OBJECT", 622 | "name": "__InputValue", 623 | "ofType": null, 624 | "__typename": "__Type" 625 | }, 626 | "__typename": "__Type" 627 | }, 628 | "__typename": "__Type" 629 | }, 630 | "__typename": "__Type" 631 | }, 632 | "isDeprecated": false, 633 | "deprecationReason": null, 634 | "__typename": "__Field" 635 | }, 636 | { 637 | "name": "deprecationReason", 638 | "description": null, 639 | "args": [], 640 | "type": { 641 | "kind": "SCALAR", 642 | "name": "String", 643 | "ofType": null, 644 | "__typename": "__Type" 645 | }, 646 | "isDeprecated": false, 647 | "deprecationReason": null, 648 | "__typename": "__Field" 649 | }, 650 | { 651 | "name": "description", 652 | "description": null, 653 | "args": [], 654 | "type": { 655 | "kind": "SCALAR", 656 | "name": "String", 657 | "ofType": null, 658 | "__typename": "__Type" 659 | }, 660 | "isDeprecated": false, 661 | "deprecationReason": null, 662 | "__typename": "__Field" 663 | }, 664 | { 665 | "name": "isDeprecated", 666 | "description": null, 667 | "args": [], 668 | "type": { 669 | "kind": "NON_NULL", 670 | "name": null, 671 | "ofType": { 672 | "kind": "SCALAR", 673 | "name": "Boolean", 674 | "ofType": null, 675 | "__typename": "__Type" 676 | }, 677 | "__typename": "__Type" 678 | }, 679 | "isDeprecated": false, 680 | "deprecationReason": null, 681 | "__typename": "__Field" 682 | }, 683 | { 684 | "name": "name", 685 | "description": null, 686 | "args": [], 687 | "type": { 688 | "kind": "NON_NULL", 689 | "name": null, 690 | "ofType": { 691 | "kind": "SCALAR", 692 | "name": "String", 693 | "ofType": null, 694 | "__typename": "__Type" 695 | }, 696 | "__typename": "__Type" 697 | }, 698 | "isDeprecated": false, 699 | "deprecationReason": null, 700 | "__typename": "__Field" 701 | }, 702 | { 703 | "name": "type", 704 | "description": null, 705 | "args": [], 706 | "type": { 707 | "kind": "NON_NULL", 708 | "name": null, 709 | "ofType": { 710 | "kind": "OBJECT", 711 | "name": "__Type", 712 | "ofType": null, 713 | "__typename": "__Type" 714 | }, 715 | "__typename": "__Type" 716 | }, 717 | "isDeprecated": false, 718 | "deprecationReason": null, 719 | "__typename": "__Field" 720 | } 721 | ], 722 | "inputFields": null, 723 | "interfaces": [], 724 | "enumValues": null, 725 | "possibleTypes": null, 726 | "__typename": "__Type" 727 | }, 728 | { 729 | "kind": "OBJECT", 730 | "name": "__InputValue", 731 | "description": null, 732 | "fields": [ 733 | { 734 | "name": "defaultValue", 735 | "description": null, 736 | "args": [], 737 | "type": { 738 | "kind": "SCALAR", 739 | "name": "String", 740 | "ofType": null, 741 | "__typename": "__Type" 742 | }, 743 | "isDeprecated": false, 744 | "deprecationReason": null, 745 | "__typename": "__Field" 746 | }, 747 | { 748 | "name": "description", 749 | "description": null, 750 | "args": [], 751 | "type": { 752 | "kind": "SCALAR", 753 | "name": "String", 754 | "ofType": null, 755 | "__typename": "__Type" 756 | }, 757 | "isDeprecated": false, 758 | "deprecationReason": null, 759 | "__typename": "__Field" 760 | }, 761 | { 762 | "name": "name", 763 | "description": null, 764 | "args": [], 765 | "type": { 766 | "kind": "NON_NULL", 767 | "name": null, 768 | "ofType": { 769 | "kind": "SCALAR", 770 | "name": "String", 771 | "ofType": null, 772 | "__typename": "__Type" 773 | }, 774 | "__typename": "__Type" 775 | }, 776 | "isDeprecated": false, 777 | "deprecationReason": null, 778 | "__typename": "__Field" 779 | }, 780 | { 781 | "name": "type", 782 | "description": null, 783 | "args": [], 784 | "type": { 785 | "kind": "NON_NULL", 786 | "name": null, 787 | "ofType": { 788 | "kind": "OBJECT", 789 | "name": "__Type", 790 | "ofType": null, 791 | "__typename": "__Type" 792 | }, 793 | "__typename": "__Type" 794 | }, 795 | "isDeprecated": false, 796 | "deprecationReason": null, 797 | "__typename": "__Field" 798 | } 799 | ], 800 | "inputFields": null, 801 | "interfaces": [], 802 | "enumValues": null, 803 | "possibleTypes": null, 804 | "__typename": "__Type" 805 | }, 806 | { 807 | "kind": "OBJECT", 808 | "name": "__Schema", 809 | "description": null, 810 | "fields": [ 811 | { 812 | "name": "directives", 813 | "description": null, 814 | "args": [], 815 | "type": { 816 | "kind": "NON_NULL", 817 | "name": null, 818 | "ofType": { 819 | "kind": "LIST", 820 | "name": null, 821 | "ofType": { 822 | "kind": "NON_NULL", 823 | "name": null, 824 | "ofType": { 825 | "kind": "OBJECT", 826 | "name": "__Directive", 827 | "ofType": null, 828 | "__typename": "__Type" 829 | }, 830 | "__typename": "__Type" 831 | }, 832 | "__typename": "__Type" 833 | }, 834 | "__typename": "__Type" 835 | }, 836 | "isDeprecated": false, 837 | "deprecationReason": null, 838 | "__typename": "__Field" 839 | }, 840 | { 841 | "name": "mutationType", 842 | "description": null, 843 | "args": [], 844 | "type": { 845 | "kind": "OBJECT", 846 | "name": "__Type", 847 | "ofType": null, 848 | "__typename": "__Type" 849 | }, 850 | "isDeprecated": false, 851 | "deprecationReason": null, 852 | "__typename": "__Field" 853 | }, 854 | { 855 | "name": "queryType", 856 | "description": null, 857 | "args": [], 858 | "type": { 859 | "kind": "NON_NULL", 860 | "name": null, 861 | "ofType": { 862 | "kind": "OBJECT", 863 | "name": "__Type", 864 | "ofType": null, 865 | "__typename": "__Type" 866 | }, 867 | "__typename": "__Type" 868 | }, 869 | "isDeprecated": false, 870 | "deprecationReason": null, 871 | "__typename": "__Field" 872 | }, 873 | { 874 | "name": "subscriptionType", 875 | "description": null, 876 | "args": [], 877 | "type": { 878 | "kind": "OBJECT", 879 | "name": "__Type", 880 | "ofType": null, 881 | "__typename": "__Type" 882 | }, 883 | "isDeprecated": false, 884 | "deprecationReason": null, 885 | "__typename": "__Field" 886 | }, 887 | { 888 | "name": "types", 889 | "description": null, 890 | "args": [], 891 | "type": { 892 | "kind": "NON_NULL", 893 | "name": null, 894 | "ofType": { 895 | "kind": "LIST", 896 | "name": null, 897 | "ofType": { 898 | "kind": "NON_NULL", 899 | "name": null, 900 | "ofType": { 901 | "kind": "OBJECT", 902 | "name": "__Type", 903 | "ofType": null, 904 | "__typename": "__Type" 905 | }, 906 | "__typename": "__Type" 907 | }, 908 | "__typename": "__Type" 909 | }, 910 | "__typename": "__Type" 911 | }, 912 | "isDeprecated": false, 913 | "deprecationReason": null, 914 | "__typename": "__Field" 915 | } 916 | ], 917 | "inputFields": null, 918 | "interfaces": [], 919 | "enumValues": null, 920 | "possibleTypes": null, 921 | "__typename": "__Type" 922 | }, 923 | { 924 | "kind": "OBJECT", 925 | "name": "__Type", 926 | "description": null, 927 | "fields": [ 928 | { 929 | "name": "description", 930 | "description": null, 931 | "args": [], 932 | "type": { 933 | "kind": "SCALAR", 934 | "name": "String", 935 | "ofType": null, 936 | "__typename": "__Type" 937 | }, 938 | "isDeprecated": false, 939 | "deprecationReason": null, 940 | "__typename": "__Field" 941 | }, 942 | { 943 | "name": "enumValues", 944 | "description": null, 945 | "args": [ 946 | { 947 | "name": "includeDeprecated", 948 | "description": null, 949 | "type": { 950 | "kind": "SCALAR", 951 | "name": "Boolean", 952 | "ofType": null, 953 | "__typename": "__Type" 954 | }, 955 | "defaultValue": "false", 956 | "__typename": "__InputValue" 957 | } 958 | ], 959 | "type": { 960 | "kind": "LIST", 961 | "name": null, 962 | "ofType": { 963 | "kind": "NON_NULL", 964 | "name": null, 965 | "ofType": { 966 | "kind": "OBJECT", 967 | "name": "__EnumValue", 968 | "ofType": null, 969 | "__typename": "__Type" 970 | }, 971 | "__typename": "__Type" 972 | }, 973 | "__typename": "__Type" 974 | }, 975 | "isDeprecated": false, 976 | "deprecationReason": null, 977 | "__typename": "__Field" 978 | }, 979 | { 980 | "name": "fields", 981 | "description": null, 982 | "args": [ 983 | { 984 | "name": "includeDeprecated", 985 | "description": null, 986 | "type": { 987 | "kind": "SCALAR", 988 | "name": "Boolean", 989 | "ofType": null, 990 | "__typename": "__Type" 991 | }, 992 | "defaultValue": "false", 993 | "__typename": "__InputValue" 994 | } 995 | ], 996 | "type": { 997 | "kind": "LIST", 998 | "name": null, 999 | "ofType": { 1000 | "kind": "NON_NULL", 1001 | "name": null, 1002 | "ofType": { 1003 | "kind": "OBJECT", 1004 | "name": "__Field", 1005 | "ofType": null, 1006 | "__typename": "__Type" 1007 | }, 1008 | "__typename": "__Type" 1009 | }, 1010 | "__typename": "__Type" 1011 | }, 1012 | "isDeprecated": false, 1013 | "deprecationReason": null, 1014 | "__typename": "__Field" 1015 | }, 1016 | { 1017 | "name": "inputFields", 1018 | "description": null, 1019 | "args": [], 1020 | "type": { 1021 | "kind": "LIST", 1022 | "name": null, 1023 | "ofType": { 1024 | "kind": "NON_NULL", 1025 | "name": null, 1026 | "ofType": { 1027 | "kind": "OBJECT", 1028 | "name": "__InputValue", 1029 | "ofType": null, 1030 | "__typename": "__Type" 1031 | }, 1032 | "__typename": "__Type" 1033 | }, 1034 | "__typename": "__Type" 1035 | }, 1036 | "isDeprecated": false, 1037 | "deprecationReason": null, 1038 | "__typename": "__Field" 1039 | }, 1040 | { 1041 | "name": "interfaces", 1042 | "description": null, 1043 | "args": [], 1044 | "type": { 1045 | "kind": "LIST", 1046 | "name": null, 1047 | "ofType": { 1048 | "kind": "NON_NULL", 1049 | "name": null, 1050 | "ofType": { 1051 | "kind": "OBJECT", 1052 | "name": "__Type", 1053 | "ofType": null, 1054 | "__typename": "__Type" 1055 | }, 1056 | "__typename": "__Type" 1057 | }, 1058 | "__typename": "__Type" 1059 | }, 1060 | "isDeprecated": false, 1061 | "deprecationReason": null, 1062 | "__typename": "__Field" 1063 | }, 1064 | { 1065 | "name": "kind", 1066 | "description": null, 1067 | "args": [], 1068 | "type": { 1069 | "kind": "NON_NULL", 1070 | "name": null, 1071 | "ofType": { 1072 | "kind": "ENUM", 1073 | "name": "__TypeKind", 1074 | "ofType": null, 1075 | "__typename": "__Type" 1076 | }, 1077 | "__typename": "__Type" 1078 | }, 1079 | "isDeprecated": false, 1080 | "deprecationReason": null, 1081 | "__typename": "__Field" 1082 | }, 1083 | { 1084 | "name": "name", 1085 | "description": null, 1086 | "args": [], 1087 | "type": { 1088 | "kind": "SCALAR", 1089 | "name": "String", 1090 | "ofType": null, 1091 | "__typename": "__Type" 1092 | }, 1093 | "isDeprecated": false, 1094 | "deprecationReason": null, 1095 | "__typename": "__Field" 1096 | }, 1097 | { 1098 | "name": "ofType", 1099 | "description": null, 1100 | "args": [], 1101 | "type": { 1102 | "kind": "OBJECT", 1103 | "name": "__Type", 1104 | "ofType": null, 1105 | "__typename": "__Type" 1106 | }, 1107 | "isDeprecated": false, 1108 | "deprecationReason": null, 1109 | "__typename": "__Field" 1110 | }, 1111 | { 1112 | "name": "possibleTypes", 1113 | "description": null, 1114 | "args": [], 1115 | "type": { 1116 | "kind": "LIST", 1117 | "name": null, 1118 | "ofType": { 1119 | "kind": "NON_NULL", 1120 | "name": null, 1121 | "ofType": { 1122 | "kind": "OBJECT", 1123 | "name": "__Type", 1124 | "ofType": null, 1125 | "__typename": "__Type" 1126 | }, 1127 | "__typename": "__Type" 1128 | }, 1129 | "__typename": "__Type" 1130 | }, 1131 | "isDeprecated": false, 1132 | "deprecationReason": null, 1133 | "__typename": "__Field" 1134 | } 1135 | ], 1136 | "inputFields": null, 1137 | "interfaces": [], 1138 | "enumValues": null, 1139 | "possibleTypes": null, 1140 | "__typename": "__Type" 1141 | }, 1142 | { 1143 | "kind": "ENUM", 1144 | "name": "__TypeKind", 1145 | "description": null, 1146 | "fields": null, 1147 | "inputFields": null, 1148 | "interfaces": null, 1149 | "enumValues": [ 1150 | { 1151 | "name": "ENUM", 1152 | "description": null, 1153 | "isDeprecated": false, 1154 | "deprecationReason": null, 1155 | "__typename": "__EnumValue" 1156 | }, 1157 | { 1158 | "name": "INPUT_OBJECT", 1159 | "description": null, 1160 | "isDeprecated": false, 1161 | "deprecationReason": null, 1162 | "__typename": "__EnumValue" 1163 | }, 1164 | { 1165 | "name": "INTERFACE", 1166 | "description": null, 1167 | "isDeprecated": false, 1168 | "deprecationReason": null, 1169 | "__typename": "__EnumValue" 1170 | }, 1171 | { 1172 | "name": "LIST", 1173 | "description": null, 1174 | "isDeprecated": false, 1175 | "deprecationReason": null, 1176 | "__typename": "__EnumValue" 1177 | }, 1178 | { 1179 | "name": "NON_NULL", 1180 | "description": null, 1181 | "isDeprecated": false, 1182 | "deprecationReason": null, 1183 | "__typename": "__EnumValue" 1184 | }, 1185 | { 1186 | "name": "OBJECT", 1187 | "description": null, 1188 | "isDeprecated": false, 1189 | "deprecationReason": null, 1190 | "__typename": "__EnumValue" 1191 | }, 1192 | { 1193 | "name": "SCALAR", 1194 | "description": null, 1195 | "isDeprecated": false, 1196 | "deprecationReason": null, 1197 | "__typename": "__EnumValue" 1198 | }, 1199 | { 1200 | "name": "UNION", 1201 | "description": null, 1202 | "isDeprecated": false, 1203 | "deprecationReason": null, 1204 | "__typename": "__EnumValue" 1205 | } 1206 | ], 1207 | "possibleTypes": null, 1208 | "__typename": "__Type" 1209 | }, 1210 | { 1211 | "kind": "OBJECT", 1212 | "name": "mutation_root", 1213 | "description": "mutation root", 1214 | "fields": [ 1215 | { 1216 | "name": "delete_user", 1217 | "description": "delete data from the table: \"user\"", 1218 | "args": [ 1219 | { 1220 | "name": "where", 1221 | "description": "filter the rows which have to be deleted", 1222 | "type": { 1223 | "kind": "NON_NULL", 1224 | "name": null, 1225 | "ofType": { 1226 | "kind": "INPUT_OBJECT", 1227 | "name": "user_bool_exp", 1228 | "ofType": null, 1229 | "__typename": "__Type" 1230 | }, 1231 | "__typename": "__Type" 1232 | }, 1233 | "defaultValue": null, 1234 | "__typename": "__InputValue" 1235 | } 1236 | ], 1237 | "type": { 1238 | "kind": "OBJECT", 1239 | "name": "user_mutation_response", 1240 | "ofType": null, 1241 | "__typename": "__Type" 1242 | }, 1243 | "isDeprecated": false, 1244 | "deprecationReason": null, 1245 | "__typename": "__Field" 1246 | }, 1247 | { 1248 | "name": "delete_user_by_pk", 1249 | "description": "delete single row from the table: \"user\"", 1250 | "args": [ 1251 | { 1252 | "name": "id", 1253 | "description": null, 1254 | "type": { 1255 | "kind": "NON_NULL", 1256 | "name": null, 1257 | "ofType": { 1258 | "kind": "SCALAR", 1259 | "name": "uuid", 1260 | "ofType": null, 1261 | "__typename": "__Type" 1262 | }, 1263 | "__typename": "__Type" 1264 | }, 1265 | "defaultValue": null, 1266 | "__typename": "__InputValue" 1267 | } 1268 | ], 1269 | "type": { 1270 | "kind": "OBJECT", 1271 | "name": "user", 1272 | "ofType": null, 1273 | "__typename": "__Type" 1274 | }, 1275 | "isDeprecated": false, 1276 | "deprecationReason": null, 1277 | "__typename": "__Field" 1278 | }, 1279 | { 1280 | "name": "insert_user", 1281 | "description": "insert data into the table: \"user\"", 1282 | "args": [ 1283 | { 1284 | "name": "objects", 1285 | "description": "the rows to be inserted", 1286 | "type": { 1287 | "kind": "NON_NULL", 1288 | "name": null, 1289 | "ofType": { 1290 | "kind": "LIST", 1291 | "name": null, 1292 | "ofType": { 1293 | "kind": "NON_NULL", 1294 | "name": null, 1295 | "ofType": { 1296 | "kind": "INPUT_OBJECT", 1297 | "name": "user_insert_input", 1298 | "ofType": null, 1299 | "__typename": "__Type" 1300 | }, 1301 | "__typename": "__Type" 1302 | }, 1303 | "__typename": "__Type" 1304 | }, 1305 | "__typename": "__Type" 1306 | }, 1307 | "defaultValue": null, 1308 | "__typename": "__InputValue" 1309 | }, 1310 | { 1311 | "name": "on_conflict", 1312 | "description": "on conflict condition", 1313 | "type": { 1314 | "kind": "INPUT_OBJECT", 1315 | "name": "user_on_conflict", 1316 | "ofType": null, 1317 | "__typename": "__Type" 1318 | }, 1319 | "defaultValue": null, 1320 | "__typename": "__InputValue" 1321 | } 1322 | ], 1323 | "type": { 1324 | "kind": "OBJECT", 1325 | "name": "user_mutation_response", 1326 | "ofType": null, 1327 | "__typename": "__Type" 1328 | }, 1329 | "isDeprecated": false, 1330 | "deprecationReason": null, 1331 | "__typename": "__Field" 1332 | }, 1333 | { 1334 | "name": "insert_user_one", 1335 | "description": "insert a single row into the table: \"user\"", 1336 | "args": [ 1337 | { 1338 | "name": "object", 1339 | "description": "the row to be inserted", 1340 | "type": { 1341 | "kind": "NON_NULL", 1342 | "name": null, 1343 | "ofType": { 1344 | "kind": "INPUT_OBJECT", 1345 | "name": "user_insert_input", 1346 | "ofType": null, 1347 | "__typename": "__Type" 1348 | }, 1349 | "__typename": "__Type" 1350 | }, 1351 | "defaultValue": null, 1352 | "__typename": "__InputValue" 1353 | }, 1354 | { 1355 | "name": "on_conflict", 1356 | "description": "on conflict condition", 1357 | "type": { 1358 | "kind": "INPUT_OBJECT", 1359 | "name": "user_on_conflict", 1360 | "ofType": null, 1361 | "__typename": "__Type" 1362 | }, 1363 | "defaultValue": null, 1364 | "__typename": "__InputValue" 1365 | } 1366 | ], 1367 | "type": { 1368 | "kind": "OBJECT", 1369 | "name": "user", 1370 | "ofType": null, 1371 | "__typename": "__Type" 1372 | }, 1373 | "isDeprecated": false, 1374 | "deprecationReason": null, 1375 | "__typename": "__Field" 1376 | }, 1377 | { 1378 | "name": "update_user", 1379 | "description": "update data of the table: \"user\"", 1380 | "args": [ 1381 | { 1382 | "name": "_set", 1383 | "description": "sets the columns of the filtered rows to the given values", 1384 | "type": { 1385 | "kind": "INPUT_OBJECT", 1386 | "name": "user_set_input", 1387 | "ofType": null, 1388 | "__typename": "__Type" 1389 | }, 1390 | "defaultValue": null, 1391 | "__typename": "__InputValue" 1392 | }, 1393 | { 1394 | "name": "where", 1395 | "description": "filter the rows which have to be updated", 1396 | "type": { 1397 | "kind": "NON_NULL", 1398 | "name": null, 1399 | "ofType": { 1400 | "kind": "INPUT_OBJECT", 1401 | "name": "user_bool_exp", 1402 | "ofType": null, 1403 | "__typename": "__Type" 1404 | }, 1405 | "__typename": "__Type" 1406 | }, 1407 | "defaultValue": null, 1408 | "__typename": "__InputValue" 1409 | } 1410 | ], 1411 | "type": { 1412 | "kind": "OBJECT", 1413 | "name": "user_mutation_response", 1414 | "ofType": null, 1415 | "__typename": "__Type" 1416 | }, 1417 | "isDeprecated": false, 1418 | "deprecationReason": null, 1419 | "__typename": "__Field" 1420 | }, 1421 | { 1422 | "name": "update_user_by_pk", 1423 | "description": "update single row of the table: \"user\"", 1424 | "args": [ 1425 | { 1426 | "name": "_set", 1427 | "description": "sets the columns of the filtered rows to the given values", 1428 | "type": { 1429 | "kind": "INPUT_OBJECT", 1430 | "name": "user_set_input", 1431 | "ofType": null, 1432 | "__typename": "__Type" 1433 | }, 1434 | "defaultValue": null, 1435 | "__typename": "__InputValue" 1436 | }, 1437 | { 1438 | "name": "pk_columns", 1439 | "description": null, 1440 | "type": { 1441 | "kind": "NON_NULL", 1442 | "name": null, 1443 | "ofType": { 1444 | "kind": "INPUT_OBJECT", 1445 | "name": "user_pk_columns_input", 1446 | "ofType": null, 1447 | "__typename": "__Type" 1448 | }, 1449 | "__typename": "__Type" 1450 | }, 1451 | "defaultValue": null, 1452 | "__typename": "__InputValue" 1453 | } 1454 | ], 1455 | "type": { 1456 | "kind": "OBJECT", 1457 | "name": "user", 1458 | "ofType": null, 1459 | "__typename": "__Type" 1460 | }, 1461 | "isDeprecated": false, 1462 | "deprecationReason": null, 1463 | "__typename": "__Field" 1464 | } 1465 | ], 1466 | "inputFields": null, 1467 | "interfaces": [], 1468 | "enumValues": null, 1469 | "possibleTypes": null, 1470 | "__typename": "__Type" 1471 | }, 1472 | { 1473 | "kind": "ENUM", 1474 | "name": "order_by", 1475 | "description": "column ordering options", 1476 | "fields": null, 1477 | "inputFields": null, 1478 | "interfaces": null, 1479 | "enumValues": [ 1480 | { 1481 | "name": "asc", 1482 | "description": "in the ascending order, nulls last", 1483 | "isDeprecated": false, 1484 | "deprecationReason": null, 1485 | "__typename": "__EnumValue" 1486 | }, 1487 | { 1488 | "name": "asc_nulls_first", 1489 | "description": "in the ascending order, nulls first", 1490 | "isDeprecated": false, 1491 | "deprecationReason": null, 1492 | "__typename": "__EnumValue" 1493 | }, 1494 | { 1495 | "name": "asc_nulls_last", 1496 | "description": "in the ascending order, nulls last", 1497 | "isDeprecated": false, 1498 | "deprecationReason": null, 1499 | "__typename": "__EnumValue" 1500 | }, 1501 | { 1502 | "name": "desc", 1503 | "description": "in the descending order, nulls first", 1504 | "isDeprecated": false, 1505 | "deprecationReason": null, 1506 | "__typename": "__EnumValue" 1507 | }, 1508 | { 1509 | "name": "desc_nulls_first", 1510 | "description": "in the descending order, nulls first", 1511 | "isDeprecated": false, 1512 | "deprecationReason": null, 1513 | "__typename": "__EnumValue" 1514 | }, 1515 | { 1516 | "name": "desc_nulls_last", 1517 | "description": "in the descending order, nulls last", 1518 | "isDeprecated": false, 1519 | "deprecationReason": null, 1520 | "__typename": "__EnumValue" 1521 | } 1522 | ], 1523 | "possibleTypes": null, 1524 | "__typename": "__Type" 1525 | }, 1526 | { 1527 | "kind": "OBJECT", 1528 | "name": "query_root", 1529 | "description": "query root", 1530 | "fields": [ 1531 | { 1532 | "name": "user", 1533 | "description": "fetch data from the table: \"user\"", 1534 | "args": [ 1535 | { 1536 | "name": "distinct_on", 1537 | "description": "distinct select on columns", 1538 | "type": { 1539 | "kind": "LIST", 1540 | "name": null, 1541 | "ofType": { 1542 | "kind": "NON_NULL", 1543 | "name": null, 1544 | "ofType": { 1545 | "kind": "ENUM", 1546 | "name": "user_select_column", 1547 | "ofType": null, 1548 | "__typename": "__Type" 1549 | }, 1550 | "__typename": "__Type" 1551 | }, 1552 | "__typename": "__Type" 1553 | }, 1554 | "defaultValue": null, 1555 | "__typename": "__InputValue" 1556 | }, 1557 | { 1558 | "name": "limit", 1559 | "description": "limit the number of rows returned", 1560 | "type": { 1561 | "kind": "SCALAR", 1562 | "name": "Int", 1563 | "ofType": null, 1564 | "__typename": "__Type" 1565 | }, 1566 | "defaultValue": null, 1567 | "__typename": "__InputValue" 1568 | }, 1569 | { 1570 | "name": "offset", 1571 | "description": "skip the first n rows. Use only with order_by", 1572 | "type": { 1573 | "kind": "SCALAR", 1574 | "name": "Int", 1575 | "ofType": null, 1576 | "__typename": "__Type" 1577 | }, 1578 | "defaultValue": null, 1579 | "__typename": "__InputValue" 1580 | }, 1581 | { 1582 | "name": "order_by", 1583 | "description": "sort the rows by one or more columns", 1584 | "type": { 1585 | "kind": "LIST", 1586 | "name": null, 1587 | "ofType": { 1588 | "kind": "NON_NULL", 1589 | "name": null, 1590 | "ofType": { 1591 | "kind": "INPUT_OBJECT", 1592 | "name": "user_order_by", 1593 | "ofType": null, 1594 | "__typename": "__Type" 1595 | }, 1596 | "__typename": "__Type" 1597 | }, 1598 | "__typename": "__Type" 1599 | }, 1600 | "defaultValue": null, 1601 | "__typename": "__InputValue" 1602 | }, 1603 | { 1604 | "name": "where", 1605 | "description": "filter the rows returned", 1606 | "type": { 1607 | "kind": "INPUT_OBJECT", 1608 | "name": "user_bool_exp", 1609 | "ofType": null, 1610 | "__typename": "__Type" 1611 | }, 1612 | "defaultValue": null, 1613 | "__typename": "__InputValue" 1614 | } 1615 | ], 1616 | "type": { 1617 | "kind": "NON_NULL", 1618 | "name": null, 1619 | "ofType": { 1620 | "kind": "LIST", 1621 | "name": null, 1622 | "ofType": { 1623 | "kind": "NON_NULL", 1624 | "name": null, 1625 | "ofType": { 1626 | "kind": "OBJECT", 1627 | "name": "user", 1628 | "ofType": null, 1629 | "__typename": "__Type" 1630 | }, 1631 | "__typename": "__Type" 1632 | }, 1633 | "__typename": "__Type" 1634 | }, 1635 | "__typename": "__Type" 1636 | }, 1637 | "isDeprecated": false, 1638 | "deprecationReason": null, 1639 | "__typename": "__Field" 1640 | }, 1641 | { 1642 | "name": "user_aggregate", 1643 | "description": "fetch aggregated fields from the table: \"user\"", 1644 | "args": [ 1645 | { 1646 | "name": "distinct_on", 1647 | "description": "distinct select on columns", 1648 | "type": { 1649 | "kind": "LIST", 1650 | "name": null, 1651 | "ofType": { 1652 | "kind": "NON_NULL", 1653 | "name": null, 1654 | "ofType": { 1655 | "kind": "ENUM", 1656 | "name": "user_select_column", 1657 | "ofType": null, 1658 | "__typename": "__Type" 1659 | }, 1660 | "__typename": "__Type" 1661 | }, 1662 | "__typename": "__Type" 1663 | }, 1664 | "defaultValue": null, 1665 | "__typename": "__InputValue" 1666 | }, 1667 | { 1668 | "name": "limit", 1669 | "description": "limit the number of rows returned", 1670 | "type": { 1671 | "kind": "SCALAR", 1672 | "name": "Int", 1673 | "ofType": null, 1674 | "__typename": "__Type" 1675 | }, 1676 | "defaultValue": null, 1677 | "__typename": "__InputValue" 1678 | }, 1679 | { 1680 | "name": "offset", 1681 | "description": "skip the first n rows. Use only with order_by", 1682 | "type": { 1683 | "kind": "SCALAR", 1684 | "name": "Int", 1685 | "ofType": null, 1686 | "__typename": "__Type" 1687 | }, 1688 | "defaultValue": null, 1689 | "__typename": "__InputValue" 1690 | }, 1691 | { 1692 | "name": "order_by", 1693 | "description": "sort the rows by one or more columns", 1694 | "type": { 1695 | "kind": "LIST", 1696 | "name": null, 1697 | "ofType": { 1698 | "kind": "NON_NULL", 1699 | "name": null, 1700 | "ofType": { 1701 | "kind": "INPUT_OBJECT", 1702 | "name": "user_order_by", 1703 | "ofType": null, 1704 | "__typename": "__Type" 1705 | }, 1706 | "__typename": "__Type" 1707 | }, 1708 | "__typename": "__Type" 1709 | }, 1710 | "defaultValue": null, 1711 | "__typename": "__InputValue" 1712 | }, 1713 | { 1714 | "name": "where", 1715 | "description": "filter the rows returned", 1716 | "type": { 1717 | "kind": "INPUT_OBJECT", 1718 | "name": "user_bool_exp", 1719 | "ofType": null, 1720 | "__typename": "__Type" 1721 | }, 1722 | "defaultValue": null, 1723 | "__typename": "__InputValue" 1724 | } 1725 | ], 1726 | "type": { 1727 | "kind": "NON_NULL", 1728 | "name": null, 1729 | "ofType": { 1730 | "kind": "OBJECT", 1731 | "name": "user_aggregate", 1732 | "ofType": null, 1733 | "__typename": "__Type" 1734 | }, 1735 | "__typename": "__Type" 1736 | }, 1737 | "isDeprecated": false, 1738 | "deprecationReason": null, 1739 | "__typename": "__Field" 1740 | }, 1741 | { 1742 | "name": "user_by_pk", 1743 | "description": "fetch data from the table: \"user\" using primary key columns", 1744 | "args": [ 1745 | { 1746 | "name": "id", 1747 | "description": null, 1748 | "type": { 1749 | "kind": "NON_NULL", 1750 | "name": null, 1751 | "ofType": { 1752 | "kind": "SCALAR", 1753 | "name": "uuid", 1754 | "ofType": null, 1755 | "__typename": "__Type" 1756 | }, 1757 | "__typename": "__Type" 1758 | }, 1759 | "defaultValue": null, 1760 | "__typename": "__InputValue" 1761 | } 1762 | ], 1763 | "type": { 1764 | "kind": "OBJECT", 1765 | "name": "user", 1766 | "ofType": null, 1767 | "__typename": "__Type" 1768 | }, 1769 | "isDeprecated": false, 1770 | "deprecationReason": null, 1771 | "__typename": "__Field" 1772 | } 1773 | ], 1774 | "inputFields": null, 1775 | "interfaces": [], 1776 | "enumValues": null, 1777 | "possibleTypes": null, 1778 | "__typename": "__Type" 1779 | }, 1780 | { 1781 | "kind": "OBJECT", 1782 | "name": "subscription_root", 1783 | "description": "subscription root", 1784 | "fields": [ 1785 | { 1786 | "name": "user", 1787 | "description": "fetch data from the table: \"user\"", 1788 | "args": [ 1789 | { 1790 | "name": "distinct_on", 1791 | "description": "distinct select on columns", 1792 | "type": { 1793 | "kind": "LIST", 1794 | "name": null, 1795 | "ofType": { 1796 | "kind": "NON_NULL", 1797 | "name": null, 1798 | "ofType": { 1799 | "kind": "ENUM", 1800 | "name": "user_select_column", 1801 | "ofType": null, 1802 | "__typename": "__Type" 1803 | }, 1804 | "__typename": "__Type" 1805 | }, 1806 | "__typename": "__Type" 1807 | }, 1808 | "defaultValue": null, 1809 | "__typename": "__InputValue" 1810 | }, 1811 | { 1812 | "name": "limit", 1813 | "description": "limit the number of rows returned", 1814 | "type": { 1815 | "kind": "SCALAR", 1816 | "name": "Int", 1817 | "ofType": null, 1818 | "__typename": "__Type" 1819 | }, 1820 | "defaultValue": null, 1821 | "__typename": "__InputValue" 1822 | }, 1823 | { 1824 | "name": "offset", 1825 | "description": "skip the first n rows. Use only with order_by", 1826 | "type": { 1827 | "kind": "SCALAR", 1828 | "name": "Int", 1829 | "ofType": null, 1830 | "__typename": "__Type" 1831 | }, 1832 | "defaultValue": null, 1833 | "__typename": "__InputValue" 1834 | }, 1835 | { 1836 | "name": "order_by", 1837 | "description": "sort the rows by one or more columns", 1838 | "type": { 1839 | "kind": "LIST", 1840 | "name": null, 1841 | "ofType": { 1842 | "kind": "NON_NULL", 1843 | "name": null, 1844 | "ofType": { 1845 | "kind": "INPUT_OBJECT", 1846 | "name": "user_order_by", 1847 | "ofType": null, 1848 | "__typename": "__Type" 1849 | }, 1850 | "__typename": "__Type" 1851 | }, 1852 | "__typename": "__Type" 1853 | }, 1854 | "defaultValue": null, 1855 | "__typename": "__InputValue" 1856 | }, 1857 | { 1858 | "name": "where", 1859 | "description": "filter the rows returned", 1860 | "type": { 1861 | "kind": "INPUT_OBJECT", 1862 | "name": "user_bool_exp", 1863 | "ofType": null, 1864 | "__typename": "__Type" 1865 | }, 1866 | "defaultValue": null, 1867 | "__typename": "__InputValue" 1868 | } 1869 | ], 1870 | "type": { 1871 | "kind": "NON_NULL", 1872 | "name": null, 1873 | "ofType": { 1874 | "kind": "LIST", 1875 | "name": null, 1876 | "ofType": { 1877 | "kind": "NON_NULL", 1878 | "name": null, 1879 | "ofType": { 1880 | "kind": "OBJECT", 1881 | "name": "user", 1882 | "ofType": null, 1883 | "__typename": "__Type" 1884 | }, 1885 | "__typename": "__Type" 1886 | }, 1887 | "__typename": "__Type" 1888 | }, 1889 | "__typename": "__Type" 1890 | }, 1891 | "isDeprecated": false, 1892 | "deprecationReason": null, 1893 | "__typename": "__Field" 1894 | }, 1895 | { 1896 | "name": "user_aggregate", 1897 | "description": "fetch aggregated fields from the table: \"user\"", 1898 | "args": [ 1899 | { 1900 | "name": "distinct_on", 1901 | "description": "distinct select on columns", 1902 | "type": { 1903 | "kind": "LIST", 1904 | "name": null, 1905 | "ofType": { 1906 | "kind": "NON_NULL", 1907 | "name": null, 1908 | "ofType": { 1909 | "kind": "ENUM", 1910 | "name": "user_select_column", 1911 | "ofType": null, 1912 | "__typename": "__Type" 1913 | }, 1914 | "__typename": "__Type" 1915 | }, 1916 | "__typename": "__Type" 1917 | }, 1918 | "defaultValue": null, 1919 | "__typename": "__InputValue" 1920 | }, 1921 | { 1922 | "name": "limit", 1923 | "description": "limit the number of rows returned", 1924 | "type": { 1925 | "kind": "SCALAR", 1926 | "name": "Int", 1927 | "ofType": null, 1928 | "__typename": "__Type" 1929 | }, 1930 | "defaultValue": null, 1931 | "__typename": "__InputValue" 1932 | }, 1933 | { 1934 | "name": "offset", 1935 | "description": "skip the first n rows. Use only with order_by", 1936 | "type": { 1937 | "kind": "SCALAR", 1938 | "name": "Int", 1939 | "ofType": null, 1940 | "__typename": "__Type" 1941 | }, 1942 | "defaultValue": null, 1943 | "__typename": "__InputValue" 1944 | }, 1945 | { 1946 | "name": "order_by", 1947 | "description": "sort the rows by one or more columns", 1948 | "type": { 1949 | "kind": "LIST", 1950 | "name": null, 1951 | "ofType": { 1952 | "kind": "NON_NULL", 1953 | "name": null, 1954 | "ofType": { 1955 | "kind": "INPUT_OBJECT", 1956 | "name": "user_order_by", 1957 | "ofType": null, 1958 | "__typename": "__Type" 1959 | }, 1960 | "__typename": "__Type" 1961 | }, 1962 | "__typename": "__Type" 1963 | }, 1964 | "defaultValue": null, 1965 | "__typename": "__InputValue" 1966 | }, 1967 | { 1968 | "name": "where", 1969 | "description": "filter the rows returned", 1970 | "type": { 1971 | "kind": "INPUT_OBJECT", 1972 | "name": "user_bool_exp", 1973 | "ofType": null, 1974 | "__typename": "__Type" 1975 | }, 1976 | "defaultValue": null, 1977 | "__typename": "__InputValue" 1978 | } 1979 | ], 1980 | "type": { 1981 | "kind": "NON_NULL", 1982 | "name": null, 1983 | "ofType": { 1984 | "kind": "OBJECT", 1985 | "name": "user_aggregate", 1986 | "ofType": null, 1987 | "__typename": "__Type" 1988 | }, 1989 | "__typename": "__Type" 1990 | }, 1991 | "isDeprecated": false, 1992 | "deprecationReason": null, 1993 | "__typename": "__Field" 1994 | }, 1995 | { 1996 | "name": "user_by_pk", 1997 | "description": "fetch data from the table: \"user\" using primary key columns", 1998 | "args": [ 1999 | { 2000 | "name": "id", 2001 | "description": null, 2002 | "type": { 2003 | "kind": "NON_NULL", 2004 | "name": null, 2005 | "ofType": { 2006 | "kind": "SCALAR", 2007 | "name": "uuid", 2008 | "ofType": null, 2009 | "__typename": "__Type" 2010 | }, 2011 | "__typename": "__Type" 2012 | }, 2013 | "defaultValue": null, 2014 | "__typename": "__InputValue" 2015 | } 2016 | ], 2017 | "type": { 2018 | "kind": "OBJECT", 2019 | "name": "user", 2020 | "ofType": null, 2021 | "__typename": "__Type" 2022 | }, 2023 | "isDeprecated": false, 2024 | "deprecationReason": null, 2025 | "__typename": "__Field" 2026 | } 2027 | ], 2028 | "inputFields": null, 2029 | "interfaces": [], 2030 | "enumValues": null, 2031 | "possibleTypes": null, 2032 | "__typename": "__Type" 2033 | }, 2034 | { 2035 | "kind": "OBJECT", 2036 | "name": "user", 2037 | "description": "columns and relationships of \"user\"", 2038 | "fields": [ 2039 | { 2040 | "name": "id", 2041 | "description": null, 2042 | "args": [], 2043 | "type": { 2044 | "kind": "NON_NULL", 2045 | "name": null, 2046 | "ofType": { 2047 | "kind": "SCALAR", 2048 | "name": "uuid", 2049 | "ofType": null, 2050 | "__typename": "__Type" 2051 | }, 2052 | "__typename": "__Type" 2053 | }, 2054 | "isDeprecated": false, 2055 | "deprecationReason": null, 2056 | "__typename": "__Field" 2057 | }, 2058 | { 2059 | "name": "username", 2060 | "description": null, 2061 | "args": [], 2062 | "type": { 2063 | "kind": "NON_NULL", 2064 | "name": null, 2065 | "ofType": { 2066 | "kind": "SCALAR", 2067 | "name": "String", 2068 | "ofType": null, 2069 | "__typename": "__Type" 2070 | }, 2071 | "__typename": "__Type" 2072 | }, 2073 | "isDeprecated": false, 2074 | "deprecationReason": null, 2075 | "__typename": "__Field" 2076 | } 2077 | ], 2078 | "inputFields": null, 2079 | "interfaces": [], 2080 | "enumValues": null, 2081 | "possibleTypes": null, 2082 | "__typename": "__Type" 2083 | }, 2084 | { 2085 | "kind": "OBJECT", 2086 | "name": "user_aggregate", 2087 | "description": "aggregated selection of \"user\"", 2088 | "fields": [ 2089 | { 2090 | "name": "aggregate", 2091 | "description": null, 2092 | "args": [], 2093 | "type": { 2094 | "kind": "OBJECT", 2095 | "name": "user_aggregate_fields", 2096 | "ofType": null, 2097 | "__typename": "__Type" 2098 | }, 2099 | "isDeprecated": false, 2100 | "deprecationReason": null, 2101 | "__typename": "__Field" 2102 | }, 2103 | { 2104 | "name": "nodes", 2105 | "description": null, 2106 | "args": [], 2107 | "type": { 2108 | "kind": "NON_NULL", 2109 | "name": null, 2110 | "ofType": { 2111 | "kind": "LIST", 2112 | "name": null, 2113 | "ofType": { 2114 | "kind": "NON_NULL", 2115 | "name": null, 2116 | "ofType": { 2117 | "kind": "OBJECT", 2118 | "name": "user", 2119 | "ofType": null, 2120 | "__typename": "__Type" 2121 | }, 2122 | "__typename": "__Type" 2123 | }, 2124 | "__typename": "__Type" 2125 | }, 2126 | "__typename": "__Type" 2127 | }, 2128 | "isDeprecated": false, 2129 | "deprecationReason": null, 2130 | "__typename": "__Field" 2131 | } 2132 | ], 2133 | "inputFields": null, 2134 | "interfaces": [], 2135 | "enumValues": null, 2136 | "possibleTypes": null, 2137 | "__typename": "__Type" 2138 | }, 2139 | { 2140 | "kind": "OBJECT", 2141 | "name": "user_aggregate_fields", 2142 | "description": "aggregate fields of \"user\"", 2143 | "fields": [ 2144 | { 2145 | "name": "count", 2146 | "description": null, 2147 | "args": [ 2148 | { 2149 | "name": "columns", 2150 | "description": null, 2151 | "type": { 2152 | "kind": "LIST", 2153 | "name": null, 2154 | "ofType": { 2155 | "kind": "NON_NULL", 2156 | "name": null, 2157 | "ofType": { 2158 | "kind": "ENUM", 2159 | "name": "user_select_column", 2160 | "ofType": null, 2161 | "__typename": "__Type" 2162 | }, 2163 | "__typename": "__Type" 2164 | }, 2165 | "__typename": "__Type" 2166 | }, 2167 | "defaultValue": null, 2168 | "__typename": "__InputValue" 2169 | }, 2170 | { 2171 | "name": "distinct", 2172 | "description": null, 2173 | "type": { 2174 | "kind": "SCALAR", 2175 | "name": "Boolean", 2176 | "ofType": null, 2177 | "__typename": "__Type" 2178 | }, 2179 | "defaultValue": null, 2180 | "__typename": "__InputValue" 2181 | } 2182 | ], 2183 | "type": { 2184 | "kind": "SCALAR", 2185 | "name": "Int", 2186 | "ofType": null, 2187 | "__typename": "__Type" 2188 | }, 2189 | "isDeprecated": false, 2190 | "deprecationReason": null, 2191 | "__typename": "__Field" 2192 | }, 2193 | { 2194 | "name": "max", 2195 | "description": null, 2196 | "args": [], 2197 | "type": { 2198 | "kind": "OBJECT", 2199 | "name": "user_max_fields", 2200 | "ofType": null, 2201 | "__typename": "__Type" 2202 | }, 2203 | "isDeprecated": false, 2204 | "deprecationReason": null, 2205 | "__typename": "__Field" 2206 | }, 2207 | { 2208 | "name": "min", 2209 | "description": null, 2210 | "args": [], 2211 | "type": { 2212 | "kind": "OBJECT", 2213 | "name": "user_min_fields", 2214 | "ofType": null, 2215 | "__typename": "__Type" 2216 | }, 2217 | "isDeprecated": false, 2218 | "deprecationReason": null, 2219 | "__typename": "__Field" 2220 | } 2221 | ], 2222 | "inputFields": null, 2223 | "interfaces": [], 2224 | "enumValues": null, 2225 | "possibleTypes": null, 2226 | "__typename": "__Type" 2227 | }, 2228 | { 2229 | "kind": "INPUT_OBJECT", 2230 | "name": "user_aggregate_order_by", 2231 | "description": "order by aggregate values of table \"user\"", 2232 | "fields": null, 2233 | "inputFields": [ 2234 | { 2235 | "name": "count", 2236 | "description": null, 2237 | "type": { 2238 | "kind": "ENUM", 2239 | "name": "order_by", 2240 | "ofType": null, 2241 | "__typename": "__Type" 2242 | }, 2243 | "defaultValue": null, 2244 | "__typename": "__InputValue" 2245 | }, 2246 | { 2247 | "name": "max", 2248 | "description": null, 2249 | "type": { 2250 | "kind": "INPUT_OBJECT", 2251 | "name": "user_max_order_by", 2252 | "ofType": null, 2253 | "__typename": "__Type" 2254 | }, 2255 | "defaultValue": null, 2256 | "__typename": "__InputValue" 2257 | }, 2258 | { 2259 | "name": "min", 2260 | "description": null, 2261 | "type": { 2262 | "kind": "INPUT_OBJECT", 2263 | "name": "user_min_order_by", 2264 | "ofType": null, 2265 | "__typename": "__Type" 2266 | }, 2267 | "defaultValue": null, 2268 | "__typename": "__InputValue" 2269 | } 2270 | ], 2271 | "interfaces": null, 2272 | "enumValues": null, 2273 | "possibleTypes": null, 2274 | "__typename": "__Type" 2275 | }, 2276 | { 2277 | "kind": "INPUT_OBJECT", 2278 | "name": "user_arr_rel_insert_input", 2279 | "description": "input type for inserting array relation for remote table \"user\"", 2280 | "fields": null, 2281 | "inputFields": [ 2282 | { 2283 | "name": "data", 2284 | "description": null, 2285 | "type": { 2286 | "kind": "NON_NULL", 2287 | "name": null, 2288 | "ofType": { 2289 | "kind": "LIST", 2290 | "name": null, 2291 | "ofType": { 2292 | "kind": "NON_NULL", 2293 | "name": null, 2294 | "ofType": { 2295 | "kind": "INPUT_OBJECT", 2296 | "name": "user_insert_input", 2297 | "ofType": null, 2298 | "__typename": "__Type" 2299 | }, 2300 | "__typename": "__Type" 2301 | }, 2302 | "__typename": "__Type" 2303 | }, 2304 | "__typename": "__Type" 2305 | }, 2306 | "defaultValue": null, 2307 | "__typename": "__InputValue" 2308 | }, 2309 | { 2310 | "name": "on_conflict", 2311 | "description": null, 2312 | "type": { 2313 | "kind": "INPUT_OBJECT", 2314 | "name": "user_on_conflict", 2315 | "ofType": null, 2316 | "__typename": "__Type" 2317 | }, 2318 | "defaultValue": null, 2319 | "__typename": "__InputValue" 2320 | } 2321 | ], 2322 | "interfaces": null, 2323 | "enumValues": null, 2324 | "possibleTypes": null, 2325 | "__typename": "__Type" 2326 | }, 2327 | { 2328 | "kind": "INPUT_OBJECT", 2329 | "name": "user_bool_exp", 2330 | "description": "Boolean expression to filter rows from the table \"user\". All fields are combined with a logical 'AND'.", 2331 | "fields": null, 2332 | "inputFields": [ 2333 | { 2334 | "name": "_and", 2335 | "description": null, 2336 | "type": { 2337 | "kind": "LIST", 2338 | "name": null, 2339 | "ofType": { 2340 | "kind": "INPUT_OBJECT", 2341 | "name": "user_bool_exp", 2342 | "ofType": null, 2343 | "__typename": "__Type" 2344 | }, 2345 | "__typename": "__Type" 2346 | }, 2347 | "defaultValue": null, 2348 | "__typename": "__InputValue" 2349 | }, 2350 | { 2351 | "name": "_not", 2352 | "description": null, 2353 | "type": { 2354 | "kind": "INPUT_OBJECT", 2355 | "name": "user_bool_exp", 2356 | "ofType": null, 2357 | "__typename": "__Type" 2358 | }, 2359 | "defaultValue": null, 2360 | "__typename": "__InputValue" 2361 | }, 2362 | { 2363 | "name": "_or", 2364 | "description": null, 2365 | "type": { 2366 | "kind": "LIST", 2367 | "name": null, 2368 | "ofType": { 2369 | "kind": "INPUT_OBJECT", 2370 | "name": "user_bool_exp", 2371 | "ofType": null, 2372 | "__typename": "__Type" 2373 | }, 2374 | "__typename": "__Type" 2375 | }, 2376 | "defaultValue": null, 2377 | "__typename": "__InputValue" 2378 | }, 2379 | { 2380 | "name": "id", 2381 | "description": null, 2382 | "type": { 2383 | "kind": "INPUT_OBJECT", 2384 | "name": "uuid_comparison_exp", 2385 | "ofType": null, 2386 | "__typename": "__Type" 2387 | }, 2388 | "defaultValue": null, 2389 | "__typename": "__InputValue" 2390 | }, 2391 | { 2392 | "name": "username", 2393 | "description": null, 2394 | "type": { 2395 | "kind": "INPUT_OBJECT", 2396 | "name": "String_comparison_exp", 2397 | "ofType": null, 2398 | "__typename": "__Type" 2399 | }, 2400 | "defaultValue": null, 2401 | "__typename": "__InputValue" 2402 | } 2403 | ], 2404 | "interfaces": null, 2405 | "enumValues": null, 2406 | "possibleTypes": null, 2407 | "__typename": "__Type" 2408 | }, 2409 | { 2410 | "kind": "ENUM", 2411 | "name": "user_constraint", 2412 | "description": "unique or primary key constraints on table \"user\"", 2413 | "fields": null, 2414 | "inputFields": null, 2415 | "interfaces": null, 2416 | "enumValues": [ 2417 | { 2418 | "name": "user_pkey", 2419 | "description": "unique or primary key constraint", 2420 | "isDeprecated": false, 2421 | "deprecationReason": null, 2422 | "__typename": "__EnumValue" 2423 | }, 2424 | { 2425 | "name": "user_username_key", 2426 | "description": "unique or primary key constraint", 2427 | "isDeprecated": false, 2428 | "deprecationReason": null, 2429 | "__typename": "__EnumValue" 2430 | } 2431 | ], 2432 | "possibleTypes": null, 2433 | "__typename": "__Type" 2434 | }, 2435 | { 2436 | "kind": "INPUT_OBJECT", 2437 | "name": "user_insert_input", 2438 | "description": "input type for inserting data into table \"user\"", 2439 | "fields": null, 2440 | "inputFields": [ 2441 | { 2442 | "name": "id", 2443 | "description": null, 2444 | "type": { 2445 | "kind": "SCALAR", 2446 | "name": "uuid", 2447 | "ofType": null, 2448 | "__typename": "__Type" 2449 | }, 2450 | "defaultValue": null, 2451 | "__typename": "__InputValue" 2452 | }, 2453 | { 2454 | "name": "username", 2455 | "description": null, 2456 | "type": { 2457 | "kind": "SCALAR", 2458 | "name": "String", 2459 | "ofType": null, 2460 | "__typename": "__Type" 2461 | }, 2462 | "defaultValue": null, 2463 | "__typename": "__InputValue" 2464 | } 2465 | ], 2466 | "interfaces": null, 2467 | "enumValues": null, 2468 | "possibleTypes": null, 2469 | "__typename": "__Type" 2470 | }, 2471 | { 2472 | "kind": "OBJECT", 2473 | "name": "user_max_fields", 2474 | "description": "aggregate max on columns", 2475 | "fields": [ 2476 | { 2477 | "name": "id", 2478 | "description": null, 2479 | "args": [], 2480 | "type": { 2481 | "kind": "SCALAR", 2482 | "name": "uuid", 2483 | "ofType": null, 2484 | "__typename": "__Type" 2485 | }, 2486 | "isDeprecated": false, 2487 | "deprecationReason": null, 2488 | "__typename": "__Field" 2489 | }, 2490 | { 2491 | "name": "username", 2492 | "description": null, 2493 | "args": [], 2494 | "type": { 2495 | "kind": "SCALAR", 2496 | "name": "String", 2497 | "ofType": null, 2498 | "__typename": "__Type" 2499 | }, 2500 | "isDeprecated": false, 2501 | "deprecationReason": null, 2502 | "__typename": "__Field" 2503 | } 2504 | ], 2505 | "inputFields": null, 2506 | "interfaces": [], 2507 | "enumValues": null, 2508 | "possibleTypes": null, 2509 | "__typename": "__Type" 2510 | }, 2511 | { 2512 | "kind": "INPUT_OBJECT", 2513 | "name": "user_max_order_by", 2514 | "description": "order by max() on columns of table \"user\"", 2515 | "fields": null, 2516 | "inputFields": [ 2517 | { 2518 | "name": "id", 2519 | "description": null, 2520 | "type": { 2521 | "kind": "ENUM", 2522 | "name": "order_by", 2523 | "ofType": null, 2524 | "__typename": "__Type" 2525 | }, 2526 | "defaultValue": null, 2527 | "__typename": "__InputValue" 2528 | }, 2529 | { 2530 | "name": "username", 2531 | "description": null, 2532 | "type": { 2533 | "kind": "ENUM", 2534 | "name": "order_by", 2535 | "ofType": null, 2536 | "__typename": "__Type" 2537 | }, 2538 | "defaultValue": null, 2539 | "__typename": "__InputValue" 2540 | } 2541 | ], 2542 | "interfaces": null, 2543 | "enumValues": null, 2544 | "possibleTypes": null, 2545 | "__typename": "__Type" 2546 | }, 2547 | { 2548 | "kind": "OBJECT", 2549 | "name": "user_min_fields", 2550 | "description": "aggregate min on columns", 2551 | "fields": [ 2552 | { 2553 | "name": "id", 2554 | "description": null, 2555 | "args": [], 2556 | "type": { 2557 | "kind": "SCALAR", 2558 | "name": "uuid", 2559 | "ofType": null, 2560 | "__typename": "__Type" 2561 | }, 2562 | "isDeprecated": false, 2563 | "deprecationReason": null, 2564 | "__typename": "__Field" 2565 | }, 2566 | { 2567 | "name": "username", 2568 | "description": null, 2569 | "args": [], 2570 | "type": { 2571 | "kind": "SCALAR", 2572 | "name": "String", 2573 | "ofType": null, 2574 | "__typename": "__Type" 2575 | }, 2576 | "isDeprecated": false, 2577 | "deprecationReason": null, 2578 | "__typename": "__Field" 2579 | } 2580 | ], 2581 | "inputFields": null, 2582 | "interfaces": [], 2583 | "enumValues": null, 2584 | "possibleTypes": null, 2585 | "__typename": "__Type" 2586 | }, 2587 | { 2588 | "kind": "INPUT_OBJECT", 2589 | "name": "user_min_order_by", 2590 | "description": "order by min() on columns of table \"user\"", 2591 | "fields": null, 2592 | "inputFields": [ 2593 | { 2594 | "name": "id", 2595 | "description": null, 2596 | "type": { 2597 | "kind": "ENUM", 2598 | "name": "order_by", 2599 | "ofType": null, 2600 | "__typename": "__Type" 2601 | }, 2602 | "defaultValue": null, 2603 | "__typename": "__InputValue" 2604 | }, 2605 | { 2606 | "name": "username", 2607 | "description": null, 2608 | "type": { 2609 | "kind": "ENUM", 2610 | "name": "order_by", 2611 | "ofType": null, 2612 | "__typename": "__Type" 2613 | }, 2614 | "defaultValue": null, 2615 | "__typename": "__InputValue" 2616 | } 2617 | ], 2618 | "interfaces": null, 2619 | "enumValues": null, 2620 | "possibleTypes": null, 2621 | "__typename": "__Type" 2622 | }, 2623 | { 2624 | "kind": "OBJECT", 2625 | "name": "user_mutation_response", 2626 | "description": "response of any mutation on the table \"user\"", 2627 | "fields": [ 2628 | { 2629 | "name": "affected_rows", 2630 | "description": "number of affected rows by the mutation", 2631 | "args": [], 2632 | "type": { 2633 | "kind": "NON_NULL", 2634 | "name": null, 2635 | "ofType": { 2636 | "kind": "SCALAR", 2637 | "name": "Int", 2638 | "ofType": null, 2639 | "__typename": "__Type" 2640 | }, 2641 | "__typename": "__Type" 2642 | }, 2643 | "isDeprecated": false, 2644 | "deprecationReason": null, 2645 | "__typename": "__Field" 2646 | }, 2647 | { 2648 | "name": "returning", 2649 | "description": "data of the affected rows by the mutation", 2650 | "args": [], 2651 | "type": { 2652 | "kind": "NON_NULL", 2653 | "name": null, 2654 | "ofType": { 2655 | "kind": "LIST", 2656 | "name": null, 2657 | "ofType": { 2658 | "kind": "NON_NULL", 2659 | "name": null, 2660 | "ofType": { 2661 | "kind": "OBJECT", 2662 | "name": "user", 2663 | "ofType": null, 2664 | "__typename": "__Type" 2665 | }, 2666 | "__typename": "__Type" 2667 | }, 2668 | "__typename": "__Type" 2669 | }, 2670 | "__typename": "__Type" 2671 | }, 2672 | "isDeprecated": false, 2673 | "deprecationReason": null, 2674 | "__typename": "__Field" 2675 | } 2676 | ], 2677 | "inputFields": null, 2678 | "interfaces": [], 2679 | "enumValues": null, 2680 | "possibleTypes": null, 2681 | "__typename": "__Type" 2682 | }, 2683 | { 2684 | "kind": "INPUT_OBJECT", 2685 | "name": "user_obj_rel_insert_input", 2686 | "description": "input type for inserting object relation for remote table \"user\"", 2687 | "fields": null, 2688 | "inputFields": [ 2689 | { 2690 | "name": "data", 2691 | "description": null, 2692 | "type": { 2693 | "kind": "NON_NULL", 2694 | "name": null, 2695 | "ofType": { 2696 | "kind": "INPUT_OBJECT", 2697 | "name": "user_insert_input", 2698 | "ofType": null, 2699 | "__typename": "__Type" 2700 | }, 2701 | "__typename": "__Type" 2702 | }, 2703 | "defaultValue": null, 2704 | "__typename": "__InputValue" 2705 | }, 2706 | { 2707 | "name": "on_conflict", 2708 | "description": null, 2709 | "type": { 2710 | "kind": "INPUT_OBJECT", 2711 | "name": "user_on_conflict", 2712 | "ofType": null, 2713 | "__typename": "__Type" 2714 | }, 2715 | "defaultValue": null, 2716 | "__typename": "__InputValue" 2717 | } 2718 | ], 2719 | "interfaces": null, 2720 | "enumValues": null, 2721 | "possibleTypes": null, 2722 | "__typename": "__Type" 2723 | }, 2724 | { 2725 | "kind": "INPUT_OBJECT", 2726 | "name": "user_on_conflict", 2727 | "description": "on conflict condition type for table \"user\"", 2728 | "fields": null, 2729 | "inputFields": [ 2730 | { 2731 | "name": "constraint", 2732 | "description": null, 2733 | "type": { 2734 | "kind": "NON_NULL", 2735 | "name": null, 2736 | "ofType": { 2737 | "kind": "ENUM", 2738 | "name": "user_constraint", 2739 | "ofType": null, 2740 | "__typename": "__Type" 2741 | }, 2742 | "__typename": "__Type" 2743 | }, 2744 | "defaultValue": null, 2745 | "__typename": "__InputValue" 2746 | }, 2747 | { 2748 | "name": "update_columns", 2749 | "description": null, 2750 | "type": { 2751 | "kind": "NON_NULL", 2752 | "name": null, 2753 | "ofType": { 2754 | "kind": "LIST", 2755 | "name": null, 2756 | "ofType": { 2757 | "kind": "NON_NULL", 2758 | "name": null, 2759 | "ofType": { 2760 | "kind": "ENUM", 2761 | "name": "user_update_column", 2762 | "ofType": null, 2763 | "__typename": "__Type" 2764 | }, 2765 | "__typename": "__Type" 2766 | }, 2767 | "__typename": "__Type" 2768 | }, 2769 | "__typename": "__Type" 2770 | }, 2771 | "defaultValue": null, 2772 | "__typename": "__InputValue" 2773 | }, 2774 | { 2775 | "name": "where", 2776 | "description": null, 2777 | "type": { 2778 | "kind": "INPUT_OBJECT", 2779 | "name": "user_bool_exp", 2780 | "ofType": null, 2781 | "__typename": "__Type" 2782 | }, 2783 | "defaultValue": null, 2784 | "__typename": "__InputValue" 2785 | } 2786 | ], 2787 | "interfaces": null, 2788 | "enumValues": null, 2789 | "possibleTypes": null, 2790 | "__typename": "__Type" 2791 | }, 2792 | { 2793 | "kind": "INPUT_OBJECT", 2794 | "name": "user_order_by", 2795 | "description": "ordering options when selecting data from \"user\"", 2796 | "fields": null, 2797 | "inputFields": [ 2798 | { 2799 | "name": "id", 2800 | "description": null, 2801 | "type": { 2802 | "kind": "ENUM", 2803 | "name": "order_by", 2804 | "ofType": null, 2805 | "__typename": "__Type" 2806 | }, 2807 | "defaultValue": null, 2808 | "__typename": "__InputValue" 2809 | }, 2810 | { 2811 | "name": "username", 2812 | "description": null, 2813 | "type": { 2814 | "kind": "ENUM", 2815 | "name": "order_by", 2816 | "ofType": null, 2817 | "__typename": "__Type" 2818 | }, 2819 | "defaultValue": null, 2820 | "__typename": "__InputValue" 2821 | } 2822 | ], 2823 | "interfaces": null, 2824 | "enumValues": null, 2825 | "possibleTypes": null, 2826 | "__typename": "__Type" 2827 | }, 2828 | { 2829 | "kind": "INPUT_OBJECT", 2830 | "name": "user_pk_columns_input", 2831 | "description": "primary key columns input for table: \"user\"", 2832 | "fields": null, 2833 | "inputFields": [ 2834 | { 2835 | "name": "id", 2836 | "description": null, 2837 | "type": { 2838 | "kind": "NON_NULL", 2839 | "name": null, 2840 | "ofType": { 2841 | "kind": "SCALAR", 2842 | "name": "uuid", 2843 | "ofType": null, 2844 | "__typename": "__Type" 2845 | }, 2846 | "__typename": "__Type" 2847 | }, 2848 | "defaultValue": null, 2849 | "__typename": "__InputValue" 2850 | } 2851 | ], 2852 | "interfaces": null, 2853 | "enumValues": null, 2854 | "possibleTypes": null, 2855 | "__typename": "__Type" 2856 | }, 2857 | { 2858 | "kind": "ENUM", 2859 | "name": "user_select_column", 2860 | "description": "select columns of table \"user\"", 2861 | "fields": null, 2862 | "inputFields": null, 2863 | "interfaces": null, 2864 | "enumValues": [ 2865 | { 2866 | "name": "id", 2867 | "description": "column name", 2868 | "isDeprecated": false, 2869 | "deprecationReason": null, 2870 | "__typename": "__EnumValue" 2871 | }, 2872 | { 2873 | "name": "username", 2874 | "description": "column name", 2875 | "isDeprecated": false, 2876 | "deprecationReason": null, 2877 | "__typename": "__EnumValue" 2878 | } 2879 | ], 2880 | "possibleTypes": null, 2881 | "__typename": "__Type" 2882 | }, 2883 | { 2884 | "kind": "INPUT_OBJECT", 2885 | "name": "user_set_input", 2886 | "description": "input type for updating data in table \"user\"", 2887 | "fields": null, 2888 | "inputFields": [ 2889 | { 2890 | "name": "id", 2891 | "description": null, 2892 | "type": { 2893 | "kind": "SCALAR", 2894 | "name": "uuid", 2895 | "ofType": null, 2896 | "__typename": "__Type" 2897 | }, 2898 | "defaultValue": null, 2899 | "__typename": "__InputValue" 2900 | }, 2901 | { 2902 | "name": "username", 2903 | "description": null, 2904 | "type": { 2905 | "kind": "SCALAR", 2906 | "name": "String", 2907 | "ofType": null, 2908 | "__typename": "__Type" 2909 | }, 2910 | "defaultValue": null, 2911 | "__typename": "__InputValue" 2912 | } 2913 | ], 2914 | "interfaces": null, 2915 | "enumValues": null, 2916 | "possibleTypes": null, 2917 | "__typename": "__Type" 2918 | }, 2919 | { 2920 | "kind": "ENUM", 2921 | "name": "user_update_column", 2922 | "description": "update columns of table \"user\"", 2923 | "fields": null, 2924 | "inputFields": null, 2925 | "interfaces": null, 2926 | "enumValues": [ 2927 | { 2928 | "name": "id", 2929 | "description": "column name", 2930 | "isDeprecated": false, 2931 | "deprecationReason": null, 2932 | "__typename": "__EnumValue" 2933 | }, 2934 | { 2935 | "name": "username", 2936 | "description": "column name", 2937 | "isDeprecated": false, 2938 | "deprecationReason": null, 2939 | "__typename": "__EnumValue" 2940 | } 2941 | ], 2942 | "possibleTypes": null, 2943 | "__typename": "__Type" 2944 | }, 2945 | { 2946 | "kind": "SCALAR", 2947 | "name": "uuid", 2948 | "description": null, 2949 | "fields": null, 2950 | "inputFields": null, 2951 | "interfaces": null, 2952 | "enumValues": null, 2953 | "possibleTypes": null, 2954 | "__typename": "__Type" 2955 | }, 2956 | { 2957 | "kind": "INPUT_OBJECT", 2958 | "name": "uuid_comparison_exp", 2959 | "description": "expression to compare columns of type uuid. All fields are combined with logical 'AND'.", 2960 | "fields": null, 2961 | "inputFields": [ 2962 | { 2963 | "name": "_eq", 2964 | "description": null, 2965 | "type": { 2966 | "kind": "SCALAR", 2967 | "name": "uuid", 2968 | "ofType": null, 2969 | "__typename": "__Type" 2970 | }, 2971 | "defaultValue": null, 2972 | "__typename": "__InputValue" 2973 | }, 2974 | { 2975 | "name": "_gt", 2976 | "description": null, 2977 | "type": { 2978 | "kind": "SCALAR", 2979 | "name": "uuid", 2980 | "ofType": null, 2981 | "__typename": "__Type" 2982 | }, 2983 | "defaultValue": null, 2984 | "__typename": "__InputValue" 2985 | }, 2986 | { 2987 | "name": "_gte", 2988 | "description": null, 2989 | "type": { 2990 | "kind": "SCALAR", 2991 | "name": "uuid", 2992 | "ofType": null, 2993 | "__typename": "__Type" 2994 | }, 2995 | "defaultValue": null, 2996 | "__typename": "__InputValue" 2997 | }, 2998 | { 2999 | "name": "_in", 3000 | "description": null, 3001 | "type": { 3002 | "kind": "LIST", 3003 | "name": null, 3004 | "ofType": { 3005 | "kind": "NON_NULL", 3006 | "name": null, 3007 | "ofType": { 3008 | "kind": "SCALAR", 3009 | "name": "uuid", 3010 | "ofType": null, 3011 | "__typename": "__Type" 3012 | }, 3013 | "__typename": "__Type" 3014 | }, 3015 | "__typename": "__Type" 3016 | }, 3017 | "defaultValue": null, 3018 | "__typename": "__InputValue" 3019 | }, 3020 | { 3021 | "name": "_is_null", 3022 | "description": null, 3023 | "type": { 3024 | "kind": "SCALAR", 3025 | "name": "Boolean", 3026 | "ofType": null, 3027 | "__typename": "__Type" 3028 | }, 3029 | "defaultValue": null, 3030 | "__typename": "__InputValue" 3031 | }, 3032 | { 3033 | "name": "_lt", 3034 | "description": null, 3035 | "type": { 3036 | "kind": "SCALAR", 3037 | "name": "uuid", 3038 | "ofType": null, 3039 | "__typename": "__Type" 3040 | }, 3041 | "defaultValue": null, 3042 | "__typename": "__InputValue" 3043 | }, 3044 | { 3045 | "name": "_lte", 3046 | "description": null, 3047 | "type": { 3048 | "kind": "SCALAR", 3049 | "name": "uuid", 3050 | "ofType": null, 3051 | "__typename": "__Type" 3052 | }, 3053 | "defaultValue": null, 3054 | "__typename": "__InputValue" 3055 | }, 3056 | { 3057 | "name": "_neq", 3058 | "description": null, 3059 | "type": { 3060 | "kind": "SCALAR", 3061 | "name": "uuid", 3062 | "ofType": null, 3063 | "__typename": "__Type" 3064 | }, 3065 | "defaultValue": null, 3066 | "__typename": "__InputValue" 3067 | }, 3068 | { 3069 | "name": "_nin", 3070 | "description": null, 3071 | "type": { 3072 | "kind": "LIST", 3073 | "name": null, 3074 | "ofType": { 3075 | "kind": "NON_NULL", 3076 | "name": null, 3077 | "ofType": { 3078 | "kind": "SCALAR", 3079 | "name": "uuid", 3080 | "ofType": null, 3081 | "__typename": "__Type" 3082 | }, 3083 | "__typename": "__Type" 3084 | }, 3085 | "__typename": "__Type" 3086 | }, 3087 | "defaultValue": null, 3088 | "__typename": "__InputValue" 3089 | } 3090 | ], 3091 | "interfaces": null, 3092 | "enumValues": null, 3093 | "possibleTypes": null, 3094 | "__typename": "__Type" 3095 | } 3096 | ], 3097 | "directives": [ 3098 | { 3099 | "name": "include", 3100 | "description": null, 3101 | "locations": [ 3102 | "FIELD", 3103 | "FRAGMENT_SPREAD", 3104 | "INLINE_FRAGMENT" 3105 | ], 3106 | "args": [ 3107 | { 3108 | "name": "if", 3109 | "description": null, 3110 | "type": { 3111 | "kind": "NON_NULL", 3112 | "name": null, 3113 | "ofType": { 3114 | "kind": "SCALAR", 3115 | "name": "Boolean", 3116 | "ofType": null, 3117 | "__typename": "__Type" 3118 | }, 3119 | "__typename": "__Type" 3120 | }, 3121 | "defaultValue": null, 3122 | "__typename": "__InputValue" 3123 | } 3124 | ], 3125 | "__typename": "__Directive" 3126 | }, 3127 | { 3128 | "name": "skip", 3129 | "description": null, 3130 | "locations": [ 3131 | "FIELD", 3132 | "FRAGMENT_SPREAD", 3133 | "INLINE_FRAGMENT" 3134 | ], 3135 | "args": [ 3136 | { 3137 | "name": "if", 3138 | "description": null, 3139 | "type": { 3140 | "kind": "NON_NULL", 3141 | "name": null, 3142 | "ofType": { 3143 | "kind": "SCALAR", 3144 | "name": "Boolean", 3145 | "ofType": null, 3146 | "__typename": "__Type" 3147 | }, 3148 | "__typename": "__Type" 3149 | }, 3150 | "defaultValue": null, 3151 | "__typename": "__InputValue" 3152 | } 3153 | ], 3154 | "__typename": "__Directive" 3155 | } 3156 | ], 3157 | "__typename": "__Schema" 3158 | } 3159 | } 3160 | -------------------------------------------------------------------------------- /graphql/user-by-username.graphql: -------------------------------------------------------------------------------- 1 | query UserByUsername($username: String!) { 2 | user(where: { username: { _eq: $username } }) { 3 | id 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /graphql/user-create.graphql: -------------------------------------------------------------------------------- 1 | mutation UserCreate($username: String!) { 2 | insert_user_one(object: { username: $username }) { 3 | id 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /src/graphql.rs: -------------------------------------------------------------------------------- 1 | //// graphql_client codegen //// 2 | 3 | use graphql_client::GraphQLQuery; 4 | use juniper::RootNode; 5 | 6 | // Required for graphql_client to match 7 | // Hasura uuid type in schema.json. 8 | #[allow(non_camel_case_types)] 9 | pub type uuid = uuid_::Uuid; 10 | 11 | pub struct Query; 12 | 13 | pub struct Mutation; 14 | 15 | pub type Schema = 16 | RootNode<'static, Query, Mutation, juniper::EmptySubscription>; 17 | 18 | #[derive(GraphQLQuery)] 19 | #[graphql( 20 | schema_path = "graphql/schema.json", 21 | query_path = "graphql/user-by-username.graphql" 22 | )] 23 | pub struct UserByUsername; 24 | 25 | #[derive(GraphQLQuery)] 26 | #[graphql( 27 | schema_path = "graphql/schema.json", 28 | query_path = "graphql/user-create.graphql" 29 | )] 30 | pub struct UserCreate; 31 | -------------------------------------------------------------------------------- /src/helpers.rs: -------------------------------------------------------------------------------- 1 | use cookie::Cookie; 2 | use juniper::{graphql_value, FieldError}; 3 | use std::time::{SystemTime, UNIX_EPOCH}; 4 | 5 | pub const COOKIE_NAME: &str = "cookie"; 6 | 7 | const HASURA_JWT_LIFE: u64 = 7000; 8 | 9 | pub async fn hasura_request( 10 | context: &crate::types::Context, 11 | body: T, 12 | ) -> Result { 13 | let res = context 14 | .config 15 | .client 16 | .post(&context.config.hasura_endpoint) 17 | .header( 18 | "x-hasura-admin-secret", 19 | context.config.hasura_admin_secret.as_bytes(), 20 | ) 21 | .json(&body) 22 | .send() 23 | .await; 24 | 25 | match res { 26 | Err(_) => Err(field_error("Request failure")), 27 | Ok(data) => { 28 | let decode: Result, reqwest::Error> = data.json().await; 29 | 30 | decode 31 | .map_err(|_| field_error("JSON decode failure")) 32 | .and_then(|gql| { 33 | gql.data 34 | .ok_or_else(|| field_error("Empty data was returned")) 35 | }) 36 | } 37 | } 38 | } 39 | 40 | pub fn authenticate( 41 | context: &crate::types::Context, 42 | user_id: &crate::graphql::uuid, 43 | ) -> Result { 44 | let claims = crate::types::HasuraJwt { 45 | exp: seconds_from_now(HASURA_JWT_LIFE), 46 | sub: *user_id, 47 | hasura: crate::types::HasuraClaims { 48 | role: "user".to_string(), 49 | allowed_roles: vec!["user".to_string()], 50 | user_id: *user_id, 51 | }, 52 | }; 53 | 54 | jsonwebtoken::encode( 55 | &context.config.jwt_header, 56 | &claims, 57 | &context.config.jwt_enc_key, 58 | ) 59 | .map_err(|_| field_error("JWT problem")) 60 | .map(|token| crate::types::Auth { 61 | id: *user_id, 62 | token, 63 | }) 64 | } 65 | 66 | pub fn field_error(msg: &str) -> juniper::FieldError { 67 | FieldError::new(msg, graphql_value!({ "code": 123 })) 68 | } 69 | 70 | pub fn new_cookie(id: &crate::graphql::uuid) -> String { 71 | Cookie::build(COOKIE_NAME, id.to_string()) 72 | .secure(true) 73 | .http_only(true) 74 | .max_age(time::Duration::days(7)) 75 | .finish() 76 | .to_string() 77 | } 78 | 79 | pub fn remove_cookie() -> String { 80 | Cookie::build(COOKIE_NAME, "foo") 81 | .max_age(time::Duration::seconds(0)) 82 | .expires(time::OffsetDateTime::UNIX_EPOCH) 83 | .finish() 84 | .to_string() 85 | } 86 | 87 | pub fn seconds_from_now(n: u64) -> u64 { 88 | let start = SystemTime::now(); 89 | let since_the_epoch = start 90 | .duration_since(UNIX_EPOCH) 91 | .expect("time error") 92 | .as_secs(); 93 | 94 | since_the_epoch + n 95 | } 96 | 97 | pub fn parse_cookie(cookie: &str) -> Option { 98 | let cookie = Cookie::parse(cookie).ok()?; 99 | serde_json::from_str(&cookie.value()).ok() 100 | } 101 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | use async_std::sync::Mutex; 2 | use graphql_client::GraphQLQuery; 3 | use juniper::http::GraphQLRequest; 4 | use juniper::FieldResult; 5 | use std::sync::Arc; 6 | use warp::Filter; 7 | use warp::Reply; 8 | mod graphql; 9 | mod helpers; 10 | mod types; 11 | 12 | #[tokio::main] 13 | async fn main() -> Result<(), Box> { 14 | let env = envy::from_env::().expect("Missing environment variables!"); 15 | 16 | let jwt: types::JwtSecret = 17 | serde_json::from_str(&env.jwt_secret).expect("JWT_SECRET is invalid!"); 18 | 19 | let jwt_header = jsonwebtoken::Header::new(jwt.type_); 20 | 21 | let client = reqwest::Client::new(); 22 | 23 | let config = types::Config { 24 | hasura_endpoint: env.hasura_endpoint, 25 | hasura_admin_secret: env.admin_secret, 26 | jwt_enc_key: jsonwebtoken::EncodingKey::from_secret(&jwt.key.as_bytes()), 27 | jwt_dec_key: jsonwebtoken::DecodingKey::from_secret(&jwt.key.as_bytes()).into_static(), 28 | jwt_header, 29 | client: client.clone(), 30 | }; 31 | 32 | let schema = graphql::Schema::new( 33 | graphql::Query {}, 34 | graphql::Mutation {}, 35 | juniper::EmptySubscription::new(), 36 | ); 37 | let schema_arc = std::sync::Arc::new(schema); 38 | 39 | let ping_route = warp::get().and(warp::path("ping")).map(ping); 40 | 41 | let gql = warp::post() 42 | .and(warp::path("graphql")) 43 | .and(with_val(config)) 44 | .and(with_val(schema_arc)) 45 | .and(warp::filters::cookie::optional(helpers::COOKIE_NAME)) 46 | .and(warp::body::json()) 47 | .and_then(graphql_handler); 48 | 49 | let routes = ping_route.or(gql); 50 | 51 | warp::serve(routes).run(([0, 0, 0, 0], env.port)).await; 52 | 53 | Ok(()) 54 | } 55 | 56 | fn with_val( 57 | val: T, 58 | ) -> impl Filter + Clone { 59 | warp::any().map(move || val.clone()) 60 | } 61 | 62 | fn ping() -> impl warp::Reply { 63 | let response = serde_json::json!({ "message": "OK" }); 64 | warp::reply::json(&response) 65 | } 66 | 67 | async fn graphql_handler( 68 | config: types::Config, 69 | schema: Arc, 70 | cookie: Option, 71 | gql_req: GraphQLRequest, 72 | ) -> Result { 73 | let user_id = cookie.clone().and_then(|val| helpers::parse_cookie(&val)); 74 | 75 | let context = types::Context { 76 | cookie_user_id: user_id, 77 | cookie_out: Arc::new(Mutex::new(types::CookieChange::NoChange)), 78 | config, 79 | }; 80 | 81 | let res = gql_req.execute(&schema, &context).await; 82 | 83 | let response = match serde_json::to_string(&res) { 84 | Err(e) => warp::reply::json(&e.to_string()).into_response(), 85 | Ok(out) => { 86 | let arc = context.cookie_out.clone(); 87 | 88 | let cookie_change = arc.lock().await; 89 | 90 | let default_response = warp::reply::json(&out); 91 | 92 | match &*cookie_change { 93 | types::CookieChange::NoChange => default_response.into_response(), 94 | types::CookieChange::Add(id) => warp::reply::with_header( 95 | default_response, 96 | warp::http::header::SET_COOKIE, 97 | helpers::new_cookie(&id), 98 | ) 99 | .into_response(), 100 | types::CookieChange::Remove => warp::reply::with_header( 101 | default_response, 102 | warp::http::header::SET_COOKIE, 103 | helpers::remove_cookie(), 104 | ) 105 | .into_response(), 106 | } 107 | } 108 | }; 109 | 110 | Ok(response) 111 | } 112 | 113 | //// Juniper GraphQL Resolvers //// 114 | 115 | #[juniper::graphql_object(Context = types::Context)] 116 | impl graphql::Query { 117 | async fn login(context: &types::Context, username: String) -> FieldResult { 118 | let variables = graphql::user_by_username::Variables { username }; 119 | let request_body = graphql::UserByUsername::build_query(variables); 120 | 121 | let res: graphql::user_by_username::ResponseData = 122 | helpers::hasura_request(&context, &request_body).await?; 123 | 124 | match res.user.get(0) { 125 | None => Err(helpers::field_error("Username not found")), 126 | Some(user) => { 127 | let arc = context.cookie_out.clone(); 128 | *arc.lock().await = types::CookieChange::Add(user.id); 129 | helpers::authenticate(&context, &user.id) 130 | } 131 | } 132 | } 133 | async fn refresh(context: &types::Context) -> FieldResult> { 134 | match context.cookie_user_id { 135 | Some(id) => helpers::authenticate(&context, &id).map(Some), 136 | None => Ok(None), 137 | } 138 | } 139 | } 140 | 141 | #[juniper::graphql_object(Context = types::Context)] 142 | impl graphql::Mutation { 143 | async fn signup(context: &types::Context, username: String) -> FieldResult { 144 | let variables = graphql::user_create::Variables { username }; 145 | let request_body = graphql::UserCreate::build_query(variables); 146 | 147 | let res: graphql::user_create::ResponseData = 148 | helpers::hasura_request(&context, &request_body).await?; 149 | 150 | match res.insert_user_one { 151 | None => Err(helpers::field_error("Failed to create user")), 152 | Some(user) => { 153 | let arc = context.cookie_out.clone(); 154 | *arc.lock().await = types::CookieChange::Add(user.id); 155 | helpers::authenticate(&context, &user.id) 156 | } 157 | } 158 | } 159 | async fn logout(context: &types::Context) -> FieldResult { 160 | let arc = context.cookie_out.clone(); 161 | *arc.lock().await = types::CookieChange::Remove; 162 | Ok(true) 163 | } 164 | } 165 | -------------------------------------------------------------------------------- /src/types.rs: -------------------------------------------------------------------------------- 1 | use async_std::sync::Mutex; 2 | use std::sync::Arc; 3 | 4 | #[derive(serde::Deserialize)] 5 | pub struct Env { 6 | pub port: u16, 7 | pub hasura_endpoint: String, 8 | pub admin_secret: String, 9 | pub jwt_secret: String, 10 | } 11 | 12 | #[derive(Clone)] 13 | pub struct Config { 14 | pub hasura_endpoint: String, 15 | pub hasura_admin_secret: String, 16 | pub jwt_enc_key: jsonwebtoken::EncodingKey, 17 | pub jwt_dec_key: jsonwebtoken::DecodingKey<'static>, 18 | pub jwt_header: jsonwebtoken::Header, 19 | pub client: reqwest::Client, 20 | } 21 | 22 | #[derive(Clone)] 23 | pub struct Context { 24 | pub cookie_user_id: Option, 25 | pub cookie_out: Arc>, 26 | pub config: Config, 27 | } 28 | 29 | pub enum CookieChange { 30 | NoChange, 31 | Add(crate::graphql::uuid), 32 | Remove, 33 | } 34 | 35 | #[derive(serde::Deserialize, serde::Serialize)] 36 | pub struct CookieJwt { 37 | pub sub: crate::graphql::uuid, 38 | pub exp: u64, 39 | } 40 | 41 | #[derive(serde::Deserialize, serde::Serialize)] 42 | pub struct HasuraJwt { 43 | pub exp: u64, 44 | pub sub: crate::graphql::uuid, 45 | #[serde(rename = "https://hasura.io/jwt/claims")] 46 | pub hasura: HasuraClaims, 47 | } 48 | 49 | #[derive(juniper::GraphQLObject)] 50 | pub struct Auth { 51 | pub token: String, 52 | pub id: crate::graphql::uuid, 53 | } 54 | 55 | #[derive(serde::Deserialize, serde::Serialize)] 56 | pub struct HasuraClaims { 57 | #[serde(rename = "x-hasura-default-role")] 58 | pub role: String, 59 | #[serde(rename = "x-hasura-allowed-roles")] 60 | pub allowed_roles: Vec, 61 | #[serde(rename = "x-hasura-user-id")] 62 | pub user_id: crate::graphql::uuid, 63 | } 64 | 65 | #[derive(serde::Deserialize)] 66 | pub struct JwtSecret { 67 | #[serde(rename = "type")] 68 | pub type_: jsonwebtoken::Algorithm, 69 | pub key: String, 70 | } 71 | --------------------------------------------------------------------------------