-
-
Notifications
You must be signed in to change notification settings - Fork 756
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
Showing
62 changed files
with
697 additions
and
414 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
18 changes: 18 additions & 0 deletions
18
...Chocolate/Fusion-vnext/src/Fusion.Composition/Properties/CompositionResources.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
35 changes: 35 additions & 0 deletions
35
src/HotChocolate/Fusion-vnext/src/Fusion.Composition/SourceSchemaParser.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,35 @@ | ||
using System.Collections.Immutable; | ||
using HotChocolate.Fusion.Comparers; | ||
using HotChocolate.Fusion.Errors; | ||
using HotChocolate.Fusion.Logging; | ||
using HotChocolate.Fusion.Logging.Contracts; | ||
using HotChocolate.Fusion.Results; | ||
using HotChocolate.Skimmed; | ||
using HotChocolate.Skimmed.Serialization; | ||
|
||
namespace HotChocolate.Fusion; | ||
|
||
internal sealed class SourceSchemaParser(IEnumerable<string> sourceSchemas, ICompositionLog log) | ||
{ | ||
public CompositionResult<ImmutableSortedSet<SchemaDefinition>> Parse() | ||
{ | ||
var sortedSetBuilder = ImmutableSortedSet.CreateBuilder(new SchemaByNameComparer()); | ||
|
||
foreach (var sourceSchema in sourceSchemas) | ||
{ | ||
try | ||
{ | ||
sortedSetBuilder.Add(SchemaParser.Parse(sourceSchema)); | ||
} | ||
catch (Exception ex) | ||
{ | ||
log.Write(LogEntryHelper.InvalidGraphQL(ex.Message)); | ||
break; | ||
} | ||
} | ||
|
||
return log.HasErrors | ||
? ErrorHelper.SourceSchemaParsingFailed() | ||
: sortedSetBuilder.ToImmutable(); | ||
} | ||
} |
Oops, something went wrong.