└── GraphQLNetApollo-main ├── .gitignore ├── Backend ├── .vs │ ├── GraphQLStack │ │ ├── DesignTimeBuild │ │ │ └── .dtbcache.v2 │ │ ├── FileContentIndex │ │ │ ├── 3e304242-54c1-4564-a088-d253c1477c5a.vsidx │ │ │ └── read.lock │ │ ├── config │ │ │ └── applicationhost.config │ │ └── v17 │ │ │ ├── .futdcache.v1 │ │ │ └── .futdcache.v2 │ └── ProjectEvaluation │ │ ├── graphqlstack.metadata.v5.2 │ │ └── graphqlstack.projects.v5.2 ├── GraphQLStack.sln └── GraphQLStack │ ├── Context.cs │ ├── Domain │ ├── Engine.cs │ ├── EngineType.cs │ └── Rocket.cs │ ├── GraphQLStack.csproj │ ├── Graphql │ └── Query.cs │ ├── Program.cs │ ├── Properties │ └── launchSettings.json │ ├── appsettings.Development.json │ └── appsettings.json └── Frontend ├── README.md ├── codegen.yml ├── package.json ├── public ├── favicon.ico ├── index.html ├── logo192.png ├── logo512.png ├── manifest.json └── robots.txt ├── src ├── App.css ├── App.test.tsx ├── App.tsx ├── Engines.tsx ├── graphql │ ├── GetEngines.gql │ └── generated │ │ └── schema.ts ├── index.css ├── index.tsx ├── logo.svg ├── react-app-env.d.ts ├── reportWebVitals.ts └── setupTests.ts ├── tsconfig.json └── yarn.lock /GraphQLNetApollo-main/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | Frontend/node_modules 5 | /.pnp 6 | .pnp.js 7 | Backend/GraphQLStack/bin 8 | Backend/GraphQLStack/obj 9 | 10 | 11 | # testing 12 | /coverage 13 | 14 | # production 15 | /build 16 | 17 | # misc 18 | .DS_Store 19 | .env.local 20 | .env.development.local 21 | .env.test.local 22 | .env.production.local 23 | 24 | npm-debug.log* 25 | yarn-debug.log* 26 | yarn-error.log* 27 | -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Backend/.vs/GraphQLStack/DesignTimeBuild/.dtbcache.v2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Topten1004/GraphQL-API/0cb59b5fa6893d29acbeb4c6d5a66306ab06b581/GraphQLNetApollo-main/Backend/.vs/GraphQLStack/DesignTimeBuild/.dtbcache.v2 -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Backend/.vs/GraphQLStack/FileContentIndex/3e304242-54c1-4564-a088-d253c1477c5a.vsidx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Topten1004/GraphQL-API/0cb59b5fa6893d29acbeb4c6d5a66306ab06b581/GraphQLNetApollo-main/Backend/.vs/GraphQLStack/FileContentIndex/3e304242-54c1-4564-a088-d253c1477c5a.vsidx -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Backend/.vs/GraphQLStack/FileContentIndex/read.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Topten1004/GraphQL-API/0cb59b5fa6893d29acbeb4c6d5a66306ab06b581/GraphQLNetApollo-main/Backend/.vs/GraphQLStack/FileContentIndex/read.lock -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Backend/.vs/GraphQLStack/config/applicationhost.config: -------------------------------------------------------------------------------- 1 |  2 | 20 | 21 | 48 | 49 | 50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 | 59 | 60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 | 79 |
80 |
81 | 82 |
83 |
84 |
85 |
86 |
87 |
88 | 89 |
90 |
91 |
92 |
93 |
94 | 95 |
96 |
97 |
98 | 99 |
100 |
101 | 102 |
103 |
104 | 105 |
106 |
107 |
108 | 109 | 110 |
111 |
112 |
113 |
114 |
115 |
116 | 117 |
118 |
119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | 683 | 684 | 685 | 686 | 687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | 698 | 699 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 723 | 724 | 725 | 726 | 727 | 728 | 729 | 730 | 731 | 732 | 733 | 734 | 735 | 736 | 737 | 738 | 739 | 740 | 741 | 742 | 743 | 744 | 745 | 746 | 747 | 748 | 749 | 750 | 751 | 752 | 753 | 754 | 755 | 756 | 757 | 758 | 759 | 760 | 761 | 762 | 763 | 764 | 765 | 766 | 767 | 768 | 769 | 770 | 771 | 772 | 773 | 774 | 775 | 776 | 777 | 778 | 779 | 780 | 781 | 782 | 783 | 784 | 785 | 786 | 787 | 788 | 789 | 790 | 791 | 792 | 793 | 794 | 795 | 796 | 797 | 798 | 799 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 829 | 830 | 831 | 832 | 833 | 834 | 835 | 836 | 837 | 838 | 839 | 840 | 841 | 842 | 843 | 844 | 845 | 846 | 847 | 848 | 849 | 850 | 851 | 852 | 853 | 854 | 855 | 856 | 857 | 858 | 859 | 860 | 861 | 862 | 863 | 864 | 865 | 866 | 867 | 868 | 869 | 870 | 871 | 872 | 873 | 874 | 875 | 876 | 877 | 878 | 879 | 880 | 881 | 882 | 883 | 884 | 885 | 886 | 887 | 888 | 889 | 890 | 891 | 892 | 893 | 894 | 895 | 896 | 897 | 898 | 899 | 900 | 901 | 902 | 903 | 904 | 905 | 906 | 907 | 908 | 909 | 910 | 911 | 912 | 913 | 914 | 915 | 916 | 917 | 918 | 919 | 920 | 921 | 922 | 923 | 924 | 925 | 926 | 927 | 928 | 929 | 930 | 931 | 932 | 933 | 934 | 935 | 936 | 937 | 938 | 939 | 940 | 941 | 942 | 943 | 944 | 945 | 946 | 947 | 948 | 949 | 950 | 951 | 952 | 953 | 954 | 955 | 956 | 957 | 958 | 959 | 960 | 961 | 962 | 963 | 964 | 965 | 966 | 967 | 968 | 969 | 970 | 971 | 972 | 973 | 974 | 975 | 976 | 977 | 978 | 979 | 980 | 981 | 982 | 983 | 984 | 985 | 986 | 987 | 988 | 989 | 990 | 991 | 992 | 993 | 994 | 995 | -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Backend/.vs/GraphQLStack/v17/.futdcache.v1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Topten1004/GraphQL-API/0cb59b5fa6893d29acbeb4c6d5a66306ab06b581/GraphQLNetApollo-main/Backend/.vs/GraphQLStack/v17/.futdcache.v1 -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Backend/.vs/GraphQLStack/v17/.futdcache.v2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Topten1004/GraphQL-API/0cb59b5fa6893d29acbeb4c6d5a66306ab06b581/GraphQLNetApollo-main/Backend/.vs/GraphQLStack/v17/.futdcache.v2 -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Backend/.vs/ProjectEvaluation/graphqlstack.metadata.v5.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Topten1004/GraphQL-API/0cb59b5fa6893d29acbeb4c6d5a66306ab06b581/GraphQLNetApollo-main/Backend/.vs/ProjectEvaluation/graphqlstack.metadata.v5.2 -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Backend/.vs/ProjectEvaluation/graphqlstack.projects.v5.2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Topten1004/GraphQL-API/0cb59b5fa6893d29acbeb4c6d5a66306ab06b581/GraphQLNetApollo-main/Backend/.vs/ProjectEvaluation/graphqlstack.projects.v5.2 -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Backend/GraphQLStack.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.1.32328.378 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GraphQLStack", "GraphQLStack\GraphQLStack.csproj", "{23B416D0-50B9-47DE-BF1D-03FD19110E4F}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {23B416D0-50B9-47DE-BF1D-03FD19110E4F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {23B416D0-50B9-47DE-BF1D-03FD19110E4F}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {23B416D0-50B9-47DE-BF1D-03FD19110E4F}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {23B416D0-50B9-47DE-BF1D-03FD19110E4F}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {010430AE-8B8A-4154-87D3-0F80206C2D75} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Backend/GraphQLStack/Context.cs: -------------------------------------------------------------------------------- 1 | using GraphQLStack.Domain; 2 | using Microsoft.EntityFrameworkCore; 3 | 4 | namespace GraphQLStack; 5 | 6 | public class Context : DbContext 7 | { 8 | public DbSet Rockets { get; set; } 9 | public DbSet Engines { get; set; } 10 | 11 | public Context(DbContextOptions options) : base(options) 12 | { 13 | } 14 | 15 | protected override void OnModelCreating(ModelBuilder modelBuilder) 16 | { 17 | modelBuilder.Entity().HasKey(r => r.Id); 18 | modelBuilder.Entity().HasKey(e => e.Id); 19 | 20 | modelBuilder.Entity().HasData(new Rocket { Id = 1, Name = "Falcon 9" }); 21 | modelBuilder.Entity().HasData( 22 | new Engine { Id = 1, Name = "Merlin 1D+", RocketId = 1, Type = EngineType.SeaLevel, Isp = 310, Thrust = 420 }, 23 | new Engine { Id = 2, Name = "Merlin 1D+", RocketId = 1, Type = EngineType.Vacuum, Isp = 348, Thrust = 225 } 24 | ); 25 | } 26 | } -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Backend/GraphQLStack/Domain/Engine.cs: -------------------------------------------------------------------------------- 1 | namespace GraphQLStack.Domain; 2 | 3 | public class Engine 4 | { 5 | public int Id { get; set; } 6 | public string Name { get; set; } 7 | public int Thrust { get; set; } 8 | public int Isp { get; set; } 9 | public EngineType Type { get; set; } 10 | public int RocketId { get; set; } 11 | } -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Backend/GraphQLStack/Domain/EngineType.cs: -------------------------------------------------------------------------------- 1 | namespace GraphQLStack.Domain; 2 | 3 | public enum EngineType 4 | { 5 | SeaLevel, 6 | Vacuum 7 | } -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Backend/GraphQLStack/Domain/Rocket.cs: -------------------------------------------------------------------------------- 1 | namespace GraphQLStack.Domain; 2 | 3 | public class Rocket 4 | { 5 | public int Id { get; set; } 6 | public string Name { get; set; } 7 | public List Engines { get; set; } 8 | } -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Backend/GraphQLStack/GraphQLStack.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | all 16 | runtime; build; native; contentfiles; analyzers; buildtransitive 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Backend/GraphQLStack/Graphql/Query.cs: -------------------------------------------------------------------------------- 1 | using GraphQLStack.Domain; 2 | 3 | namespace GraphQLStack.Graphql; 4 | 5 | public class Query 6 | { 7 | public Query(Context context) 8 | { 9 | context.Database.EnsureCreated(); 10 | } 11 | 12 | [UseFiltering] 13 | public IQueryable GetRockets([Service] Context context) 14 | { 15 | return context.Rockets; 16 | } 17 | 18 | [UseFiltering] 19 | public IQueryable GetEngines([Service] Context context) 20 | { 21 | return context.Engines; 22 | } 23 | } -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Backend/GraphQLStack/Program.cs: -------------------------------------------------------------------------------- 1 | using GraphQL.Server.Ui.Voyager; 2 | using GraphQLStack; 3 | using GraphQLStack.Graphql; 4 | using Microsoft.EntityFrameworkCore; 5 | 6 | var builder = WebApplication.CreateBuilder(args); 7 | 8 | // Add services to the container. 9 | 10 | builder.Services.AddControllers(); 11 | 12 | var MyAllowSpecificOrigins = "_myAllowSpecificOrigins"; 13 | 14 | builder.Services.AddDbContextFactory(options => options.UseInMemoryDatabase("InMemoryDb")); 15 | 16 | //graphQL 17 | builder.Services 18 | .AddGraphQLServer() 19 | .AddQueryType() 20 | .AddFiltering(); 21 | 22 | 23 | builder.Services.AddCors(options => 24 | { 25 | options.AddPolicy(name: MyAllowSpecificOrigins, 26 | policy => 27 | { 28 | policy.AllowAnyOrigin() 29 | .AllowAnyHeader() 30 | .AllowAnyMethod(); 31 | }); 32 | }); 33 | 34 | var app = builder.Build(); 35 | 36 | app.UseCors(MyAllowSpecificOrigins); 37 | 38 | // Add GraphQL endpoint configuration 39 | app.UseRouting().UseEndpoints(endpoints => 40 | { 41 | endpoints.MapGraphQL(); 42 | endpoints.MapControllers(); 43 | }); 44 | 45 | app.UseHttpsRedirection(); 46 | 47 | app.UseAuthorization(); 48 | 49 | app.MapControllers(); 50 | 51 | app.UseGraphQLVoyager(new VoyagerOptions { GraphQLEndPoint = "/graphql" }, "/graphql-voyager"); 52 | 53 | app.Run(); 54 | -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Backend/GraphQLStack/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:43884", 8 | "sslPort": 44365 9 | } 10 | }, 11 | "profiles": { 12 | "GraphQLStack": { 13 | "commandName": "Project", 14 | "launchBrowser": true, 15 | "launchUrl": "swagger", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | }, 19 | "applicationUrl": "http://localhost:5199", 20 | "dotnetRunMessages": true 21 | }, 22 | "IIS Express": { 23 | "commandName": "IISExpress", 24 | "launchBrowser": true, 25 | "launchUrl": "swagger", 26 | "environmentVariables": { 27 | "ASPNETCORE_ENVIRONMENT": "Development" 28 | } 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Backend/GraphQLStack/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Backend/GraphQLStack/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Frontend/README.md: -------------------------------------------------------------------------------- 1 | # Getting Started with Create React App 2 | 3 | This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). 4 | 5 | ## Available Scripts 6 | 7 | In the project directory, you can run: 8 | 9 | ### `yarn start` 10 | 11 | Runs the app in the development mode.\ 12 | Open [http://localhost:3000](http://localhost:3000) to view it in the browser. 13 | 14 | The page will reload if you make edits.\ 15 | You will also see any lint errors in the console. 16 | 17 | ### `yarn test` 18 | 19 | Launches the test runner in the interactive watch mode.\ 20 | See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. 21 | 22 | ### `yarn build` 23 | 24 | Builds the app for production to the `build` folder.\ 25 | It correctly bundles React in production mode and optimizes the build for the best performance. 26 | 27 | The build is minified and the filenames include the hashes.\ 28 | Your app is ready to be deployed! 29 | 30 | See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. 31 | 32 | ### `yarn eject` 33 | 34 | **Note: this is a one-way operation. Once you `eject`, you can’t go back!** 35 | 36 | If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. 37 | 38 | Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. 39 | 40 | You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. 41 | 42 | ## Learn More 43 | 44 | You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). 45 | 46 | To learn React, check out the [React documentation](https://reactjs.org/). 47 | -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Frontend/codegen.yml: -------------------------------------------------------------------------------- 1 | overwrite: true 2 | schema: "http://localhost:5199/graphql" 3 | documents: "**/*.{gql,graphql}" 4 | generates: 5 | src/graphql/generated/schema.ts: 6 | plugins: 7 | - "typescript" 8 | - "typescript-operations" 9 | - "typescript-react-apollo" 10 | -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Frontend/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "my-app", 3 | "version": "0.1.0", 4 | "private": true, 5 | "dependencies": { 6 | "@apollo/client": "^3.6.6", 7 | "@testing-library/jest-dom": "^5.14.1", 8 | "@testing-library/react": "^13.0.0", 9 | "@testing-library/user-event": "^13.2.1", 10 | "@types/jest": "^27.0.1", 11 | "@types/node": "^16.7.13", 12 | "@types/react": "^18.0.0", 13 | "@types/react-dom": "^18.0.0", 14 | "graphql": "^16.5.0", 15 | "react": "^18.1.0", 16 | "react-dom": "^18.1.0", 17 | "react-scripts": "5.0.1", 18 | "typescript": "^4.4.2", 19 | "web-vitals": "^2.1.0" 20 | }, 21 | "scripts": { 22 | "start": "react-scripts start", 23 | "build": "react-scripts build", 24 | "test": "react-scripts test", 25 | "eject": "react-scripts eject", 26 | "codegen": "graphql-codegen --config codegen.yml" 27 | }, 28 | "eslintConfig": { 29 | "extends": [ 30 | "react-app", 31 | "react-app/jest" 32 | ] 33 | }, 34 | "browserslist": { 35 | "production": [ 36 | ">0.2%", 37 | "not dead", 38 | "not op_mini all" 39 | ], 40 | "development": [ 41 | "last 1 chrome version", 42 | "last 1 firefox version", 43 | "last 1 safari version" 44 | ] 45 | }, 46 | "devDependencies": { 47 | "@graphql-codegen/cli": "2.6.2", 48 | "@graphql-codegen/introspection": "2.1.1", 49 | "@graphql-codegen/typescript": "2.5.0", 50 | "@graphql-codegen/typescript-operations": "2.4.1", 51 | "@graphql-codegen/typescript-react-apollo": "3.2.15" 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Frontend/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Topten1004/GraphQL-API/0cb59b5fa6893d29acbeb4c6d5a66306ab06b581/GraphQLNetApollo-main/Frontend/public/favicon.ico -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Frontend/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 17 | 18 | 27 | React App 28 | 29 | 30 | 31 |
32 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Frontend/public/logo192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Topten1004/GraphQL-API/0cb59b5fa6893d29acbeb4c6d5a66306ab06b581/GraphQLNetApollo-main/Frontend/public/logo192.png -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Frontend/public/logo512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Topten1004/GraphQL-API/0cb59b5fa6893d29acbeb4c6d5a66306ab06b581/GraphQLNetApollo-main/Frontend/public/logo512.png -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Frontend/public/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "short_name": "React App", 3 | "name": "Create React App Sample", 4 | "icons": [ 5 | { 6 | "src": "favicon.ico", 7 | "sizes": "64x64 32x32 24x24 16x16", 8 | "type": "image/x-icon" 9 | }, 10 | { 11 | "src": "logo192.png", 12 | "type": "image/png", 13 | "sizes": "192x192" 14 | }, 15 | { 16 | "src": "logo512.png", 17 | "type": "image/png", 18 | "sizes": "512x512" 19 | } 20 | ], 21 | "start_url": ".", 22 | "display": "standalone", 23 | "theme_color": "#000000", 24 | "background_color": "#ffffff" 25 | } 26 | -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Frontend/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: 4 | -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Frontend/src/App.css: -------------------------------------------------------------------------------- 1 | .App { 2 | text-align: center; 3 | } 4 | 5 | .App-logo { 6 | height: 40vmin; 7 | pointer-events: none; 8 | } 9 | 10 | @media (prefers-reduced-motion: no-preference) { 11 | .App-logo { 12 | animation: App-logo-spin infinite 20s linear; 13 | } 14 | } 15 | 16 | .App-header { 17 | background-color: #282c34; 18 | min-height: 100vh; 19 | display: flex; 20 | flex-direction: column; 21 | align-items: center; 22 | justify-content: center; 23 | font-size: calc(10px + 2vmin); 24 | color: white; 25 | } 26 | 27 | .App-link { 28 | color: #61dafb; 29 | } 30 | 31 | @keyframes App-logo-spin { 32 | from { 33 | transform: rotate(0deg); 34 | } 35 | to { 36 | transform: rotate(360deg); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Frontend/src/App.test.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { render, screen } from '@testing-library/react'; 3 | import App from './App'; 4 | 5 | test('renders learn react link', () => { 6 | render(); 7 | const linkElement = screen.getByText(/learn react/i); 8 | expect(linkElement).toBeInTheDocument(); 9 | }); 10 | -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Frontend/src/App.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import './App.css'; 3 | import { Engines } from './Engines'; 4 | 5 | import { 6 | ApolloClient, 7 | ApolloProvider, 8 | HttpLink, 9 | InMemoryCache, 10 | } from "@apollo/client"; 11 | 12 | // const httpLink = new HttpLink({ uri: "/api/graphql", useGETForQueries: true }); 13 | 14 | const client = new ApolloClient({ 15 | cache: new InMemoryCache({ 16 | typePolicies: { 17 | }, 18 | }), 19 | uri: "http://localhost:5199/graphql", 20 | //uri: "/api/graphql/", 21 | }); 22 | 23 | function App() { 24 | return ( 25 | 26 |
27 | 28 |
29 |
30 | ); 31 | } 32 | 33 | export default App; 34 | -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Frontend/src/Engines.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { useGetEnginesQuery } from './graphql/generated/schema'; 3 | 4 | export const Engines: React.FC = () => { 5 | const { data, loading, error } = useGetEnginesQuery(); 6 | 7 | if (loading) { 8 | return
Loading...
; 9 | } 10 | 11 | if (error || !data) { 12 | return
ERROR
; 13 | } 14 | 15 | return ( 16 |
17 |

Engines

18 |
    19 | {data.rockets.map(engine => ( 20 |
  • {engine.name}
  • 21 | ))} 22 |
23 |
24 | ); 25 | }; -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Frontend/src/graphql/GetEngines.gql: -------------------------------------------------------------------------------- 1 | query GetEngines{ 2 | rockets { 3 | id 4 | name 5 | } 6 | } -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Frontend/src/graphql/generated/schema.ts: -------------------------------------------------------------------------------- 1 | import { gql } from '@apollo/client'; 2 | import * as Apollo from '@apollo/client'; 3 | export type Maybe = T | null; 4 | export type InputMaybe = Maybe; 5 | export type Exact = { [K in keyof T]: T[K] }; 6 | export type MakeOptional = Omit & { [SubKey in K]?: Maybe }; 7 | export type MakeMaybe = Omit & { [SubKey in K]: Maybe }; 8 | const defaultOptions = {} as const; 9 | /** All built-in and custom scalars, mapped to their actual values */ 10 | export type Scalars = { 11 | ID: string; 12 | String: string; 13 | Boolean: boolean; 14 | Int: number; 15 | Float: number; 16 | }; 17 | 18 | export type ComparableInt32OperationFilterInput = { 19 | eq?: InputMaybe; 20 | gt?: InputMaybe; 21 | gte?: InputMaybe; 22 | in?: InputMaybe>; 23 | lt?: InputMaybe; 24 | lte?: InputMaybe; 25 | neq?: InputMaybe; 26 | ngt?: InputMaybe; 27 | ngte?: InputMaybe; 28 | nin?: InputMaybe>; 29 | nlt?: InputMaybe; 30 | nlte?: InputMaybe; 31 | }; 32 | 33 | export type Engine = { 34 | __typename?: 'Engine'; 35 | id: Scalars['Int']; 36 | isp: Scalars['Int']; 37 | name: Scalars['String']; 38 | rocketId: Scalars['Int']; 39 | thrust: Scalars['Int']; 40 | type: EngineType; 41 | }; 42 | 43 | export type EngineFilterInput = { 44 | and?: InputMaybe>; 45 | id?: InputMaybe; 46 | isp?: InputMaybe; 47 | name?: InputMaybe; 48 | or?: InputMaybe>; 49 | rocketId?: InputMaybe; 50 | thrust?: InputMaybe; 51 | type?: InputMaybe; 52 | }; 53 | 54 | export enum EngineType { 55 | SeaLevel = 'SEA_LEVEL', 56 | Vacuum = 'VACUUM' 57 | } 58 | 59 | export type EngineTypeOperationFilterInput = { 60 | eq?: InputMaybe; 61 | in?: InputMaybe>; 62 | neq?: InputMaybe; 63 | nin?: InputMaybe>; 64 | }; 65 | 66 | export type ListFilterInputTypeOfEngineFilterInput = { 67 | all?: InputMaybe; 68 | any?: InputMaybe; 69 | none?: InputMaybe; 70 | some?: InputMaybe; 71 | }; 72 | 73 | export type Query = { 74 | __typename?: 'Query'; 75 | engines: Array; 76 | rockets: Array; 77 | }; 78 | 79 | 80 | export type QueryEnginesArgs = { 81 | where?: InputMaybe; 82 | }; 83 | 84 | 85 | export type QueryRocketsArgs = { 86 | where?: InputMaybe; 87 | }; 88 | 89 | export type Rocket = { 90 | __typename?: 'Rocket'; 91 | engines: Array; 92 | id: Scalars['Int']; 93 | name: Scalars['String']; 94 | }; 95 | 96 | export type RocketFilterInput = { 97 | and?: InputMaybe>; 98 | engines?: InputMaybe; 99 | id?: InputMaybe; 100 | name?: InputMaybe; 101 | or?: InputMaybe>; 102 | }; 103 | 104 | export type StringOperationFilterInput = { 105 | and?: InputMaybe>; 106 | contains?: InputMaybe; 107 | endsWith?: InputMaybe; 108 | eq?: InputMaybe; 109 | in?: InputMaybe>>; 110 | ncontains?: InputMaybe; 111 | nendsWith?: InputMaybe; 112 | neq?: InputMaybe; 113 | nin?: InputMaybe>>; 114 | nstartsWith?: InputMaybe; 115 | or?: InputMaybe>; 116 | startsWith?: InputMaybe; 117 | }; 118 | 119 | export type GetEnginesQueryVariables = Exact<{ [key: string]: never; }>; 120 | 121 | 122 | export type GetEnginesQuery = { __typename?: 'Query', rockets: Array<{ __typename?: 'Rocket', id: number, name: string }> }; 123 | 124 | 125 | export const GetEnginesDocument = gql` 126 | query GetEngines { 127 | rockets { 128 | id 129 | name 130 | } 131 | } 132 | `; 133 | 134 | /** 135 | * __useGetEnginesQuery__ 136 | * 137 | * To run a query within a React component, call `useGetEnginesQuery` and pass it any options that fit your needs. 138 | * When your component renders, `useGetEnginesQuery` returns an object from Apollo Client that contains loading, error, and data properties 139 | * you can use to render your UI. 140 | * 141 | * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; 142 | * 143 | * @example 144 | * const { data, loading, error } = useGetEnginesQuery({ 145 | * variables: { 146 | * }, 147 | * }); 148 | */ 149 | export function useGetEnginesQuery(baseOptions?: Apollo.QueryHookOptions) { 150 | const options = {...defaultOptions, ...baseOptions} 151 | return Apollo.useQuery(GetEnginesDocument, options); 152 | } 153 | export function useGetEnginesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { 154 | const options = {...defaultOptions, ...baseOptions} 155 | return Apollo.useLazyQuery(GetEnginesDocument, options); 156 | } 157 | export type GetEnginesQueryHookResult = ReturnType; 158 | export type GetEnginesLazyQueryHookResult = ReturnType; 159 | export type GetEnginesQueryResult = Apollo.QueryResult; -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Frontend/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Frontend/src/index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import ReactDOM from 'react-dom/client'; 3 | import './index.css'; 4 | import App from './App'; 5 | import reportWebVitals from './reportWebVitals'; 6 | 7 | const root = ReactDOM.createRoot( 8 | document.getElementById('root') as HTMLElement 9 | ); 10 | root.render( 11 | 12 | 13 | 14 | ); 15 | 16 | // If you want to start measuring performance in your app, pass a function 17 | // to log results (for example: reportWebVitals(console.log)) 18 | // or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals 19 | reportWebVitals(); 20 | -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Frontend/src/logo.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Frontend/src/react-app-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Frontend/src/reportWebVitals.ts: -------------------------------------------------------------------------------- 1 | import { ReportHandler } from 'web-vitals'; 2 | 3 | const reportWebVitals = (onPerfEntry?: ReportHandler) => { 4 | if (onPerfEntry && onPerfEntry instanceof Function) { 5 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { 6 | getCLS(onPerfEntry); 7 | getFID(onPerfEntry); 8 | getFCP(onPerfEntry); 9 | getLCP(onPerfEntry); 10 | getTTFB(onPerfEntry); 11 | }); 12 | } 13 | }; 14 | 15 | export default reportWebVitals; 16 | -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Frontend/src/setupTests.ts: -------------------------------------------------------------------------------- 1 | // jest-dom adds custom jest matchers for asserting on DOM nodes. 2 | // allows you to do things like: 3 | // expect(element).toHaveTextContent(/react/i) 4 | // learn more: https://github.com/testing-library/jest-dom 5 | import '@testing-library/jest-dom'; 6 | -------------------------------------------------------------------------------- /GraphQLNetApollo-main/Frontend/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": [ 5 | "dom", 6 | "dom.iterable", 7 | "esnext" 8 | ], 9 | "allowJs": true, 10 | "skipLibCheck": true, 11 | "esModuleInterop": true, 12 | "allowSyntheticDefaultImports": true, 13 | "strict": true, 14 | "forceConsistentCasingInFileNames": true, 15 | "noFallthroughCasesInSwitch": true, 16 | "module": "esnext", 17 | "moduleResolution": "node", 18 | "resolveJsonModule": true, 19 | "isolatedModules": true, 20 | "noEmit": true, 21 | "jsx": "react-jsx" 22 | }, 23 | "include": [ 24 | "src" 25 | ] 26 | } 27 | --------------------------------------------------------------------------------