-
-
Notifications
You must be signed in to change notification settings - Fork 722
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable nested variables in stiching (#1746)
- Loading branch information
1 parent
f7dc50c
commit 257fb51
Showing
23 changed files
with
174 additions
and
15 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
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
13 changes: 13 additions & 0 deletions
13
src/Stitching/Stitching.Tests/Schemas/Customers/ComplexInput.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,13 @@ | ||
namespace HotChocolate.Stitching.Schemas.Customers | ||
{ | ||
public class ComplexInput | ||
{ | ||
public string Value { get; set; } | ||
|
||
public ComplexInput Deeper { get; set; } | ||
|
||
public string[] ValueArray { get; set; } | ||
|
||
public ComplexInput[] DeeperArray { get; set; } | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/Stitching/Stitching.Tests/Schemas/Customers/ComplexInputType.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,18 @@ | ||
using System.Linq; | ||
using HotChocolate.Types; | ||
using HotChocolate.Types.Relay; | ||
|
||
namespace HotChocolate.Stitching.Schemas.Customers | ||
{ | ||
public class ComplexInputType | ||
: InputObjectType<ComplexInput> | ||
{ | ||
protected override void Configure( | ||
IInputObjectTypeDescriptor<ComplexInput> descriptor) | ||
{ | ||
descriptor.Name("ComplexInputType"); | ||
descriptor.Field(t => t.Value).Type<StringType>(); | ||
descriptor.Field(t => t.Deeper).Type<ComplexInputType>(); | ||
} | ||
} | ||
} |
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
3 changes: 2 additions & 1 deletion
3
...ntaxRewriterTests.ExtractField_Stitching.graphql_StitchingQueryWithVariables.graphql.snap
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
20 changes: 19 additions & 1 deletion
20
src/Stitching/Stitching.Tests/__resources__/StitchingQueryWithVariables.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
4 changes: 2 additions & 2 deletions
4
src/Stitching/Stitching.Tests/__snapshots__/StitchingBuilderTests.AddExtensionsFromFile.snap
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
[ | ||
[ | ||
"type Query {\n contract(contractId: ID!): Contract\n contracts(customerId: ID!): [Contract!]\n}\n\ninterface Contract {\n id: ID!\n}\n\ntype LifeInsuranceContract implements Contract {\n id: ID!\n premium: Float\n}\n\ntype SomeOtherContract implements Contract {\n id: ID!\n expiryDate: DateTime\n}", | ||
"type Query {\n customer(id: ID!): Customer\n consultant(id: ID!): Consultant\n customerOrConsultant(id: ID!): CustomerOrConsultant\n}\n\ntype Customer {\n id: ID!\n name: String!\n consultant: Consultant\n}\n\ntype Consultant {\n id: ID!\n name: String!\n}\n\nunion CustomerOrConsultant = Customer | Consultant" | ||
"type Query {\n customer(id: ID!): Customer\n consultant(id: ID!): Consultant\n customerOrConsultant(id: ID!): CustomerOrConsultant\n}\n\ntype Customer {\n id: ID!\n name: String!\n consultant: Consultant\n complexArg(arg: ComplexInputType): String\n}\n\ntype Consultant {\n id: ID!\n name: String!\n}\n\nunion CustomerOrConsultant = Customer | Consultant\n\ninput ComplexInputType {\n deeper: ComplexInputType\n deeperArray: [ComplexInputType]\n value: String\n valueArray: [String]\n}" | ||
] |
4 changes: 2 additions & 2 deletions
4
...titching/Stitching.Tests/__snapshots__/StitchingBuilderTests.AddExtensionsFromString.snap
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
[ | ||
[ | ||
"type Query {\n contract(contractId: ID!): Contract\n contracts(customerId: ID!): [Contract!]\n}\n\ninterface Contract {\n id: ID!\n}\n\ntype LifeInsuranceContract implements Contract {\n id: ID!\n premium: Float\n}\n\ntype SomeOtherContract implements Contract {\n id: ID!\n expiryDate: DateTime\n}", | ||
"type Query {\n customer(id: ID!): Customer\n consultant(id: ID!): Consultant\n customerOrConsultant(id: ID!): CustomerOrConsultant\n}\n\ntype Customer {\n id: ID!\n name: String!\n consultant: Consultant\n}\n\ntype Consultant {\n id: ID!\n name: String!\n}\n\nunion CustomerOrConsultant = Customer | Consultant" | ||
"type Query {\n customer(id: ID!): Customer\n consultant(id: ID!): Consultant\n customerOrConsultant(id: ID!): CustomerOrConsultant\n}\n\ntype Customer {\n id: ID!\n name: String!\n consultant: Consultant\n complexArg(arg: ComplexInputType): String\n}\n\ntype Consultant {\n id: ID!\n name: String!\n}\n\nunion CustomerOrConsultant = Customer | Consultant\n\ninput ComplexInputType {\n deeper: ComplexInputType\n deeperArray: [ComplexInputType]\n value: String\n valueArray: [String]\n}" | ||
] |
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
Oops, something went wrong.