github.com/jingcheng-WU/gonum@v0.9.1-0.20210323123734-f1a2a11a8f7b/graph/encoding/graphql/graphs_test.go (about) 1 // Copyright ©2017 The Gonum Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package graphql 6 7 const ( 8 starwars = `{ 9 "movie": [ 10 { 11 "_uid_": "0xa3cff1a4c3ef3bb6", 12 "director": [ 13 { 14 "_uid_": "0x4a7d0b5fe91e78a4", 15 "name": "Irvin Kernshner" 16 } 17 ], 18 "name": "Star Wars: Episode V - The Empire Strikes Back", 19 "release_date": "1980-05-21T00:00:00Z", 20 "revenue": 534000000, 21 "running_time": 124, 22 "starring": [ 23 { 24 "_uid_": "0x312de17a7ee89f9", 25 "name": "Luke Skywalker" 26 }, 27 { 28 "_uid_": "0x3da8d1dcab1bb381", 29 "name": "Han Solo" 30 }, 31 { 32 "_uid_": "0x718337b9dcbaa7d9", 33 "name": "Princess Leia" 34 } 35 ] 36 }, 37 { 38 "_uid_": "0xb39aa14d66aedad5", 39 "director": [ 40 { 41 "_uid_": "0x8a10d5a2611fd03f", 42 "name": "Richard Marquand" 43 } 44 ], 45 "name": "Star Wars: Episode VI - Return of the Jedi", 46 "release_date": "1983-05-25T00:00:00Z", 47 "revenue": 572000000, 48 "running_time": 131, 49 "starring": [ 50 { 51 "_uid_": "0x312de17a7ee89f9", 52 "name": "Luke Skywalker" 53 }, 54 { 55 "_uid_": "0x3da8d1dcab1bb381", 56 "name": "Han Solo" 57 }, 58 { 59 "_uid_": "0x718337b9dcbaa7d9", 60 "name": "Princess Leia" 61 } 62 ] 63 } 64 ] 65 } 66 ` 67 68 dgraphTutorialMissingIDs = `{ 69 "everyone": [ 70 { 71 "_uid_": "0xfd90205a458151f", 72 "friend": [ 73 { 74 "_uid_": "0x52a80955d40ec819", 75 "friend": [ 76 { 77 "_uid_": "0xfd90205a458151f", 78 "age": 39, 79 "friend": [ 80 { 81 "age": 35, 82 "name": "Amit" 83 }, 84 { 85 "age": 24, 86 "name": "Sang Hyun" 87 }, 88 { 89 "age": 55, 90 "name": "Sarah" 91 }, 92 { 93 "age": 35, 94 "name": "Artyom" 95 }, 96 { 97 "age": 19, 98 "name": "Catalina" 99 } 100 ], 101 "name": "Michael", 102 "owns_pet": [ 103 { 104 "name": "Rammy the sheep" 105 } 106 ] 107 }, 108 { 109 "_uid_": "0x5e9ad1cd9466228c", 110 "age": 24, 111 "friend": [ 112 { 113 "age": 35, 114 "name": "Amit" 115 }, 116 { 117 "age": 19, 118 "name": "Catalina" 119 }, 120 { 121 "name": "Hyung Sin" 122 } 123 ], 124 "name": "Sang Hyun", 125 "owns_pet": [ 126 { 127 "name": "Goldie" 128 } 129 ] 130 }, 131 { 132 "_uid_": "0x99b74c1b5ab100ec", 133 "age": 35, 134 "name": "Artyom" 135 } 136 ], 137 "name": "Amit" 138 }, 139 { 140 "_uid_": "0x5e9ad1cd9466228c", 141 "friend": [ 142 { 143 "_uid_": "0x52a80955d40ec819", 144 "age": 35, 145 "friend": [ 146 { 147 "age": 39, 148 "name": "Michael" 149 }, 150 { 151 "age": 24, 152 "name": "Sang Hyun" 153 }, 154 { 155 "age": 35, 156 "name": "Artyom" 157 } 158 ], 159 "name": "Amit" 160 }, 161 { 162 "_uid_": "0xb9e12a67e34d6acc", 163 "age": 19, 164 "friend": [ 165 { 166 "age": 24, 167 "name": "Sang Hyun" 168 } 169 ], 170 "name": "Catalina", 171 "owns_pet": [ 172 { 173 "name": "Perro" 174 } 175 ] 176 }, 177 { 178 "_uid_": "0xf92d7dbe272d680b", 179 "friend": [ 180 { 181 "age": 24, 182 "name": "Sang Hyun" 183 } 184 ], 185 "name": "Hyung Sin" 186 } 187 ], 188 "name": "Sang Hyun" 189 }, 190 { 191 "_uid_": "0x892a6da7ee1fbdec", 192 "name": "Sarah" 193 }, 194 { 195 "_uid_": "0x99b74c1b5ab100ec", 196 "name": "Artyom" 197 }, 198 { 199 "_uid_": "0xb9e12a67e34d6acc", 200 "friend": [ 201 { 202 "_uid_": "0x5e9ad1cd9466228c", 203 "age": 24, 204 "friend": [ 205 { 206 "age": 35, 207 "name": "Amit" 208 }, 209 { 210 "age": 19, 211 "name": "Catalina" 212 }, 213 { 214 "name": "Hyung Sin" 215 } 216 ], 217 "name": "Sang Hyun", 218 "owns_pet": [ 219 { 220 "name": "Goldie" 221 } 222 ] 223 } 224 ], 225 "name": "Catalina" 226 } 227 ], 228 "name": "Michael" 229 }, 230 { 231 "_uid_": "0x52a80955d40ec819", 232 "friend": [ 233 { 234 "_uid_": "0xfd90205a458151f", 235 "friend": [ 236 { 237 "_uid_": "0x52a80955d40ec819", 238 "age": 35, 239 "friend": [ 240 { 241 "age": 39, 242 "name": "Michael" 243 }, 244 { 245 "age": 24, 246 "name": "Sang Hyun" 247 }, 248 { 249 "age": 35, 250 "name": "Artyom" 251 } 252 ], 253 "name": "Amit" 254 }, 255 { 256 "_uid_": "0x5e9ad1cd9466228c", 257 "age": 24, 258 "friend": [ 259 { 260 "age": 35, 261 "name": "Amit" 262 }, 263 { 264 "age": 19, 265 "name": "Catalina" 266 }, 267 { 268 "name": "Hyung Sin" 269 } 270 ], 271 "name": "Sang Hyun", 272 "owns_pet": [ 273 { 274 "name": "Goldie" 275 } 276 ] 277 }, 278 { 279 "_uid_": "0x892a6da7ee1fbdec", 280 "age": 55, 281 "name": "Sarah" 282 }, 283 { 284 "_uid_": "0x99b74c1b5ab100ec", 285 "age": 35, 286 "name": "Artyom" 287 }, 288 { 289 "_uid_": "0xb9e12a67e34d6acc", 290 "age": 19, 291 "friend": [ 292 { 293 "age": 24, 294 "name": "Sang Hyun" 295 } 296 ], 297 "name": "Catalina", 298 "owns_pet": [ 299 { 300 "name": "Perro" 301 } 302 ] 303 } 304 ], 305 "name": "Michael" 306 }, 307 { 308 "_uid_": "0x5e9ad1cd9466228c", 309 "friend": [ 310 { 311 "_uid_": "0x52a80955d40ec819", 312 "age": 35, 313 "friend": [ 314 { 315 "age": 39, 316 "name": "Michael" 317 }, 318 { 319 "age": 24, 320 "name": "Sang Hyun" 321 }, 322 { 323 "age": 35, 324 "name": "Artyom" 325 } 326 ], 327 "name": "Amit" 328 }, 329 { 330 "_uid_": "0xb9e12a67e34d6acc", 331 "age": 19, 332 "friend": [ 333 { 334 "age": 24, 335 "name": "Sang Hyun" 336 } 337 ], 338 "name": "Catalina", 339 "owns_pet": [ 340 { 341 "name": "Perro" 342 } 343 ] 344 }, 345 { 346 "_uid_": "0xf92d7dbe272d680b", 347 "friend": [ 348 { 349 "age": 24, 350 "name": "Sang Hyun" 351 } 352 ], 353 "name": "Hyung Sin" 354 } 355 ], 356 "name": "Sang Hyun" 357 }, 358 { 359 "_uid_": "0x99b74c1b5ab100ec", 360 "name": "Artyom" 361 } 362 ], 363 "name": "Amit" 364 } 365 ] 366 } 367 ` 368 369 dgraphTutorial = `{ 370 "everyone": [ 371 { 372 "_uid_": "0xfd90205a458151f", 373 "friend": [ 374 { 375 "_uid_": "0x52a80955d40ec819", 376 "friend": [ 377 { 378 "_uid_": "0xfd90205a458151f", 379 "age": 39, 380 "friend": [ 381 { 382 "_uid_": "0x52a80955d40ec819", 383 "age": 35, 384 "friend": [ 385 { 386 "_uid_": "0xfd90205a458151f" 387 }, 388 { 389 "_uid_": "0x5e9ad1cd9466228c" 390 }, 391 { 392 "_uid_": "0x99b74c1b5ab100ec" 393 } 394 ], 395 "name": "Amit" 396 }, 397 { 398 "_uid_": "0x5e9ad1cd9466228c", 399 "age": 24, 400 "friend": [ 401 { 402 "_uid_": "0x52a80955d40ec819" 403 }, 404 { 405 "_uid_": "0xb9e12a67e34d6acc" 406 }, 407 { 408 "_uid_": "0xf92d7dbe272d680b" 409 } 410 ], 411 "name": "Sang Hyun", 412 "owns_pet": [ 413 { 414 "_uid_": "0xf590a923ea1fccaa" 415 } 416 ] 417 }, 418 { 419 "_uid_": "0x892a6da7ee1fbdec", 420 "age": 55, 421 "name": "Sarah" 422 }, 423 { 424 "_uid_": "0x99b74c1b5ab100ec", 425 "age": 35, 426 "name": "Artyom" 427 }, 428 { 429 "_uid_": "0xb9e12a67e34d6acc", 430 "age": 19, 431 "friend": [ 432 { 433 "_uid_": "0x5e9ad1cd9466228c" 434 } 435 ], 436 "name": "Catalina", 437 "owns_pet": [ 438 { 439 "_uid_": "0xbf104824c777525d" 440 } 441 ] 442 } 443 ], 444 "name": "Michael", 445 "owns_pet": [ 446 { 447 "_uid_": "0x37734fcf0a6fcc69", 448 "name": "Rammy the sheep" 449 } 450 ] 451 }, 452 { 453 "_uid_": "0x5e9ad1cd9466228c", 454 "age": 24, 455 "friend": [ 456 { 457 "_uid_": "0x52a80955d40ec819", 458 "age": 35, 459 "friend": [ 460 { 461 "_uid_": "0xfd90205a458151f" 462 }, 463 { 464 "_uid_": "0x5e9ad1cd9466228c" 465 }, 466 { 467 "_uid_": "0x99b74c1b5ab100ec" 468 } 469 ], 470 "name": "Amit" 471 }, 472 { 473 "_uid_": "0xb9e12a67e34d6acc", 474 "age": 19, 475 "friend": [ 476 { 477 "_uid_": "0x5e9ad1cd9466228c" 478 } 479 ], 480 "name": "Catalina", 481 "owns_pet": [ 482 { 483 "_uid_": "0xbf104824c777525d" 484 } 485 ] 486 }, 487 { 488 "_uid_": "0xf92d7dbe272d680b", 489 "friend": [ 490 { 491 "_uid_": "0x5e9ad1cd9466228c" 492 } 493 ], 494 "name": "Hyung Sin" 495 } 496 ], 497 "name": "Sang Hyun", 498 "owns_pet": [ 499 { 500 "_uid_": "0xf590a923ea1fccaa", 501 "name": "Goldie" 502 } 503 ] 504 }, 505 { 506 "_uid_": "0x99b74c1b5ab100ec", 507 "age": 35, 508 "name": "Artyom" 509 } 510 ], 511 "name": "Amit" 512 }, 513 { 514 "_uid_": "0x5e9ad1cd9466228c", 515 "friend": [ 516 { 517 "_uid_": "0x52a80955d40ec819", 518 "age": 35, 519 "friend": [ 520 { 521 "_uid_": "0xfd90205a458151f", 522 "age": 39, 523 "friend": [ 524 { 525 "_uid_": "0x52a80955d40ec819" 526 }, 527 { 528 "_uid_": "0x5e9ad1cd9466228c" 529 }, 530 { 531 "_uid_": "0x892a6da7ee1fbdec" 532 }, 533 { 534 "_uid_": "0x99b74c1b5ab100ec" 535 }, 536 { 537 "_uid_": "0xb9e12a67e34d6acc" 538 } 539 ], 540 "name": "Michael", 541 "owns_pet": [ 542 { 543 "_uid_": "0x37734fcf0a6fcc69" 544 } 545 ] 546 }, 547 { 548 "_uid_": "0x5e9ad1cd9466228c", 549 "age": 24, 550 "friend": [ 551 { 552 "_uid_": "0x52a80955d40ec819" 553 }, 554 { 555 "_uid_": "0xb9e12a67e34d6acc" 556 }, 557 { 558 "_uid_": "0xf92d7dbe272d680b" 559 } 560 ], 561 "name": "Sang Hyun", 562 "owns_pet": [ 563 { 564 "_uid_": "0xf590a923ea1fccaa" 565 } 566 ] 567 }, 568 { 569 "_uid_": "0x99b74c1b5ab100ec", 570 "age": 35, 571 "name": "Artyom" 572 } 573 ], 574 "name": "Amit" 575 }, 576 { 577 "_uid_": "0xb9e12a67e34d6acc", 578 "age": 19, 579 "friend": [ 580 { 581 "_uid_": "0x5e9ad1cd9466228c", 582 "age": 24, 583 "friend": [ 584 { 585 "_uid_": "0x52a80955d40ec819" 586 }, 587 { 588 "_uid_": "0xb9e12a67e34d6acc" 589 }, 590 { 591 "_uid_": "0xf92d7dbe272d680b" 592 } 593 ], 594 "name": "Sang Hyun", 595 "owns_pet": [ 596 { 597 "_uid_": "0xf590a923ea1fccaa" 598 } 599 ] 600 } 601 ], 602 "name": "Catalina", 603 "owns_pet": [ 604 { 605 "_uid_": "0xbf104824c777525d", 606 "name": "Perro" 607 } 608 ] 609 }, 610 { 611 "_uid_": "0xf92d7dbe272d680b", 612 "friend": [ 613 { 614 "_uid_": "0x5e9ad1cd9466228c", 615 "age": 24, 616 "friend": [ 617 { 618 "_uid_": "0x52a80955d40ec819" 619 }, 620 { 621 "_uid_": "0xb9e12a67e34d6acc" 622 }, 623 { 624 "_uid_": "0xf92d7dbe272d680b" 625 } 626 ], 627 "name": "Sang Hyun", 628 "owns_pet": [ 629 { 630 "_uid_": "0xf590a923ea1fccaa" 631 } 632 ] 633 } 634 ], 635 "name": "Hyung Sin" 636 } 637 ], 638 "name": "Sang Hyun" 639 }, 640 { 641 "_uid_": "0x892a6da7ee1fbdec", 642 "name": "Sarah" 643 }, 644 { 645 "_uid_": "0x99b74c1b5ab100ec", 646 "name": "Artyom" 647 }, 648 { 649 "_uid_": "0xb9e12a67e34d6acc", 650 "friend": [ 651 { 652 "_uid_": "0x5e9ad1cd9466228c", 653 "age": 24, 654 "friend": [ 655 { 656 "_uid_": "0x52a80955d40ec819", 657 "age": 35, 658 "friend": [ 659 { 660 "_uid_": "0xfd90205a458151f" 661 }, 662 { 663 "_uid_": "0x5e9ad1cd9466228c" 664 }, 665 { 666 "_uid_": "0x99b74c1b5ab100ec" 667 } 668 ], 669 "name": "Amit" 670 }, 671 { 672 "_uid_": "0xb9e12a67e34d6acc", 673 "age": 19, 674 "friend": [ 675 { 676 "_uid_": "0x5e9ad1cd9466228c" 677 } 678 ], 679 "name": "Catalina", 680 "owns_pet": [ 681 { 682 "_uid_": "0xbf104824c777525d" 683 } 684 ] 685 }, 686 { 687 "_uid_": "0xf92d7dbe272d680b", 688 "friend": [ 689 { 690 "_uid_": "0x5e9ad1cd9466228c" 691 } 692 ], 693 "name": "Hyung Sin" 694 } 695 ], 696 "name": "Sang Hyun", 697 "owns_pet": [ 698 { 699 "_uid_": "0xf590a923ea1fccaa", 700 "name": "Goldie" 701 } 702 ] 703 } 704 ], 705 "name": "Catalina" 706 } 707 ], 708 "name": "Michael" 709 }, 710 { 711 "_uid_": "0x52a80955d40ec819", 712 "friend": [ 713 { 714 "_uid_": "0xfd90205a458151f", 715 "friend": [ 716 { 717 "_uid_": "0x52a80955d40ec819", 718 "age": 35, 719 "friend": [ 720 { 721 "_uid_": "0xfd90205a458151f", 722 "age": 39, 723 "friend": [ 724 { 725 "_uid_": "0x52a80955d40ec819" 726 }, 727 { 728 "_uid_": "0x5e9ad1cd9466228c" 729 }, 730 { 731 "_uid_": "0x892a6da7ee1fbdec" 732 }, 733 { 734 "_uid_": "0x99b74c1b5ab100ec" 735 }, 736 { 737 "_uid_": "0xb9e12a67e34d6acc" 738 } 739 ], 740 "name": "Michael", 741 "owns_pet": [ 742 { 743 "_uid_": "0x37734fcf0a6fcc69" 744 } 745 ] 746 }, 747 { 748 "_uid_": "0x5e9ad1cd9466228c", 749 "age": 24, 750 "friend": [ 751 { 752 "_uid_": "0x52a80955d40ec819" 753 }, 754 { 755 "_uid_": "0xb9e12a67e34d6acc" 756 }, 757 { 758 "_uid_": "0xf92d7dbe272d680b" 759 } 760 ], 761 "name": "Sang Hyun", 762 "owns_pet": [ 763 { 764 "_uid_": "0xf590a923ea1fccaa" 765 } 766 ] 767 }, 768 { 769 "_uid_": "0x99b74c1b5ab100ec", 770 "age": 35, 771 "name": "Artyom" 772 } 773 ], 774 "name": "Amit" 775 }, 776 { 777 "_uid_": "0x5e9ad1cd9466228c", 778 "age": 24, 779 "friend": [ 780 { 781 "_uid_": "0x52a80955d40ec819", 782 "age": 35, 783 "friend": [ 784 { 785 "_uid_": "0xfd90205a458151f" 786 }, 787 { 788 "_uid_": "0x5e9ad1cd9466228c" 789 }, 790 { 791 "_uid_": "0x99b74c1b5ab100ec" 792 } 793 ], 794 "name": "Amit" 795 }, 796 { 797 "_uid_": "0xb9e12a67e34d6acc", 798 "age": 19, 799 "friend": [ 800 { 801 "_uid_": "0x5e9ad1cd9466228c" 802 } 803 ], 804 "name": "Catalina", 805 "owns_pet": [ 806 { 807 "_uid_": "0xbf104824c777525d" 808 } 809 ] 810 }, 811 { 812 "_uid_": "0xf92d7dbe272d680b", 813 "friend": [ 814 { 815 "_uid_": "0x5e9ad1cd9466228c" 816 } 817 ], 818 "name": "Hyung Sin" 819 } 820 ], 821 "name": "Sang Hyun", 822 "owns_pet": [ 823 { 824 "_uid_": "0xf590a923ea1fccaa", 825 "name": "Goldie" 826 } 827 ] 828 }, 829 { 830 "_uid_": "0x892a6da7ee1fbdec", 831 "age": 55, 832 "name": "Sarah" 833 }, 834 { 835 "_uid_": "0x99b74c1b5ab100ec", 836 "age": 35, 837 "name": "Artyom" 838 }, 839 { 840 "_uid_": "0xb9e12a67e34d6acc", 841 "age": 19, 842 "friend": [ 843 { 844 "_uid_": "0x5e9ad1cd9466228c", 845 "age": 24, 846 "friend": [ 847 { 848 "_uid_": "0x52a80955d40ec819" 849 }, 850 { 851 "_uid_": "0xb9e12a67e34d6acc" 852 }, 853 { 854 "_uid_": "0xf92d7dbe272d680b" 855 } 856 ], 857 "name": "Sang Hyun", 858 "owns_pet": [ 859 { 860 "_uid_": "0xf590a923ea1fccaa" 861 } 862 ] 863 } 864 ], 865 "name": "Catalina", 866 "owns_pet": [ 867 { 868 "_uid_": "0xbf104824c777525d", 869 "name": "Perro" 870 } 871 ] 872 } 873 ], 874 "name": "Michael" 875 }, 876 { 877 "_uid_": "0x5e9ad1cd9466228c", 878 "friend": [ 879 { 880 "_uid_": "0x52a80955d40ec819", 881 "age": 35, 882 "friend": [ 883 { 884 "_uid_": "0xfd90205a458151f", 885 "age": 39, 886 "friend": [ 887 { 888 "_uid_": "0x52a80955d40ec819" 889 }, 890 { 891 "_uid_": "0x5e9ad1cd9466228c" 892 }, 893 { 894 "_uid_": "0x892a6da7ee1fbdec" 895 }, 896 { 897 "_uid_": "0x99b74c1b5ab100ec" 898 }, 899 { 900 "_uid_": "0xb9e12a67e34d6acc" 901 } 902 ], 903 "name": "Michael", 904 "owns_pet": [ 905 { 906 "_uid_": "0x37734fcf0a6fcc69" 907 } 908 ] 909 }, 910 { 911 "_uid_": "0x5e9ad1cd9466228c", 912 "age": 24, 913 "friend": [ 914 { 915 "_uid_": "0x52a80955d40ec819" 916 }, 917 { 918 "_uid_": "0xb9e12a67e34d6acc" 919 }, 920 { 921 "_uid_": "0xf92d7dbe272d680b" 922 } 923 ], 924 "name": "Sang Hyun", 925 "owns_pet": [ 926 { 927 "_uid_": "0xf590a923ea1fccaa" 928 } 929 ] 930 }, 931 { 932 "_uid_": "0x99b74c1b5ab100ec", 933 "age": 35, 934 "name": "Artyom" 935 } 936 ], 937 "name": "Amit" 938 }, 939 { 940 "_uid_": "0xb9e12a67e34d6acc", 941 "age": 19, 942 "friend": [ 943 { 944 "_uid_": "0x5e9ad1cd9466228c", 945 "age": 24, 946 "friend": [ 947 { 948 "_uid_": "0x52a80955d40ec819" 949 }, 950 { 951 "_uid_": "0xb9e12a67e34d6acc" 952 }, 953 { 954 "_uid_": "0xf92d7dbe272d680b" 955 } 956 ], 957 "name": "Sang Hyun", 958 "owns_pet": [ 959 { 960 "_uid_": "0xf590a923ea1fccaa" 961 } 962 ] 963 } 964 ], 965 "name": "Catalina", 966 "owns_pet": [ 967 { 968 "_uid_": "0xbf104824c777525d", 969 "name": "Perro" 970 } 971 ] 972 }, 973 { 974 "_uid_": "0xf92d7dbe272d680b", 975 "friend": [ 976 { 977 "_uid_": "0x5e9ad1cd9466228c", 978 "age": 24, 979 "friend": [ 980 { 981 "_uid_": "0x52a80955d40ec819" 982 }, 983 { 984 "_uid_": "0xb9e12a67e34d6acc" 985 }, 986 { 987 "_uid_": "0xf92d7dbe272d680b" 988 } 989 ], 990 "name": "Sang Hyun", 991 "owns_pet": [ 992 { 993 "_uid_": "0xf590a923ea1fccaa" 994 } 995 ] 996 } 997 ], 998 "name": "Hyung Sin" 999 } 1000 ], 1001 "name": "Sang Hyun" 1002 }, 1003 { 1004 "_uid_": "0x99b74c1b5ab100ec", 1005 "name": "Artyom" 1006 } 1007 ], 1008 "name": "Amit" 1009 } 1010 ] 1011 } 1012 ` 1013 )