Skip to content

Commit

Permalink
Merge 68dee70 into 393bb84
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelstaib committed Feb 25, 2019
2 parents 393bb84 + 68dee70 commit de68110
Show file tree
Hide file tree
Showing 8 changed files with 560 additions and 23 deletions.
22 changes: 22 additions & 0 deletions src/Stitching/Stitching.Tests/Merge/SchemaMergerTests.cs
Expand Up @@ -4,6 +4,7 @@
using HotChocolate.Language;
using HotChocolate.Resolvers;
using Snapshooter;
using HotChocolate.Stitching.Introspection;

namespace HotChocolate.Stitching.Merge
{
Expand Down Expand Up @@ -307,5 +308,26 @@ public void RenameReferencingType()
SnapshotNameExtension.Create("B"));

}

[Fact]
public void FieldDefinitionDoesNotHaveSameTypeShape()
{
// arrange
DocumentNode schema_a =
Parser.Default.Parse(
"type A { b1: String b2: String } type B { c: String! }");
DocumentNode schema_b =
Parser.Default.Parse(
"type A { b1: String b3: String } type B { c: String }");

// act
DocumentNode merged = SchemaMerger.New()
.AddSchema("A", schema_a)
.AddSchema("B", schema_b)
.Merge();

// assert
SchemaSyntaxSerializer.Serialize(merged).MatchSnapshot();
}
}
}
@@ -0,0 +1,17 @@
type A @source(name: "A", schema: "A") {
b1: String
b2: String
}

type B_A @source(name: "A", schema: "B") {
b1: String
b3: String
}

type B @source(name: "B", schema: "A") {
c: String!
}

type B_B @source(name: "B", schema: "B") {
c: String
}

0 comments on commit de68110

Please sign in to comment.