-
-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Revert Make GraphTypeInfo.TypeParameter lazy (#8) * Revert Make GraphTypeInfo.TypeParameter lazy * Version bumps * Fix version bump for GraphQL * "Unexpected type: " error fix hacky fix for "Unexpected type: " error when return type of resolver method is INode * Restore 'GraphTypeInfo' * Added unique version suffix we needed a way to have unique name for out own nuget feed * commetns resolved * removed version suffix * set a proper csproj file version Co-authored-by: K-Pavlov <[email protected]> Co-authored-by: Rob Wijkstra <[email protected]> Co-authored-by: Rob Wijkstra <[email protected]>
- Loading branch information
1 parent
290bf44
commit 01de3af
Showing
4 changed files
with
68 additions
and
9 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
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
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
56 changes: 56 additions & 0 deletions
56
test/GraphQL.Conventions.Tests/Adapters/BugUnexpectedTypeTests.cs
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,56 @@ | ||
using GraphQL.Conventions; | ||
using GraphQL.Conventions.Relay; | ||
using GraphQL.Conventions.Tests; | ||
using GraphQL.Conventions.Tests.Templates; | ||
using GraphQL.Conventions.Tests.Templates.Extensions; | ||
using System.Threading.Tasks; | ||
|
||
namespace Tests.Adapters.Engine.Bugs | ||
{ | ||
public class BugUnexpectedTypeTests : TestBase | ||
{ | ||
[Test] | ||
public async Task Can_Resolve_NonNull_Null_Query() | ||
=> await Can_Resolve_Query_Private<NonNull_Null_Query>(); | ||
|
||
[Test] | ||
public async Task Can_Resolve_Null_NonNull_Query() | ||
=> await Can_Resolve_Query_Private<Null_NonNull_Query>(); | ||
|
||
private async Task Can_Resolve_Query_Private<TQuery>() | ||
{ | ||
var engine = GraphQLEngine | ||
.New<TQuery>(); | ||
var result = await engine | ||
.NewExecutor() | ||
.WithQueryString("query { node { ... on ParentNode { id, nested { id } } } }") | ||
.Execute(); | ||
result.ShouldHaveNoErrors(); | ||
result.Data.ShouldHaveFieldWithValue("node", "id", "UGFyZW50Tm9kZTox"); | ||
result.Data.ShouldHaveFieldWithValue("node", "nested", "id", "Q2hpbGROb2RlOjE="); | ||
} | ||
|
||
public class NonNull_Null_Query | ||
{ | ||
public INode Node() => new ParentNode(); | ||
public NonNull<ParentNode> A() => null; | ||
public ParentNode B() => null; | ||
} | ||
|
||
public class Null_NonNull_Query | ||
{ | ||
public INode Node() => new ParentNode(); | ||
public ParentNode A() => null; | ||
public NonNull<ParentNode> B() => null; | ||
} | ||
public class ChildNode : INode | ||
{ | ||
public Id Id => Id.New<ChildNode>(1); | ||
} | ||
public class ParentNode : INode | ||
{ | ||
public Id Id => Id.New<ParentNode>(1); | ||
public ChildNode Nested() => new ChildNode(); | ||
} | ||
} | ||
} |