-
-
Notifications
You must be signed in to change notification settings - Fork 749
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimized Resolver Composition (#6542)
- Loading branch information
1 parent
e1c6c79
commit 19ed59d
Showing
73 changed files
with
372 additions
and
512 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
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
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
17 changes: 17 additions & 0 deletions
17
src/HotChocolate/Fusion/test/Composition.Tests/ResolverCompositionTests.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,17 @@ | ||
using ChilliCream.Testing; | ||
using Xunit.Abstractions; | ||
|
||
namespace HotChocolate.Fusion.Composition; | ||
|
||
public class ResolverCompositionTests(ITestOutputHelper output) : CompositionTestBase(output) | ||
{ | ||
[Fact] | ||
public async Task Ensure_Node_Resolver_Only_Picked_If_Needed() | ||
=> await Succeed(FileResource.Open("test1.graphql")); | ||
|
||
[Fact] | ||
public async Task Merge_Meta_Data_Correctly() | ||
=> await Succeed( | ||
FileResource.Open("test1.graphql"), | ||
new[] { FileResource.Open("test1.extensions.graphql") }); | ||
} |
3 changes: 3 additions & 0 deletions
3
src/HotChocolate/Fusion/test/Composition.Tests/__resources__/test1.extensions.graphql
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,3 @@ | ||
extend type Query { | ||
userByUsername(username: String! @is(field: "name")): User | ||
} |
38 changes: 38 additions & 0 deletions
38
src/HotChocolate/Fusion/test/Composition.Tests/__resources__/test1.graphql
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,38 @@ | ||
interface Node { | ||
id: ID! | ||
} | ||
|
||
type PageInfo { | ||
hasNextPage: Boolean! | ||
hasPreviousPage: Boolean! | ||
startCursor: String | ||
endCursor: String | ||
} | ||
|
||
type Query { | ||
node(id: ID!): Node | ||
nodes(ids: [ID!]!): [Node]! | ||
userById(id: ID!): User | ||
userByUsername(username: String!): User | ||
users(first: Int, after: String, last: Int, before: String): UsersConnection | ||
} | ||
|
||
type User implements Node { | ||
id: ID! | ||
name: String! | ||
birthdate: String! | ||
username: String! | ||
} | ||
|
||
type UsersConnection { | ||
pageInfo: PageInfo! | ||
edges: [UsersEdge!] | ||
nodes: [User!] | ||
} | ||
|
||
type UsersEdge { | ||
cursor: String! | ||
node: User! | ||
} | ||
|
||
scalar DateTime |
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
Oops, something went wrong.