forked from shinjiDev/petgraphqlsample
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a122d63
commit a4e4495
Showing
49 changed files
with
1,433 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
############################################################################### | ||
# Set default behavior to automatically normalize line endings. | ||
############################################################################### | ||
* text=auto | ||
|
||
############################################################################### | ||
# Set default behavior for command prompt diff. | ||
# | ||
# This is need for earlier builds of msysgit that does not have it on by | ||
# default for csharp files. | ||
# Note: This is only used by command line | ||
############################################################################### | ||
#*.cs diff=csharp | ||
|
||
############################################################################### | ||
# Set the merge driver for project and solution files | ||
# | ||
# Merging from the command prompt will add diff markers to the files if there | ||
# are conflicts (Merging from VS is not affected by the settings below, in VS | ||
# the diff markers are never inserted). Diff markers may cause the following | ||
# file extensions to fail to load in VS. An alternative would be to treat | ||
# these files as binary and thus will always conflict and require user | ||
# intervention with every merge. To do so, just uncomment the entries below | ||
############################################################################### | ||
#*.sln merge=binary | ||
#*.csproj merge=binary | ||
#*.vbproj merge=binary | ||
#*.vcxproj merge=binary | ||
#*.vcproj merge=binary | ||
#*.dbproj merge=binary | ||
#*.fsproj merge=binary | ||
#*.lsproj merge=binary | ||
#*.wixproj merge=binary | ||
#*.modelproj merge=binary | ||
#*.sqlproj merge=binary | ||
#*.wwaproj merge=binary | ||
|
||
############################################################################### | ||
# behavior for image files | ||
# | ||
# image files are treated as binary by default. | ||
############################################################################### | ||
#*.jpg binary | ||
#*.png binary | ||
#*.gif binary | ||
|
||
############################################################################### | ||
# diff behavior for common document formats | ||
# | ||
# Convert binary document formats to text before diffing them. This feature | ||
# is only available from the command line. Turn it on by uncommenting the | ||
# entries below. | ||
############################################################################### | ||
#*.doc diff=astextplain | ||
#*.DOC diff=astextplain | ||
#*.docx diff=astextplain | ||
#*.DOCX diff=astextplain | ||
#*.dot diff=astextplain | ||
#*.DOT diff=astextplain | ||
#*.pdf diff=astextplain | ||
#*.PDF diff=astextplain | ||
#*.rtf diff=astextplain | ||
#*.RTF diff=astextplain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
|
||
namespace DemoChoco | ||
{ | ||
public class Author | ||
{ | ||
public string Name { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
|
||
namespace DemoChoco | ||
{ | ||
public class Book | ||
{ | ||
public string Title { get; set; } | ||
|
||
public Author Author { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
using HotChocolate.Validation; | ||
using System.Globalization; | ||
|
||
namespace DemoChoco.Data | ||
{ | ||
public class DataRepository | ||
{ | ||
public List<Human> humans = new List<Human> | ||
{ | ||
new Human | ||
{ | ||
Name = "foo", | ||
Address = "foo" | ||
}, | ||
new Human | ||
{ | ||
Name = "foo2", | ||
Address = "foo2" | ||
} | ||
}; | ||
|
||
public List<Dog> dogs = new List<Dog> | ||
{ | ||
new Dog | ||
{ | ||
Barks = true, | ||
BarkVolume = 1, | ||
Name = "Tofu", | ||
Nickname = "Tofu", | ||
Owner = new Human | ||
{ | ||
Name = "foo", | ||
Address = "foo" | ||
} | ||
}, | ||
new Dog | ||
{ | ||
Barks = true, | ||
BarkVolume = 3, | ||
Name = "Ink", | ||
Nickname = "Ink" | ||
} | ||
}; | ||
|
||
public List<Cat> cats = new List<Cat> | ||
{ | ||
new Cat | ||
{ | ||
MeowVolume = 1, | ||
Name = "Tofu", | ||
Nickname = "Tofu" | ||
}, | ||
new Cat | ||
{ | ||
MeowVolume = 3, | ||
Name = "Ink", | ||
Nickname = "Ink" | ||
} | ||
}; | ||
|
||
public string[] stringList = | ||
{ | ||
"foo", "asd", "bar", "baz" | ||
}; | ||
|
||
public void AddCat(List<Object> cat) | ||
{ | ||
cats.Add(new Cat | ||
{ | ||
Name = (string)cat[0], | ||
MeowVolume = (int?)cat[2], | ||
Nickname = (string)cat[1] | ||
}); | ||
} | ||
|
||
public void AddDog(List<Object> dog) | ||
{ | ||
dogs.Add(new Dog | ||
{ | ||
Name = (string)dog[0], | ||
BarkVolume = (int?)dog[2], | ||
Nickname = (string)dog[1] | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="HotChocolate.AspNetCore" Version="12.6.2" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.1.32228.430 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DemoChoco", "DemoChoco.csproj", "{C9E76BAD-F7E1-44F5-ACF3-C30828F90FAD}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{C9E76BAD-F7E1-44F5-ACF3-C30828F90FAD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{C9E76BAD-F7E1-44F5-ACF3-C30828F90FAD}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{C9E76BAD-F7E1-44F5-ACF3-C30828F90FAD}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{C9E76BAD-F7E1-44F5-ACF3-C30828F90FAD}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {3F5908EA-4FFD-41EE-B616-3CE13F232F7C} | ||
EndGlobalSection | ||
EndGlobal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace HotChocolate.Validation | ||
{ | ||
public class Alien | ||
: ISentient | ||
{ | ||
public string Name { get; set; } | ||
public string HomePlanet { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using HotChocolate.Validation.Types; | ||
|
||
namespace HotChocolate.Validation | ||
{ | ||
public class Cat | ||
: IPet | ||
{ | ||
public string Name { get; set; } | ||
|
||
public string Nickname { get; set; } | ||
|
||
public int? MeowVolume { get; set; } | ||
|
||
public FurColor? FurColor { get; set; } | ||
|
||
public bool DoesKnowCommand(CatCommand catCommand) | ||
{ | ||
return true; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace HotChocolate.Validation | ||
{ | ||
public enum CatCommand | ||
{ | ||
JUMP | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace HotChocolate.Validation | ||
{ | ||
public class ComplexInput | ||
{ | ||
public string? Name { get; set; } | ||
|
||
public string? Owner { get; set; } | ||
|
||
public ComplexInput? Child { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace HotChocolate.Validation | ||
{ | ||
public class ComplexInput2 | ||
{ | ||
public string Name { get; set; } | ||
|
||
public string Owner { get; set; } | ||
|
||
public ComplexInput2 Child { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
namespace HotChocolate.Validation | ||
{ | ||
public class Dog | ||
: IPet | ||
{ | ||
public string Name { get; set; } | ||
|
||
public string? Nickname { get; set; } | ||
|
||
public int? BarkVolume { get; set; } | ||
|
||
public bool Barks { get; set; } | ||
|
||
public Human? Owner { get; set; } | ||
|
||
public bool DoesKnowCommand(DogCommand dogCommand) | ||
{ | ||
return true; | ||
} | ||
|
||
public bool IsHouseTrained(bool? atOtherHomes) | ||
{ | ||
return true; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace HotChocolate.Validation | ||
{ | ||
public enum DogCommand | ||
{ | ||
Sit, | ||
Down, | ||
Heel | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace HotChocolate.Validation | ||
{ | ||
public class Human : ISentient | ||
{ | ||
public string Name { get; set; } | ||
|
||
public string Address { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace HotChocolate.Validation | ||
{ | ||
public interface IPet | ||
{ | ||
string Name { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace HotChocolate.Validation | ||
{ | ||
public interface ISentient | ||
{ | ||
string Name { get; } | ||
} | ||
|
||
|
||
} |
Oops, something went wrong.