diff --git a/.editorconfig b/.editorconfig index b8bc2f73c..5ced2cd30 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,5 +1,327 @@ root = true +############################### +# Core EditorConfig Options # +############################### + +[*] +indent_style = space +indent_size = 4 +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.{xml,csproj,props,targets,slnx,json,yml,yaml}] +indent_size = 2 + +[*.md] +trim_trailing_whitespace = false + +############################### +# .NET / C# Code Style # +############################### + [*.cs] + +#### Organize usings #### +dotnet_sort_system_directives_first = true +dotnet_separate_import_directive_groups = false + +#### this. and Me. preferences #### +dotnet_style_qualification_for_field = false:warning +dotnet_style_qualification_for_property = false:warning +dotnet_style_qualification_for_method = false:warning +dotnet_style_qualification_for_event = false:warning + +#### Language keywords vs BCL types preferences #### +dotnet_style_predefined_type_for_locals_parameters_members = true:warning +dotnet_style_predefined_type_for_member_access = true:warning + +#### Parentheses preferences #### +dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent +dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent +dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent +dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent + +#### Modifier preferences #### +dotnet_style_require_accessibility_modifiers = for_non_interface_members:warning + +#### Expression-level preferences #### +dotnet_style_object_initializer = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_explicit_tuple_names = true:warning +dotnet_style_prefer_inferred_tuple_names = true:suggestion +dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion +dotnet_style_prefer_auto_properties = true:suggestion +dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion +dotnet_style_prefer_conditional_expression_over_return = true:suggestion +dotnet_style_prefer_compound_assignment = true:suggestion +dotnet_style_prefer_simplified_interpolation = true:suggestion +dotnet_style_prefer_simplified_boolean_expressions = true:suggestion + +#### Null-checking preferences #### +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_null_propagation = true:suggestion +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning + +#### File header #### +file_header_template = Copyright (c) GraphZen LLC. All rights reserved.\nLicensed under the GraphZen Community License. See the LICENSE file in the project root for license information. + +############################### +# C# Code Style Rules # +############################### + +#### var preferences #### +csharp_style_var_for_built_in_types = true:suggestion +csharp_style_var_when_type_is_apparent = true:suggestion +csharp_style_var_elsewhere = true:suggestion + +#### Expression-bodied members #### +csharp_style_expression_bodied_methods = true:suggestion +csharp_style_expression_bodied_constructors = true:suggestion +csharp_style_expression_bodied_operators = true:suggestion +csharp_style_expression_bodied_properties = true:suggestion +csharp_style_expression_bodied_indexers = true:suggestion +csharp_style_expression_bodied_accessors = true:suggestion +csharp_style_expression_bodied_lambdas = true:silent +csharp_style_expression_bodied_local_functions = true:suggestion + +#### Pattern matching preferences #### +csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion +csharp_style_pattern_matching_over_as_with_null_check = true:suggestion +csharp_style_prefer_switch_expression = true:suggestion +csharp_style_prefer_pattern_matching = true:suggestion +csharp_style_prefer_not_pattern = true:suggestion + +#### Null-checking preferences #### +csharp_style_throw_expression = true:suggestion +csharp_style_conditional_delegate_call = true:suggestion + +#### Modifier preferences #### +csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async:warning + +#### Code-block preferences #### +csharp_prefer_braces = true:warning +csharp_prefer_simple_using_statement = true:suggestion +csharp_style_namespace_declarations = file_scoped:warning + +#### Expression-level preferences #### +csharp_prefer_simple_default_expression = true:suggestion +csharp_style_prefer_local_over_anonymous_function = true:suggestion +csharp_style_prefer_index_operator = true:suggestion +csharp_style_prefer_range_operator = true:suggestion +csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion +csharp_style_prefer_tuple_swap = true:suggestion +csharp_style_prefer_utf8_string_literals = true:suggestion +csharp_style_deconstructed_variable_declaration = true:suggestion +csharp_style_inlined_variable_declaration = true:suggestion +csharp_style_unused_value_assignment_preference = discard_variable:suggestion +csharp_style_unused_value_expression_statement_preference = discard_variable:silent +csharp_using_directive_placement = outside_namespace:warning + +############################### +# C# Formatting Rules # +############################### + +#### New line preferences #### +csharp_new_line_before_open_brace = all +csharp_new_line_before_else = true +csharp_new_line_before_catch = true +csharp_new_line_before_finally = true +csharp_new_line_before_members_in_object_initializers = true +csharp_new_line_before_members_in_anonymous_types = true +csharp_new_line_between_query_expression_clauses = true + +#### Indentation preferences #### +csharp_indent_case_contents = true +csharp_indent_switch_labels = true +csharp_indent_labels = one_less_than_current +csharp_indent_block_contents = true +csharp_indent_braces = false +csharp_indent_case_contents_when_block = true + +#### Space preferences #### +csharp_space_after_cast = false +csharp_space_after_keywords_in_control_flow_statements = true +csharp_space_between_parentheses = false +csharp_space_before_colon_in_inheritance_clause = true +csharp_space_after_colon_in_inheritance_clause = true +csharp_space_around_binary_operators = before_and_after +csharp_space_between_method_declaration_parameter_list_parentheses = false +csharp_space_between_method_declaration_empty_parameter_list_parentheses = false +csharp_space_between_method_declaration_name_and_open_parenthesis = false +csharp_space_between_method_call_parameter_list_parentheses = false +csharp_space_between_method_call_empty_parameter_list_parentheses = false +csharp_space_between_method_call_name_and_opening_parenthesis = false +csharp_space_after_comma = true +csharp_space_before_comma = false +csharp_space_after_dot = false +csharp_space_before_dot = false +csharp_space_after_semicolon_in_for_statement = true +csharp_space_before_semicolon_in_for_statement = false +csharp_space_around_declaration_statements = false +csharp_space_before_open_square_brackets = false +csharp_space_between_empty_square_brackets = false +csharp_space_between_square_brackets = false + +#### Wrapping preferences #### +csharp_preserve_single_line_statements = false +csharp_preserve_single_line_blocks = true + +############################### +# Naming Conventions # +############################### + +#### Naming styles #### +dotnet_naming_style.pascal_case_style.capitalization = pascal_case + +dotnet_naming_style.camel_case_style.capitalization = camel_case + +dotnet_naming_style.underscore_camel_case_style.capitalization = camel_case +dotnet_naming_style.underscore_camel_case_style.required_prefix = _ + +dotnet_naming_style.interface_style.capitalization = pascal_case +dotnet_naming_style.interface_style.required_prefix = I + +dotnet_naming_style.type_parameter_style.capitalization = pascal_case +dotnet_naming_style.type_parameter_style.required_prefix = T + +#### Naming symbols #### +dotnet_naming_symbols.interface_symbols.applicable_kinds = interface +dotnet_naming_symbols.interface_symbols.applicable_accessibilities = * + +dotnet_naming_symbols.type_parameter_symbols.applicable_kinds = type_parameter +dotnet_naming_symbols.type_parameter_symbols.applicable_accessibilities = * + +dotnet_naming_symbols.type_symbols.applicable_kinds = class, struct, enum, delegate +dotnet_naming_symbols.type_symbols.applicable_accessibilities = * + +dotnet_naming_symbols.method_symbols.applicable_kinds = method +dotnet_naming_symbols.method_symbols.applicable_accessibilities = * + +dotnet_naming_symbols.property_symbols.applicable_kinds = property, event +dotnet_naming_symbols.property_symbols.applicable_accessibilities = * + +dotnet_naming_symbols.public_field_symbols.applicable_kinds = field +dotnet_naming_symbols.public_field_symbols.applicable_accessibilities = public, internal, protected, protected_internal + +dotnet_naming_symbols.private_field_symbols.applicable_kinds = field +dotnet_naming_symbols.private_field_symbols.applicable_accessibilities = private, private_protected + +dotnet_naming_symbols.private_static_readonly_field_symbols.applicable_kinds = field +dotnet_naming_symbols.private_static_readonly_field_symbols.applicable_accessibilities = private, private_protected +dotnet_naming_symbols.private_static_readonly_field_symbols.required_modifiers = static, readonly + +dotnet_naming_symbols.private_static_field_symbols.applicable_kinds = field +dotnet_naming_symbols.private_static_field_symbols.applicable_accessibilities = private, private_protected +dotnet_naming_symbols.private_static_field_symbols.required_modifiers = static + +dotnet_naming_symbols.local_symbols.applicable_kinds = local, parameter +dotnet_naming_symbols.local_symbols.applicable_accessibilities = * + +dotnet_naming_symbols.local_function_symbols.applicable_kinds = local_function +dotnet_naming_symbols.local_function_symbols.applicable_accessibilities = * + +dotnet_naming_symbols.const_field_symbols.applicable_kinds = field +dotnet_naming_symbols.const_field_symbols.applicable_accessibilities = * +dotnet_naming_symbols.const_field_symbols.required_modifiers = const + +dotnet_naming_symbols.namespace_symbols.applicable_kinds = namespace +dotnet_naming_symbols.namespace_symbols.applicable_accessibilities = * + +#### Naming rules #### +dotnet_naming_rule.interfaces_must_be_prefixed.severity = warning +dotnet_naming_rule.interfaces_must_be_prefixed.symbols = interface_symbols +dotnet_naming_rule.interfaces_must_be_prefixed.style = interface_style + +dotnet_naming_rule.type_parameters_must_be_prefixed.severity = warning +dotnet_naming_rule.type_parameters_must_be_prefixed.symbols = type_parameter_symbols +dotnet_naming_rule.type_parameters_must_be_prefixed.style = type_parameter_style + +dotnet_naming_rule.types_must_be_pascal_case.severity = warning +dotnet_naming_rule.types_must_be_pascal_case.symbols = type_symbols +dotnet_naming_rule.types_must_be_pascal_case.style = pascal_case_style + +dotnet_naming_rule.methods_must_be_pascal_case.severity = warning +dotnet_naming_rule.methods_must_be_pascal_case.symbols = method_symbols +dotnet_naming_rule.methods_must_be_pascal_case.style = pascal_case_style + +dotnet_naming_rule.properties_must_be_pascal_case.severity = warning +dotnet_naming_rule.properties_must_be_pascal_case.symbols = property_symbols +dotnet_naming_rule.properties_must_be_pascal_case.style = pascal_case_style + +dotnet_naming_rule.const_fields_must_be_pascal_case.severity = warning +dotnet_naming_rule.const_fields_must_be_pascal_case.symbols = const_field_symbols +dotnet_naming_rule.const_fields_must_be_pascal_case.style = pascal_case_style + +dotnet_naming_rule.public_fields_must_be_pascal_case.severity = warning +dotnet_naming_rule.public_fields_must_be_pascal_case.symbols = public_field_symbols +dotnet_naming_rule.public_fields_must_be_pascal_case.style = pascal_case_style + +dotnet_naming_rule.private_static_readonly_fields_must_be_pascal.severity = warning +dotnet_naming_rule.private_static_readonly_fields_must_be_pascal.symbols = private_static_readonly_field_symbols +dotnet_naming_rule.private_static_readonly_fields_must_be_pascal.style = pascal_case_style + +dotnet_naming_rule.private_static_fields_must_be_underscore_camel.severity = warning +dotnet_naming_rule.private_static_fields_must_be_underscore_camel.symbols = private_static_field_symbols +dotnet_naming_rule.private_static_fields_must_be_underscore_camel.style = underscore_camel_case_style + +dotnet_naming_rule.private_fields_must_be_underscore_camel.severity = warning +dotnet_naming_rule.private_fields_must_be_underscore_camel.symbols = private_field_symbols +dotnet_naming_rule.private_fields_must_be_underscore_camel.style = underscore_camel_case_style + +dotnet_naming_rule.locals_must_be_camel_case.severity = warning +dotnet_naming_rule.locals_must_be_camel_case.symbols = local_symbols +dotnet_naming_rule.locals_must_be_camel_case.style = camel_case_style + +dotnet_naming_rule.local_functions_must_be_pascal_case.severity = warning +dotnet_naming_rule.local_functions_must_be_pascal_case.symbols = local_function_symbols +dotnet_naming_rule.local_functions_must_be_pascal_case.style = pascal_case_style + +dotnet_naming_rule.namespaces_must_be_pascal_case.severity = warning +dotnet_naming_rule.namespaces_must_be_pascal_case.symbols = namespace_symbols +dotnet_naming_rule.namespaces_must_be_pascal_case.style = pascal_case_style + +############################### +# Analyzer Severities # +############################### + # IDE0005: Remove unnecessary using directives dotnet_diagnostic.IDE0005.severity = warning + +# IDE0011: Add braces +dotnet_diagnostic.IDE0011.severity = warning + +# IDE0160/IDE0161: Namespace declaration preferences +dotnet_diagnostic.IDE0161.severity = warning + +# IDE0065: Using directive placement +dotnet_diagnostic.IDE0065.severity = warning + +# IDE0003/IDE0009: this. and Me. preferences +dotnet_diagnostic.IDE0003.severity = warning +dotnet_diagnostic.IDE0009.severity = warning + +############################### +# ReSharper Properties # +############################### + +# Trailing comma in multiline lists +resharper_trailing_comma_in_multiline_lists = true + +# Braces for control flow +resharper_braces_for_for = required +resharper_braces_for_foreach = required +resharper_braces_for_while = required + +# Abbreviation overrides (allow AST, QL as valid naming) +resharper_abbreviations = AST QL + +############################### +# Test Projects # +############################### + +[test/**/*.cs] + +# Disable naming rules for test projects (tests commonly use snake_case for methods, classes, and fields) +dotnet_diagnostic.IDE1006.severity = none diff --git a/.gitattributes b/.gitattributes index 176a458f9..550914a99 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,4 @@ * text=auto + +*.cs text diff=csharp +*.sh text eol=lf diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2d8af93b9..ca19508e6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,6 +29,9 @@ jobs: - name: Build run: dotnet build --no-restore --configuration Release + - name: Check formatting + run: dotnet format --verify-no-changes --verbosity diagnostic + - name: Test run: dotnet test --no-build --configuration Release --logger "trx;LogFileName=test-results.trx" --collect:"XPlat Code Coverage" --results-directory ./test-results diff --git a/Directory.Build.props b/Directory.Build.props index dc1fddb04..5b32da1f5 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -6,6 +6,9 @@ true latest enable + true + true + $(NoWarn);CS1591;CS1587 diff --git a/GraphZen.slnx.DotSettings b/GraphZen.slnx.DotSettings index 39cc135d1..961182d99 100644 --- a/GraphZen.slnx.DotSettings +++ b/GraphZen.slnx.DotSettings @@ -1,20 +1,29 @@ - - + + + True - True True True - - -Latest + + + Latest + + ExplicitlyExcluded ExplicitlyExcluded + + True *.Generated_ignore.cs + + SOLUTION True + True + + SUGGESTION SUGGESTION SUGGESTION @@ -33,83 +42,26 @@ SUGGESTION SUGGESTION SUGGESTION - True + + <?xml version="1.0" encoding="utf-16"?><Profile name="GraphZen: Full Cleanup"><XMLReformatCode>True</XMLReformatCode><CppAddOverrideSpecifier>True</CppAddOverrideSpecifier><CppAddTypenameTemplateKeywords>True</CppAddTypenameTemplateKeywords><CppReplaceImportDirective>True</CppReplaceImportDirective><CppRemoveElseKeyword>True</CppRemoveElseKeyword><CppShortenQualifiedName>True</CppShortenQualifiedName><CppDeleteRedundantSpecifier>True</CppDeleteRedundantSpecifier><CppRemoveStatement>True</CppRemoveStatement><CppDeleteRedundantTypenameTemplateKeywords>True</CppDeleteRedundantTypenameTemplateKeywords><CppCStyleToStaticCastDescriptor>True</CppCStyleToStaticCastDescriptor><CppReplaceExpressionWithBooleanConst>True</CppReplaceExpressionWithBooleanConst><CppMakeIfConstexpr>True</CppMakeIfConstexpr><CppMakePostfixOperatorPrefix>True</CppMakePostfixOperatorPrefix><CppChangeSmartPointerToMakeFunction>True</CppChangeSmartPointerToMakeFunction><CppReplaceThrowWithRethrowFix>True</CppReplaceThrowWithRethrowFix><CppReplaceExpressionWithNullptr>True</CppReplaceExpressionWithNullptr><CppSortMemberInitializers>True</CppSortMemberInitializers><CppClangTidyCleanupDescriptor /><CppReformatCode>True</CppReformatCode><CSCodeStyleAttributes ArrangeTypeAccessModifier="True" ArrangeTypeMemberAccessModifier="True" SortModifiers="True" RemoveRedundantParentheses="True" AddMissingParentheses="True" ArrangeBraces="True" ArrangeAttributes="True" ArrangeArgumentsStyle="True" ArrangeCodeBodyStyle="True" ArrangeVarStyle="True" /><RemoveCodeRedundanciesVB>True</RemoveCodeRedundanciesVB><CssAlphabetizeProperties>True</CssAlphabetizeProperties><JsInsertSemicolon>True</JsInsertSemicolon><FormatAttributeQuoteDescriptor>True</FormatAttributeQuoteDescriptor><CorrectVariableKindsDescriptor>True</CorrectVariableKindsDescriptor><VariablesToInnerScopesDescriptor>True</VariablesToInnerScopesDescriptor><StringToTemplatesDescriptor>True</StringToTemplatesDescriptor><JsReformatCode>True</JsReformatCode><JsFormatDocComments>True</JsFormatDocComments><RemoveRedundantQualifiersTs>True</RemoveRedundantQualifiersTs><OptimizeImportsTs>True</OptimizeImportsTs><OptimizeReferenceCommentsTs>True</OptimizeReferenceCommentsTs><PublicModifierStyleTs>True</PublicModifierStyleTs><ExplicitAnyTs>True</ExplicitAnyTs><TypeAnnotationStyleTs>True</TypeAnnotationStyleTs><RelativePathStyleTs>True</RelativePathStyleTs><AsInsteadOfCastTs>True</AsInsteadOfCastTs><HtmlReformatCode>True</HtmlReformatCode><AspOptimizeRegisterDirectives>True</AspOptimizeRegisterDirectives><VBOptimizeImports>True</VBOptimizeImports><VBShortenReferences>True</VBShortenReferences><RemoveCodeRedundancies>True</RemoveCodeRedundancies><CSUseAutoProperty>True</CSUseAutoProperty><CSMakeFieldReadonly>True</CSMakeFieldReadonly><CSMakeAutoPropertyGetOnly>True</CSMakeAutoPropertyGetOnly><CSArrangeQualifiers>True</CSArrangeQualifiers><CSFixBuiltinTypeReferences>True</CSFixBuiltinTypeReferences><CssReformatCode>True</CssReformatCode><VBReformatCode>True</VBReformatCode><VBFormatDocComments>True</VBFormatDocComments><CSOptimizeUsings><OptimizeUsings>True</OptimizeUsings><EmbraceInRegion>False</EmbraceInRegion><RegionName></RegionName></CSOptimizeUsings><CSShortenReferences>True</CSShortenReferences><CSReformatCode>True</CSReformatCode><CSharpFormatDocComments>True</CSharpFormatDocComments><CSUpdateFileHeader>True</CSUpdateFileHeader><XAMLCollapseEmptyTags>False</XAMLCollapseEmptyTags></Profile> GraphZen: Full Cleanup - Required - Required - Required - ExpressionBody - ExpressionBody - ExpressionBody - ExpressionBody - FileScoped - True + + GraphZen.Infrastructure JetBrains.Annotations System.Diagnostics.CodeAnalysis + + Copyright (c) GraphZen LLC. All rights reserved. Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. - AST - QL - <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> - <Policy Inspect="True" Prefix="I" Suffix="" Style="AaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> - <Policy Inspect="True" Prefix="T" Suffix="" Style="AaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> - <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> - DO_NOTHING - LIVE_MONITOR - LIVE_MONITOR - DO_NOTHING - LIVE_MONITOR - LIVE_MONITOR - LIVE_MONITOR - LIVE_MONITOR - LIVE_MONITOR - LIVE_MONITOR - LIVE_MONITOR - LIVE_MONITOR - DO_NOTHING - LIVE_MONITOR + + True + + True True True True - True \ No newline at end of file + True \ No newline at end of file diff --git a/examples/SimpleBlog/FakeBlogData.cs b/examples/SimpleBlog/FakeBlogData.cs index 76ff8f72f..ae08d29e2 100644 --- a/examples/SimpleBlog/FakeBlogData.cs +++ b/examples/SimpleBlog/FakeBlogData.cs @@ -1,9 +1,6 @@ -// Copyright (c) GraphZen LLC. All rights reserved. +// Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using System.Diagnostics.CodeAnalysis; -using GraphZen.Infrastructure; -using JetBrains.Annotations; using SimpleBlog.Models; namespace SimpleBlog; @@ -30,4 +27,4 @@ public static class FakeBlogData new Comment { Id = 2, PostId = 1, Author = "Syed", Content = "Have you thought about doing a podcast?" }, new Comment { Id = 3, PostId = 2, Author = "Gene", Content = "This was a fun blog post." } }; -} \ No newline at end of file +} diff --git a/examples/SimpleBlog/Models/Comment.cs b/examples/SimpleBlog/Models/Comment.cs index c60c9bf44..aea14b295 100644 --- a/examples/SimpleBlog/Models/Comment.cs +++ b/examples/SimpleBlog/Models/Comment.cs @@ -1,10 +1,6 @@ -// Copyright (c) GraphZen LLC. All rights reserved. +// Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using System.Diagnostics.CodeAnalysis; -using GraphZen.Infrastructure; -using JetBrains.Annotations; - namespace SimpleBlog.Models; public class Comment @@ -13,4 +9,4 @@ public class Comment public int PostId { get; set; } public required string Author { get; set; } public required string Content { get; set; } -} \ No newline at end of file +} diff --git a/examples/SimpleBlog/Models/Mutation.cs b/examples/SimpleBlog/Models/Mutation.cs index 1e3e3dc27..a5827935b 100644 --- a/examples/SimpleBlog/Models/Mutation.cs +++ b/examples/SimpleBlog/Models/Mutation.cs @@ -1,10 +1,7 @@ -// Copyright (c) GraphZen LLC. All rights reserved. +// Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using GraphZen.Infrastructure; -using JetBrains.Annotations; namespace SimpleBlog.Models; @@ -44,7 +41,10 @@ public bool Comment(int postId, string author, string comment) public bool DeleteComment(int id) { var commentModel = FakeBlogData.Comments.SingleOrDefault(_ => _.Id == id); - if (commentModel != null) FakeBlogData.Comments.Remove(commentModel); + if (commentModel != null) + { + FakeBlogData.Comments.Remove(commentModel); + } return true; } @@ -52,11 +52,14 @@ public bool DeleteComment(int id) public bool EditPost(int id, string author, string title, string post) { var postModel = FakeBlogData.Posts.SingleOrDefault(_ => _.Id == id); - if (postModel == null) return false; + if (postModel == null) + { + return false; + } postModel.Author = author; postModel.Title = title; postModel.Content = post; return true; } -} \ No newline at end of file +} diff --git a/examples/SimpleBlog/Models/Post.cs b/examples/SimpleBlog/Models/Post.cs index ae7fd47a8..88d4c2caf 100644 --- a/examples/SimpleBlog/Models/Post.cs +++ b/examples/SimpleBlog/Models/Post.cs @@ -1,10 +1,7 @@ -// Copyright (c) GraphZen LLC. All rights reserved. +// Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using GraphZen.Infrastructure; -using JetBrains.Annotations; namespace SimpleBlog.Models; @@ -17,4 +14,4 @@ public class Post public required string Author { get; set; } public required string Content { get; set; } -} \ No newline at end of file +} diff --git a/examples/SimpleBlog/Models/Query.cs b/examples/SimpleBlog/Models/Query.cs index 5267f7336..03ce6f9f9 100644 --- a/examples/SimpleBlog/Models/Query.cs +++ b/examples/SimpleBlog/Models/Query.cs @@ -1,10 +1,7 @@ -// Copyright (c) GraphZen LLC. All rights reserved. +// Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using GraphZen.Infrastructure; -using JetBrains.Annotations; namespace SimpleBlog.Models; @@ -13,8 +10,11 @@ public class Query [Description("Get the latests blog posts")] public List Posts(int? postId) { - if (postId != null) return FakeBlogData.Posts.Where(_ => _.Id == postId.Value).ToList(); + if (postId != null) + { + return FakeBlogData.Posts.Where(_ => _.Id == postId.Value).ToList(); + } return FakeBlogData.Posts; } -} \ No newline at end of file +} diff --git a/examples/SimpleBlog/Program.cs b/examples/SimpleBlog/Program.cs index d9e5f828e..1de2b57cf 100644 --- a/examples/SimpleBlog/Program.cs +++ b/examples/SimpleBlog/Program.cs @@ -1,9 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using System.Diagnostics.CodeAnalysis; -using GraphZen.Infrastructure; -using JetBrains.Annotations; using Serilog; using Serilog.Events; @@ -43,4 +40,4 @@ public static int Main(string[] args) Log.CloseAndFlush(); } } -} \ No newline at end of file +} diff --git a/src/GraphZen.Abstractions/AssemblyAttributes.cs b/src/GraphZen.Abstractions/AssemblyAttributes.cs index e31583bd3..0cee824d3 100644 --- a/src/GraphZen.Abstractions/AssemblyAttributes.cs +++ b/src/GraphZen.Abstractions/AssemblyAttributes.cs @@ -2,7 +2,6 @@ // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. using System.Runtime.CompilerServices; -using GraphZen.Infrastructure; [assembly: InternalsVisibleTo("GraphZen")] [assembly: InternalsVisibleTo("GraphZen.Client")] @@ -36,4 +35,4 @@ [assembly: InternalsVisibleTo("GraphZen.TypeSystem")] [assembly: InternalsVisibleTo("GraphZen.TypeSystem.Tests")] [assembly: InternalsVisibleTo("GraphZen.TypeSystem.IntegrationTests")] -[assembly: InternalsVisibleTo("GraphZen.TypeSystem.FunctionalTests")] \ No newline at end of file +[assembly: InternalsVisibleTo("GraphZen.TypeSystem.FunctionalTests")] diff --git a/src/GraphZen.Abstractions/GraphQLCanBeNullAttribute.cs b/src/GraphZen.Abstractions/GraphQLCanBeNullAttribute.cs index 7f4441bf6..da0316be8 100644 --- a/src/GraphZen.Abstractions/GraphQLCanBeNullAttribute.cs +++ b/src/GraphZen.Abstractions/GraphQLCanBeNullAttribute.cs @@ -1,11 +1,9 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen; [AttributeUsage(AttributeTargets.Property | AttributeTargets.Method | AttributeTargets.Parameter)] public class GraphQLCanBeNullAttribute : Attribute { -} \ No newline at end of file +} diff --git a/src/GraphZen.Abstractions/GraphQLDeprecatedAttribute.cs b/src/GraphZen.Abstractions/GraphQLDeprecatedAttribute.cs index e40cd527d..d43e0139c 100644 --- a/src/GraphZen.Abstractions/GraphQLDeprecatedAttribute.cs +++ b/src/GraphZen.Abstractions/GraphQLDeprecatedAttribute.cs @@ -2,7 +2,6 @@ // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. using System.ComponentModel; -using GraphZen.Infrastructure; using GraphZen.LanguageModel; namespace GraphZen; @@ -39,9 +38,21 @@ public IEnumerable GetDirectiveLocations() public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; - if (ReferenceEquals(this, obj)) return true; - if (obj.GetType() != GetType()) return false; + if (obj is null) + { + return false; + } + + if (ReferenceEquals(this, obj)) + { + return true; + } + + if (obj.GetType() != GetType()) + { + return false; + } + return Equals((GraphQLDeprecatedAttribute)obj); } @@ -52,4 +63,4 @@ public override int GetHashCode() return (base.GetHashCode() * 397) ^ (Reason != null ? Reason.GetHashCode() : 0); } } -} \ No newline at end of file +} diff --git a/src/GraphZen.Abstractions/GraphQLIgnoreAttribute.cs b/src/GraphZen.Abstractions/GraphQLIgnoreAttribute.cs index e78dd32f4..b18e9fd9d 100644 --- a/src/GraphZen.Abstractions/GraphQLIgnoreAttribute.cs +++ b/src/GraphZen.Abstractions/GraphQLIgnoreAttribute.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen; [AttributeUsage(AttributeTargets.Property | AttributeTargets.Method | AttributeTargets.Class | @@ -10,4 +8,4 @@ namespace GraphZen; AttributeTargets.Field)] public class GraphQLIgnoreAttribute : Attribute { -} \ No newline at end of file +} diff --git a/src/GraphZen.Abstractions/GraphQLListItemCanBeNullAttribute.cs b/src/GraphZen.Abstractions/GraphQLListItemCanBeNullAttribute.cs index b207f67d1..fcd447644 100644 --- a/src/GraphZen.Abstractions/GraphQLListItemCanBeNullAttribute.cs +++ b/src/GraphZen.Abstractions/GraphQLListItemCanBeNullAttribute.cs @@ -1,11 +1,9 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen; [AttributeUsage(AttributeTargets.Property | AttributeTargets.Method | AttributeTargets.Parameter)] public class GraphQLListItemCanBeNullAttribute : Attribute { -} \ No newline at end of file +} diff --git a/src/GraphZen.Abstractions/GraphQLListItemNonNullAttribute.cs b/src/GraphZen.Abstractions/GraphQLListItemNonNullAttribute.cs index a534a1d03..8d7ee8d65 100644 --- a/src/GraphZen.Abstractions/GraphQLListItemNonNullAttribute.cs +++ b/src/GraphZen.Abstractions/GraphQLListItemNonNullAttribute.cs @@ -1,11 +1,9 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen; [AttributeUsage(AttributeTargets.Property)] public class GraphQLListItemNonNullAttribute : Attribute { -} \ No newline at end of file +} diff --git a/src/GraphZen.Abstractions/GraphQLNameAttribute.cs b/src/GraphZen.Abstractions/GraphQLNameAttribute.cs index 8e97f6a91..a6907bdb7 100644 --- a/src/GraphZen.Abstractions/GraphQLNameAttribute.cs +++ b/src/GraphZen.Abstractions/GraphQLNameAttribute.cs @@ -18,4 +18,4 @@ public class GraphQLNameAttribute : Attribute public string Name { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.Abstractions/GraphQLNonNullAttribute.cs b/src/GraphZen.Abstractions/GraphQLNonNullAttribute.cs index db62b5c66..6a46971f0 100644 --- a/src/GraphZen.Abstractions/GraphQLNonNullAttribute.cs +++ b/src/GraphZen.Abstractions/GraphQLNonNullAttribute.cs @@ -1,11 +1,9 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen; [AttributeUsage(AttributeTargets.Property)] public class GraphQLNonNullAttribute : Attribute { -} \ No newline at end of file +} diff --git a/src/GraphZen.Abstractions/GraphQLObjectAttribute.cs b/src/GraphZen.Abstractions/GraphQLObjectAttribute.cs index 1a6af60e6..4a6c61e8b 100644 --- a/src/GraphZen.Abstractions/GraphQLObjectAttribute.cs +++ b/src/GraphZen.Abstractions/GraphQLObjectAttribute.cs @@ -1,11 +1,9 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen; [AttributeUsage(AttributeTargets.Class)] public class GraphQLObjectAttribute : Attribute { -} \ No newline at end of file +} diff --git a/src/GraphZen.Abstractions/GraphQLTypeAttribute.cs b/src/GraphZen.Abstractions/GraphQLTypeAttribute.cs index 7f8e37588..0b521d85d 100644 --- a/src/GraphZen.Abstractions/GraphQLTypeAttribute.cs +++ b/src/GraphZen.Abstractions/GraphQLTypeAttribute.cs @@ -10,4 +10,4 @@ public class GraphQLTypeAttribute : Attribute public GraphQLTypeAttribute(Type clrType) => ClrType = Check.NotNull(clrType, nameof(clrType)); public Type ClrType { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.Abstractions/GraphQLUnionAttribute.cs b/src/GraphZen.Abstractions/GraphQLUnionAttribute.cs index 60ca142ec..4d7e4c310 100644 --- a/src/GraphZen.Abstractions/GraphQLUnionAttribute.cs +++ b/src/GraphZen.Abstractions/GraphQLUnionAttribute.cs @@ -1,11 +1,9 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen; [AttributeUsage(AttributeTargets.Interface)] public class GraphQLUnionAttribute : Attribute { -} \ No newline at end of file +} diff --git a/src/GraphZen.Abstractions/IGraphQLDirective.cs b/src/GraphZen.Abstractions/IGraphQLDirective.cs index b9d3dd2dc..aac2a7d6d 100644 --- a/src/GraphZen.Abstractions/IGraphQLDirective.cs +++ b/src/GraphZen.Abstractions/IGraphQLDirective.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel; namespace GraphZen; @@ -9,4 +8,4 @@ namespace GraphZen; public interface IGraphQLDirective { IEnumerable GetDirectiveLocations(); -} \ No newline at end of file +} diff --git a/src/GraphZen.Abstractions/Infrastructure/Check.cs b/src/GraphZen.Abstractions/Infrastructure/Check.cs index df6e65a93..fccdca7bc 100644 --- a/src/GraphZen.Abstractions/Infrastructure/Check.cs +++ b/src/GraphZen.Abstractions/Infrastructure/Check.cs @@ -2,7 +2,6 @@ // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. using System.Diagnostics; -using GraphZen.Infrastructure; namespace GraphZen.Infrastructure; @@ -11,9 +10,13 @@ internal static class Check { [ContractAnnotation("value:null => halt")] [return: NotNull] - public static T NotNull([NotNull] [NoEnumeration] T value, [InvokerParameterName] string parameterName) + public static T NotNull([NotNull][NoEnumeration] T value, [InvokerParameterName] string parameterName) { - if (value is null) throw new ArgumentNullException(parameterName); + if (value is null) + { + throw new ArgumentNullException(parameterName); + } + return value; } -} \ No newline at end of file +} diff --git a/src/GraphZen.Abstractions/LanguageModel/DirectiveLocation.cs b/src/GraphZen.Abstractions/LanguageModel/DirectiveLocation.cs index 110fcec7e..d3340ebc0 100644 --- a/src/GraphZen.Abstractions/LanguageModel/DirectiveLocation.cs +++ b/src/GraphZen.Abstractions/LanguageModel/DirectiveLocation.cs @@ -2,7 +2,6 @@ // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. using System.ComponentModel; -using GraphZen.Infrastructure; namespace GraphZen.LanguageModel; @@ -13,57 +12,75 @@ namespace GraphZen.LanguageModel; [GraphQLName("__DirectiveLocation")] public enum DirectiveLocation { - [Description("Location adjacent to a query operation.")] [GraphQLName("QUERY")] + [Description("Location adjacent to a query operation.")] + [GraphQLName("QUERY")] Query, - [Description("Location adjacent to a mutation operation.")] [GraphQLName("MUTATION")] + [Description("Location adjacent to a mutation operation.")] + [GraphQLName("MUTATION")] Mutation, - [Description("Location adjacent to a subscription operation.")] [GraphQLName("SUBSCRIPTION")] + [Description("Location adjacent to a subscription operation.")] + [GraphQLName("SUBSCRIPTION")] Subscription, - [Description("Location adjacent to a field.")] [GraphQLName("FIELD")] + [Description("Location adjacent to a field.")] + [GraphQLName("FIELD")] Field, - [Description("Location adjacent to a fragment definition.")] [GraphQLName("FRAGMENT_DEFINITION")] + [Description("Location adjacent to a fragment definition.")] + [GraphQLName("FRAGMENT_DEFINITION")] FragmentDefinition, - [Description("Location adjacent to a fragment spread.")] [GraphQLName("FRAGMENT_SPREAD")] + [Description("Location adjacent to a fragment spread.")] + [GraphQLName("FRAGMENT_SPREAD")] FragmentSpread, - [Description("Location adjacent to an inline fragment.")] [GraphQLName("INLINE_FRAGMENT")] + [Description("Location adjacent to an inline fragment.")] + [GraphQLName("INLINE_FRAGMENT")] InlineFragment, - [Description("Location adjacent to a schema definition.")] [GraphQLName("SCHEMA")] + [Description("Location adjacent to a schema definition.")] + [GraphQLName("SCHEMA")] Schema, - [Description("Location adjacent to a scalar definition.")] [GraphQLName("SCALAR")] + [Description("Location adjacent to a scalar definition.")] + [GraphQLName("SCALAR")] Scalar, - [Description("Location adjacent to an object type definition.")] [GraphQLName("OBJECT")] + [Description("Location adjacent to an object type definition.")] + [GraphQLName("OBJECT")] Object, - [Description("Location adjacent to a field Definition.")] [GraphQLName("FIELD_DEFINITION")] + [Description("Location adjacent to a field Definition.")] + [GraphQLName("FIELD_DEFINITION")] FieldDefinition, - [Description("Location adjacent to an argument definition.")] [GraphQLName("ARGUMENT_DEFINITION")] + [Description("Location adjacent to an argument definition.")] + [GraphQLName("ARGUMENT_DEFINITION")] ArgumentDefinition, - [Description("Location adjacent to an interface definition.")] [GraphQLName("INTERFACE")] + [Description("Location adjacent to an interface definition.")] + [GraphQLName("INTERFACE")] Interface, - [Description("Location adjacent to a union Definition.")] [GraphQLName("UNION")] + [Description("Location adjacent to a union Definition.")] + [GraphQLName("UNION")] Union, - [Description("Location adjacent to an enum definition.")] [GraphQLName("ENUM")] + [Description("Location adjacent to an enum definition.")] + [GraphQLName("ENUM")] Enum, - [Description("Location adjacent to an enum value definition.")] [GraphQLName("ENUM_VALUE")] + [Description("Location adjacent to an enum value definition.")] + [GraphQLName("ENUM_VALUE")] EnumValue, - [Description("Location adjacent to an input object type Definition.")] [GraphQLName("INPUT_OBJECT")] + [Description("Location adjacent to an input object type Definition.")] + [GraphQLName("INPUT_OBJECT")] InputObject, - [Description("Location adjacent to an input object field definition.")] [GraphQLName("INPUT_FIELD_DEFINITION")] + [Description("Location adjacent to an input object field definition.")] + [GraphQLName("INPUT_FIELD_DEFINITION")] InputFieldDefinition -} \ No newline at end of file +} diff --git a/src/GraphZen.AspNetCore.Playground/Playground/CursorShape.cs b/src/GraphZen.AspNetCore.Playground/Playground/CursorShape.cs index d7d4d172e..a7855ca6b 100644 --- a/src/GraphZen.AspNetCore.Playground/Playground/CursorShape.cs +++ b/src/GraphZen.AspNetCore.Playground/Playground/CursorShape.cs @@ -1,8 +1,6 @@ -// Copyright (c) GraphZen LLC. All rights reserved. +// Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.Playground; public enum CursorShape @@ -10,4 +8,4 @@ public enum CursorShape Line, Block, Underline -} \ No newline at end of file +} diff --git a/src/GraphZen.AspNetCore.Playground/Playground/EditorTheme.cs b/src/GraphZen.AspNetCore.Playground/Playground/EditorTheme.cs index d9ebd9c74..4183d7cc0 100644 --- a/src/GraphZen.AspNetCore.Playground/Playground/EditorTheme.cs +++ b/src/GraphZen.AspNetCore.Playground/Playground/EditorTheme.cs @@ -1,12 +1,10 @@ -// Copyright (c) GraphZen LLC. All rights reserved. +// Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.Playground; public enum EditorTheme { Dark, Light -} \ No newline at end of file +} diff --git a/src/GraphZen.AspNetCore.Playground/Playground/Internal/PlaygroundHtmlWriter.cs b/src/GraphZen.AspNetCore.Playground/Playground/Internal/PlaygroundHtmlWriter.cs index 9d45f507f..cd1b53f75 100644 --- a/src/GraphZen.AspNetCore.Playground/Playground/Internal/PlaygroundHtmlWriter.cs +++ b/src/GraphZen.AspNetCore.Playground/Playground/Internal/PlaygroundHtmlWriter.cs @@ -1,9 +1,8 @@ -// Copyright (c) GraphZen LLC. All rights reserved. +// Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. using System.Text.Json; using System.Text.Json.Serialization; -using GraphZen.Infrastructure; namespace GraphZen.Playground.Internal; @@ -33,11 +32,15 @@ public class PlaygroundHtmlWriter public static string GetHtml(PlaygroundOptions? options = null) { - if (options == null) return Html.Value; + if (options == null) + { + return Html.Value; + } + var html = Html.Value.Replace("var options = {};", $"var options = {GetPlaygroundOptionsJson(options)};"); return html; } public static string GetPlaygroundOptionsJson(PlaygroundOptions options) => JsonSerializer.Serialize(options, SerializerOptions); -} \ No newline at end of file +} diff --git a/src/GraphZen.AspNetCore.Playground/Playground/PlaygroundOptions.cs b/src/GraphZen.AspNetCore.Playground/Playground/PlaygroundOptions.cs index 009a0d8f0..53b5f06cc 100644 --- a/src/GraphZen.AspNetCore.Playground/Playground/PlaygroundOptions.cs +++ b/src/GraphZen.AspNetCore.Playground/Playground/PlaygroundOptions.cs @@ -1,8 +1,6 @@ -// Copyright (c) GraphZen LLC. All rights reserved. +// Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.Playground; public class PlaygroundOptions @@ -11,4 +9,4 @@ public class PlaygroundOptions public string? SubscriptionEndpoint { get; set; } public string? WorkspaceName { get; set; } public PlaygroundSettings Settings { get; set; } = new(); -} \ No newline at end of file +} diff --git a/src/GraphZen.AspNetCore.Playground/Playground/PlaygroundSettings.cs b/src/GraphZen.AspNetCore.Playground/Playground/PlaygroundSettings.cs index 6e9d1669b..d09387864 100644 --- a/src/GraphZen.AspNetCore.Playground/Playground/PlaygroundSettings.cs +++ b/src/GraphZen.AspNetCore.Playground/Playground/PlaygroundSettings.cs @@ -1,8 +1,7 @@ -// Copyright (c) GraphZen LLC. All rights reserved. +// Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. using System.Text.Json.Serialization; -using GraphZen.Infrastructure; namespace GraphZen.Playground; @@ -49,4 +48,4 @@ public class PlaygroundSettings [JsonPropertyName("tracing.hideTracingResponse")] public bool? HideTracingResponse { get; set; } -} \ No newline at end of file +} diff --git a/src/GraphZen.AspNetCore.Playground/Playground/RequestCredentials.cs b/src/GraphZen.AspNetCore.Playground/Playground/RequestCredentials.cs index d99179e47..f263fd2b9 100644 --- a/src/GraphZen.AspNetCore.Playground/Playground/RequestCredentials.cs +++ b/src/GraphZen.AspNetCore.Playground/Playground/RequestCredentials.cs @@ -1,8 +1,6 @@ -// Copyright (c) GraphZen LLC. All rights reserved. +// Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.Playground; public enum RequestCredentials @@ -10,4 +8,4 @@ public enum RequestCredentials Omit, Include, SameOrigin -} \ No newline at end of file +} diff --git a/src/GraphZen.AspNetCore.Playground/PlaygroundEndpointBuilderExtensions.cs b/src/GraphZen.AspNetCore.Playground/PlaygroundEndpointBuilderExtensions.cs index ff0523f8e..eb4aa6583 100644 --- a/src/GraphZen.AspNetCore.Playground/PlaygroundEndpointBuilderExtensions.cs +++ b/src/GraphZen.AspNetCore.Playground/PlaygroundEndpointBuilderExtensions.cs @@ -1,7 +1,6 @@ -// Copyright (c) GraphZen LLC. All rights reserved. +// Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.Playground; using GraphZen.Playground.Internal; using Microsoft.AspNetCore.Http; @@ -52,4 +51,4 @@ public static IEndpointConventionBuilder MapGraphQLPlayground(this IEndpointRout var html = PlaygroundHtmlWriter.GetHtml(options); return endpointRouteBuilder.MapGet(path ?? "/", http => http.Response.WriteAsync(html)); } -} \ No newline at end of file +} diff --git a/src/GraphZen.AspNetCore.Server/GraphZenApplicationBuilderExtensions.cs b/src/GraphZen.AspNetCore.Server/GraphZenApplicationBuilderExtensions.cs index c1a881cd6..c43c04354 100644 --- a/src/GraphZen.AspNetCore.Server/GraphZenApplicationBuilderExtensions.cs +++ b/src/GraphZen.AspNetCore.Server/GraphZenApplicationBuilderExtensions.cs @@ -37,7 +37,10 @@ public static string TempDirectory "ASPNETCORE_TEMP") ?? // ASPNETCORE_TEMP - User set temporary location. Path.GetTempPath(); // Fall back. - if (!Directory.Exists(temp)) throw new DirectoryNotFoundException(temp); + if (!Directory.Exists(temp)) + { + throw new DirectoryNotFoundException(temp); + } _sTempDirectory = temp; } @@ -59,7 +62,9 @@ public static IEndpointConventionBuilder MapGraphQL(this IEndpointRouteBuilder e var memoryThreshold = DefaultMemoryThreshold; var contentLength = request.ContentLength.GetValueOrDefault(); if (contentLength > 0 && contentLength < memoryThreshold) + { memoryThreshold = (int)contentLength; + } readStream = new FileBufferingReadStream(request.Body, memoryThreshold, null, TempDirectoryFactory); @@ -129,4 +134,4 @@ public static IEndpointConventionBuilder MapGraphQL(this IEndpointRouteBuilder e await httpContext.Response.WriteAsync(resp); }); } -} \ No newline at end of file +} diff --git a/src/GraphZen.AspNetCore.Server/GraphZenServiceCollectionExtensions.cs b/src/GraphZen.AspNetCore.Server/GraphZenServiceCollectionExtensions.cs index ee2deff3f..e065b43f9 100644 --- a/src/GraphZen.AspNetCore.Server/GraphZenServiceCollectionExtensions.cs +++ b/src/GraphZen.AspNetCore.Server/GraphZenServiceCollectionExtensions.cs @@ -34,7 +34,7 @@ public static void AddGraphQLContext( optionsAction != null // ReSharper disable once ConstantConditionalAccessQualifier ? (p, b) => { optionsAction?.Invoke(b); } - : (Action?)null; + : (Action?)null; var contextType = typeof(TContext); Logger.Debug($"Adding GraphQL context {contextType}"); @@ -42,8 +42,10 @@ public static void AddGraphQLContext( { var declaredConstructors = contextType.GetTypeInfo().DeclaredConstructors.ToList(); if (declaredConstructors.Count == 1 && declaredConstructors[0].GetParameters().Length == 0) + { throw new ArgumentException( $"{nameof(AddGraphQLContext)} was called with configuration, but the context type '{contextType}' only declares a parameterless constructor. This means that the configuration passed to {nameof(AddGraphQLContext)} will never be used. If configuration is passed to {nameof(AddGraphQLContext)}, then '{contextType}' should declare a constructor that accepts a {nameof(GraphQLContextOptions)}<{contextType.Name}> and must pass it to the base constructor for {nameof(GraphQLContext)}."); + } } Logger.Debug($"Registering {nameof(GraphQLContextOptions)}"); @@ -75,10 +77,16 @@ public static void AddGraphQLContext( Logger.Debug("Building temporary service provider"); var context = tempServiceProvider.GetRequiredService(); var queryClrType = context.Schema.QueryType?.ClrType; - if (queryClrType != null) serviceCollection.TryAddScoped(queryClrType); + if (queryClrType != null) + { + serviceCollection.TryAddScoped(queryClrType); + } var mutationClrType = context.Schema.MutationType?.ClrType; - if (mutationClrType != null) serviceCollection.TryAddScoped(mutationClrType); + if (mutationClrType != null) + { + serviceCollection.TryAddScoped(mutationClrType); + } } private static GraphQLContextOptions GraphQLContextOptionsFactory( @@ -91,4 +99,4 @@ private static GraphQLContextOptions GraphQLContextOptionsFactory? Variables { get; set; } -} \ No newline at end of file +} diff --git a/src/GraphZen.AspNetCore.Server/PlaygroundApplicationBuilderExtensions.cs b/src/GraphZen.AspNetCore.Server/PlaygroundApplicationBuilderExtensions.cs index ea587d88c..4d33c4deb 100644 --- a/src/GraphZen.AspNetCore.Server/PlaygroundApplicationBuilderExtensions.cs +++ b/src/GraphZen.AspNetCore.Server/PlaygroundApplicationBuilderExtensions.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using Microsoft.AspNetCore.StaticFiles.Infrastructure; using Microsoft.Extensions.FileProviders; @@ -30,4 +29,4 @@ public static void UseGraphQLPlayground(this IApplicationBuilder app) }; app.UseStaticFiles(staticFileOptions); } -} \ No newline at end of file +} diff --git a/src/GraphZen.Client/GraphQLClient.cs b/src/GraphZen.Client/GraphQLClient.cs index 894b8f7dc..b93c045ee 100644 --- a/src/GraphZen.Client/GraphQLClient.cs +++ b/src/GraphZen.Client/GraphQLClient.cs @@ -1,4 +1,4 @@ -// Copyright (c) GraphZen LLC. All rights reserved. +// Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. using GraphZen.Infrastructure; @@ -20,4 +20,4 @@ public async Task SendAsync(GraphQLRequest request, Cancellatio } public Task SendAsync(GraphQLRequest request) => SendAsync(request, default); -} \ No newline at end of file +} diff --git a/src/GraphZen.Client/GraphQLError.cs b/src/GraphZen.Client/GraphQLError.cs index 65dcf366f..34d156a2f 100644 --- a/src/GraphZen.Client/GraphQLError.cs +++ b/src/GraphZen.Client/GraphQLError.cs @@ -1,4 +1,4 @@ -// Copyright (c) GraphZen LLC. All rights reserved. +// Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. using GraphZen.Infrastructure; @@ -14,4 +14,4 @@ public GraphQLError(string message) } public string Message { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.Client/GraphQLRequest.cs b/src/GraphZen.Client/GraphQLRequest.cs index 608b1f364..d33ab65ce 100644 --- a/src/GraphZen.Client/GraphQLRequest.cs +++ b/src/GraphZen.Client/GraphQLRequest.cs @@ -1,8 +1,6 @@ -// Copyright (c) GraphZen LLC. All rights reserved. +// Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen; public class GraphQLRequest @@ -10,4 +8,4 @@ public class GraphQLRequest public string? OperationName { get; set; } public string? Query { get; set; } public object? Variables { get; set; } -} \ No newline at end of file +} diff --git a/src/GraphZen.Client/GraphQLResponse.cs b/src/GraphZen.Client/GraphQLResponse.cs index 64356d843..59de73281 100644 --- a/src/GraphZen.Client/GraphQLResponse.cs +++ b/src/GraphZen.Client/GraphQLResponse.cs @@ -1,7 +1,6 @@ -// Copyright (c) GraphZen LLC. All rights reserved. +// Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.Internal; namespace GraphZen; @@ -26,9 +25,13 @@ public GraphQLResponse(string jsonResponse) public T? GetData() where T : class { - if (_typedData.TryGetValue(typeof(T), out var data)) return (T?)data; + if (_typedData.TryGetValue(typeof(T), out var data)) + { + return (T?)data; + } + var parsed = GraphQLJsonSerializer.ParseData(_jsonResponse); _typedData[typeof(T)] = parsed; return parsed; } -} \ No newline at end of file +} diff --git a/src/GraphZen.Client/IGraphQLClient.cs b/src/GraphZen.Client/IGraphQLClient.cs index c29091ec7..2c8d11129 100644 --- a/src/GraphZen.Client/IGraphQLClient.cs +++ b/src/GraphZen.Client/IGraphQLClient.cs @@ -1,12 +1,10 @@ -// Copyright (c) GraphZen LLC. All rights reserved. +// Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen; public interface IGraphQLClient { Task SendAsync(GraphQLRequest request, CancellationToken cancellationToken); Task SendAsync(GraphQLRequest request); -} \ No newline at end of file +} diff --git a/src/GraphZen.Client/Infrastructure/GraphQLRequestExtensions.cs b/src/GraphZen.Client/Infrastructure/GraphQLRequestExtensions.cs index 340e58769..5a426d1f9 100644 --- a/src/GraphZen.Client/Infrastructure/GraphQLRequestExtensions.cs +++ b/src/GraphZen.Client/Infrastructure/GraphQLRequestExtensions.cs @@ -1,9 +1,8 @@ -// Copyright (c) GraphZen LLC. All rights reserved. +// Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. using System.Text; using System.Text.Json; -using GraphZen.Infrastructure; namespace GraphZen.Infrastructure; @@ -13,8 +12,11 @@ public static HttpRequestMessage ToHttpRequest(this GraphQLRequest request) { Check.NotNull(request, nameof(request)); if (request.OperationName == null && request.Query == null) + { throw new ArgumentException( $"Cannot convert {nameof(GraphQLRequest)} to {nameof(HttpRequestMessage)}: query or operation name required."); + } + var requestJson = JsonSerializer.Serialize(request); var requestJsonContent = new StringContent(requestJson, Encoding.UTF8, "application/json"); var message = new HttpRequestMessage @@ -24,4 +26,4 @@ public static HttpRequestMessage ToHttpRequest(this GraphQLRequest request) }; return message; } -} \ No newline at end of file +} diff --git a/src/GraphZen.Client/Internal/GraphQLJsonSerializer.cs b/src/GraphZen.Client/Internal/GraphQLJsonSerializer.cs index 649b282e9..12f629117 100644 --- a/src/GraphZen.Client/Internal/GraphQLJsonSerializer.cs +++ b/src/GraphZen.Client/Internal/GraphQLJsonSerializer.cs @@ -34,7 +34,10 @@ public static class GraphQLJsonSerializer doc.RootElement.TryGetProperty("data", out var dataElement)) { if (dataElement.ValueKind == JsonValueKind.Null) + { return null; + } + return ConvertJsonElement(dataElement); } @@ -65,7 +68,10 @@ public static class GraphQLJsonSerializer return element.GetString(); case JsonValueKind.Number: if (element.TryGetInt64(out var longVal)) + { return longVal; + } + return element.GetDouble(); case JsonValueKind.True: return true; @@ -111,4 +117,4 @@ private class GraphQLDataJson where T : class // ReSharper disable once UnusedAutoPropertyAccessor.Local public T? Data { get; set; } } -} \ No newline at end of file +} diff --git a/src/GraphZen.DevCli/CodeGen/CodeGenHelpers.cs b/src/GraphZen.DevCli/CodeGen/CodeGenHelpers.cs index 70cf7060b..0cbaa9930 100644 --- a/src/GraphZen.DevCli/CodeGen/CodeGenHelpers.cs +++ b/src/GraphZen.DevCli/CodeGen/CodeGenHelpers.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.CodeGen; public static class CodeGenHelpers @@ -20,4 +18,4 @@ public static void WriteFile(string path, string contents) File.AppendAllText(path, contents); Console.WriteLine(" done)"); } -} \ No newline at end of file +} diff --git a/src/GraphZen.DevCli/CodeGen/CodeGenStringBuilderExtensions.cs b/src/GraphZen.DevCli/CodeGen/CodeGenStringBuilderExtensions.cs index d1a3b3fe0..2021c281f 100644 --- a/src/GraphZen.DevCli/CodeGen/CodeGenStringBuilderExtensions.cs +++ b/src/GraphZen.DevCli/CodeGen/CodeGenStringBuilderExtensions.cs @@ -43,4 +43,4 @@ public static partial class {classPrefix}{propertyName}AccessorExtensions {{ "; csharp.Append(code); } -} \ No newline at end of file +} diff --git a/src/GraphZen.DevCli/CodeGen/CodeGenTasks.cs b/src/GraphZen.DevCli/CodeGen/CodeGenTasks.cs index ba4cf3ced..f79a9d3b2 100644 --- a/src/GraphZen.DevCli/CodeGen/CodeGenTasks.cs +++ b/src/GraphZen.DevCli/CodeGen/CodeGenTasks.cs @@ -2,7 +2,6 @@ // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. using System.Text; -using GraphZen.Infrastructure; namespace GraphZen.CodeGen; @@ -92,4 +91,4 @@ namespace GraphZen.TypeSystem { csharp.Append("}"); CodeGenHelpers.WriteFile("../Linked/TypeSystem/TypeSystemAccessors.Generated.cs", csharp.ToString()); } -} \ No newline at end of file +} diff --git a/src/GraphZen.DevCli/Program.cs b/src/GraphZen.DevCli/Program.cs index c33b19593..d57500dbe 100644 --- a/src/GraphZen.DevCli/Program.cs +++ b/src/GraphZen.DevCli/Program.cs @@ -4,7 +4,6 @@ using System.CommandLine; using System.CommandLine.Builder; using System.CommandLine.Invocation; -using GraphZen.Infrastructure; using static GraphZen.CodeGen.CodeGenTasks; namespace GraphZen; @@ -18,4 +17,4 @@ private static void Main(string[] args) var cli = cliBuilder.Build(); cli.InvokeAsync(args).Wait(); } -} \ No newline at end of file +} diff --git a/src/GraphZen.Infrastructure/AssemblyAttributes.cs b/src/GraphZen.Infrastructure/AssemblyAttributes.cs index a2bb9a3f4..7cdcff870 100644 --- a/src/GraphZen.Infrastructure/AssemblyAttributes.cs +++ b/src/GraphZen.Infrastructure/AssemblyAttributes.cs @@ -2,7 +2,6 @@ // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. using System.Runtime.CompilerServices; -using GraphZen.Infrastructure; [assembly: InternalsVisibleTo("GraphZen.Tests")] [assembly: InternalsVisibleTo("GraphZen")] @@ -17,4 +16,4 @@ [assembly: InternalsVisibleTo("GraphZen.QueryEngine")] [assembly: InternalsVisibleTo("GraphZen.TypeSystem")] [assembly: InternalsVisibleTo("GraphZen.TypeSystem.Tests")] -[assembly: InternalsVisibleTo("GraphZen.Playground")] \ No newline at end of file +[assembly: InternalsVisibleTo("GraphZen.Playground")] diff --git a/src/GraphZen.Infrastructure/Infrastructure/AccessorExtensions.cs b/src/GraphZen.Infrastructure/Infrastructure/AccessorExtensions.cs index 93ab6a14e..97ed6c35f 100644 --- a/src/GraphZen.Infrastructure/Infrastructure/AccessorExtensions.cs +++ b/src/GraphZen.Infrastructure/Infrastructure/AccessorExtensions.cs @@ -2,7 +2,6 @@ // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. using System.Diagnostics; -using GraphZen.Infrastructure; namespace GraphZen.Infrastructure; @@ -11,4 +10,4 @@ public static class AccessorExtensions [DebuggerStepThrough] public static T GetInfrastructure(this IInfrastructure accessor) => Check.NotNull(accessor, nameof(accessor)).Instance; -} \ No newline at end of file +} diff --git a/src/GraphZen.Infrastructure/Infrastructure/DynamicDictionary.cs b/src/GraphZen.Infrastructure/Infrastructure/DynamicDictionary.cs index 29640074f..f892865e2 100644 --- a/src/GraphZen.Infrastructure/Infrastructure/DynamicDictionary.cs +++ b/src/GraphZen.Infrastructure/Infrastructure/DynamicDictionary.cs @@ -5,7 +5,6 @@ using System.Diagnostics; using System.Dynamic; using System.Text; -using GraphZen.Infrastructure; namespace GraphZen.Infrastructure; @@ -35,7 +34,10 @@ private string DebuggerDisplay builder.AppendFormat(" {0} = {1}{2}", item.Key, item.Value, i < maxItems - 1 ? "," : string.Empty); } - if (maxItems < _dictionary.Count) builder.Append("..."); + if (maxItems < _dictionary.Count) + { + builder.Append("..."); + } builder.Append(" }"); @@ -242,7 +244,10 @@ public bool Remove(KeyValuePair item) /// An instance to compare with this instance. public bool Equals(DynamicDictionary? other) { - if (ReferenceEquals(null, other)) return false; + if (other is null) + { + return false; + } return ReferenceEquals(this, other) || Equals(other._dictionary, _dictionary); } @@ -309,18 +314,24 @@ public override bool TryGetMember(GetMemberBinder binder, out object result) public override IEnumerable GetDynamicMemberNames() => _dictionary.Keys; /// - /// Determines whether the specified is equal to this instance. + /// Determines whether the specified is equal to this instance. /// - /// The to compare with this instance. + /// The to compare with this instance. /// - /// if the specified is equal to this instance; otherwise, + /// if the specified is equal to this instance; otherwise, /// . /// public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj.GetType() == typeof(DynamicDictionary) && Equals((DynamicDictionary)obj); } @@ -363,4 +374,4 @@ public Dictionary ToDictionary() return data; } -} \ No newline at end of file +} diff --git a/src/GraphZen.Infrastructure/Infrastructure/Extensions/Json/JsonNodeExtensions.cs b/src/GraphZen.Infrastructure/Infrastructure/Extensions/Json/JsonNodeExtensions.cs index 5361550f9..8e79db158 100644 --- a/src/GraphZen.Infrastructure/Infrastructure/Extensions/Json/JsonNodeExtensions.cs +++ b/src/GraphZen.Infrastructure/Infrastructure/Extensions/Json/JsonNodeExtensions.cs @@ -3,7 +3,6 @@ using System.Text.Json; using System.Text.Json.Nodes; -using GraphZen.Infrastructure; namespace GraphZen.Infrastructure; @@ -27,7 +26,10 @@ public static IDictionary ObjectToDictionary(object value) var json = JsonSerializer.Serialize(value, Json.SerializerOptions); var node = JsonNode.Parse(json); if (node is JsonObject jsonObject) + { return jsonObject.ToDictionary(); + } + throw new Exception("Unable to convert object to Dictionary"); } @@ -57,9 +59,15 @@ private static object ConvertJsonValue(JsonValue value) return element.GetString()!; case JsonValueKind.Number: if (element.TryGetInt32(out var intVal)) + { return intVal; + } + if (element.TryGetInt64(out var longVal)) + { return longVal; + } + return element.GetDouble(); case JsonValueKind.True: return true; @@ -71,4 +79,4 @@ private static object ConvertJsonValue(JsonValue value) return element.ToString(); } } -} \ No newline at end of file +} diff --git a/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/ConcurrentBagExtensions.cs b/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/ConcurrentBagExtensions.cs index 60962e568..097cc3177 100644 --- a/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/ConcurrentBagExtensions.cs +++ b/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/ConcurrentBagExtensions.cs @@ -2,7 +2,6 @@ // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. using System.Collections.Concurrent; -using GraphZen.Infrastructure; namespace GraphZen.Infrastructure; @@ -15,4 +14,4 @@ public static void AddRange(this ConcurrentBag bag, IEnumerable items) bag.Add(item); } } -} \ No newline at end of file +} diff --git a/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/DictionaryExtensions.cs b/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/DictionaryExtensions.cs index cfc387a65..81ec5a84e 100644 --- a/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/DictionaryExtensions.cs +++ b/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/DictionaryExtensions.cs @@ -2,7 +2,6 @@ // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. using System.Collections; -using GraphZen.Infrastructure; namespace GraphZen.Infrastructure; @@ -13,7 +12,10 @@ public static ICollection GetItems(this IDictionary().ToList(); } @@ -24,9 +26,13 @@ public static void AddItem(this IDictionary { item }; + } } @@ -60,8 +66,12 @@ public static void Increment(this IDictionary dictionary, TKey Check.NotNull(dictionary, nameof(dictionary)); Check.NotNull(key, nameof(key)); if (dictionary.TryGetValue(key, out var value)) + { dictionary[key] = value + 1; + } else + { dictionary.Add(key, 1); + } } -} \ No newline at end of file +} diff --git a/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/EnumerableExtensions.cs b/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/EnumerableExtensions.cs index 0b039a542..a19d75835 100644 --- a/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/EnumerableExtensions.cs +++ b/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/EnumerableExtensions.cs @@ -97,4 +97,4 @@ internal static IEnumerable ToEnumerable(this TSource value) { yield return value; } -} \ No newline at end of file +} diff --git a/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/ExpressionExtensions.cs b/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/ExpressionExtensions.cs index 493ed2ee6..7e6824398 100644 --- a/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/ExpressionExtensions.cs +++ b/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/ExpressionExtensions.cs @@ -3,7 +3,6 @@ using System.Linq.Expressions; using System.Reflection; -using GraphZen.Infrastructure; namespace GraphZen.Infrastructure; @@ -23,9 +22,13 @@ public static PropertyInfo GetPropertyInfoFromExpression( if (propertySelector.Body is UnaryExpression unExp) { if (unExp.Operand is MemberExpression expression) + { exp = expression; + } else + { throw new ArgumentException(); + } } else if (propertySelector.Body is MemberExpression expression) { @@ -38,4 +41,4 @@ public static PropertyInfo GetPropertyInfoFromExpression( return (PropertyInfo)exp.Member; } -} \ No newline at end of file +} diff --git a/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/StackExtensions.cs b/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/StackExtensions.cs index f5d8aa263..dd292149f 100644 --- a/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/StackExtensions.cs +++ b/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/StackExtensions.cs @@ -1,12 +1,10 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.Infrastructure; internal static class StackExtensions { public static T? PeekOrDefault(this Stack stack) => Check.NotNull(stack, nameof(stack)).Count > 0 ? stack.Peek() : default; -} \ No newline at end of file +} diff --git a/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/StringExtensions.cs b/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/StringExtensions.cs index f43528907..7b8245b36 100644 --- a/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/StringExtensions.cs +++ b/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/StringExtensions.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.Infrastructure; internal static class StringExtensions @@ -26,7 +24,9 @@ internal static string TrimAsyncSuffix(this string value) { Check.NotNull(value, nameof(value)); if (value.EndsWith("Async") && value.Length > "Async".Length) + { return value.Substring(0, value.Length - "Async".Length); + } return value; } @@ -46,11 +46,20 @@ public static string ToUpperSnakeCase(this string value) Check.NotNull(value, nameof(value)); - if (value.IsSnakeCase()) return value.ToUpper(); + if (value.IsSnakeCase()) + { + return value.ToUpper(); + } - if (value.IsKebabCase()) return value.Replace('-', '_').ToUpper(); + if (value.IsKebabCase()) + { + return value.Replace('-', '_').ToUpper(); + } - if (value.IsSpaceCase()) return value.Replace(' ', '_').ToUpper(); + if (value.IsSpaceCase()) + { + return value.Replace(' ', '_').ToUpper(); + } var chars = value.SelectMany((c, i) => { @@ -60,4 +69,4 @@ public static string ToUpperSnakeCase(this string value) return new string(chars); } -} \ No newline at end of file +} diff --git a/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/TaskExtensions.cs b/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/TaskExtensions.cs index af9b065a8..a9c7a3e65 100644 --- a/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/TaskExtensions.cs +++ b/src/GraphZen.Infrastructure/Infrastructure/Extensions/System/TaskExtensions.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.Infrastructure; internal static class TaskExtensions @@ -23,12 +21,17 @@ internal static class TaskExtensions { Check.NotNull(task, nameof(task)); if (!task.IsCompleted) + { throw new InvalidOperationException( "Attempted to get result of task prior to completion, ensure you are await task prior to getting its value."); + } var resultProp = task.GetType().GetProperty("Result"); - if (resultProp != null) return resultProp.GetValue(task); + if (resultProp != null) + { + return resultProp.GetValue(task); + } throw new InvalidOperationException("Unable to get result from task"); } -} \ No newline at end of file +} diff --git a/src/GraphZen.Infrastructure/Infrastructure/IInfrastructure.cs b/src/GraphZen.Infrastructure/Infrastructure/IInfrastructure.cs index 351426c43..fd17eb5b2 100644 --- a/src/GraphZen.Infrastructure/Infrastructure/IInfrastructure.cs +++ b/src/GraphZen.Infrastructure/Infrastructure/IInfrastructure.cs @@ -1,11 +1,9 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.Infrastructure; public interface IInfrastructure { T Instance { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.Infrastructure/Infrastructure/IInspectable.cs b/src/GraphZen.Infrastructure/Infrastructure/IInspectable.cs index 110493eeb..d43414f64 100644 --- a/src/GraphZen.Infrastructure/Infrastructure/IInspectable.cs +++ b/src/GraphZen.Infrastructure/Infrastructure/IInspectable.cs @@ -1,11 +1,9 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.Infrastructure; public interface IInspectable { string GetDisplayValue(); -} \ No newline at end of file +} diff --git a/src/GraphZen.Infrastructure/Infrastructure/InternalNumerics.cs b/src/GraphZen.Infrastructure/Infrastructure/InternalNumerics.cs index e66e73c4e..09c385a97 100644 --- a/src/GraphZen.Infrastructure/Infrastructure/InternalNumerics.cs +++ b/src/GraphZen.Infrastructure/Infrastructure/InternalNumerics.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.Infrastructure; internal static class InternalNumerics @@ -55,4 +53,4 @@ public static bool TryConvertToInt32(double value, out int result) return false; } -} \ No newline at end of file +} diff --git a/src/GraphZen.Infrastructure/Infrastructure/Json.cs b/src/GraphZen.Infrastructure/Infrastructure/Json.cs index d32150499..ff572ee79 100644 --- a/src/GraphZen.Infrastructure/Infrastructure/Json.cs +++ b/src/GraphZen.Infrastructure/Infrastructure/Json.cs @@ -5,7 +5,6 @@ using System.Text.Json; using System.Text.Json.Nodes; using System.Text.Json.Serialization; -using GraphZen.Infrastructure; namespace GraphZen.Infrastructure; @@ -35,4 +34,4 @@ public static string SerializeObject(object value) }; return JsonSerializer.Serialize(value, options); } -} \ No newline at end of file +} diff --git a/src/GraphZen.Infrastructure/Infrastructure/ResponsePath.cs b/src/GraphZen.Infrastructure/Infrastructure/ResponsePath.cs index b0eba680f..efe030127 100644 --- a/src/GraphZen.Infrastructure/Infrastructure/ResponsePath.cs +++ b/src/GraphZen.Infrastructure/Infrastructure/ResponsePath.cs @@ -3,7 +3,6 @@ using System.Diagnostics; using System.Text; -using GraphZen.Infrastructure; namespace GraphZen.Infrastructure; @@ -55,8 +54,11 @@ public override string ToString() currentPath = currentPath.Previous; } - if (sb.Length > 0) sb.Insert(0, "value"); + if (sb.Length > 0) + { + sb.Insert(0, "value"); + } return sb.ToString(); } -} \ No newline at end of file +} diff --git a/src/GraphZen.Infrastructure/Infrastructure/SpecScalarTypeNames.cs b/src/GraphZen.Infrastructure/Infrastructure/SpecScalarTypeNames.cs index 5e3f07b7c..9dd07290c 100644 --- a/src/GraphZen.Infrastructure/Infrastructure/SpecScalarTypeNames.cs +++ b/src/GraphZen.Infrastructure/Infrastructure/SpecScalarTypeNames.cs @@ -2,7 +2,6 @@ // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. using System.Collections.Immutable; -using GraphZen.Infrastructure; namespace GraphZen.Infrastructure; @@ -20,4 +19,4 @@ internal static class SpecReservedNames ImmutableArray.Create("__Type", "__Field", "__Schema", "__Directive", "__InputValue", "__EnumValue", "__DirectiveLocation", "__TypeKind"); -} \ No newline at end of file +} diff --git a/src/GraphZen.Infrastructure/Infrastructure/StringUtils.cs b/src/GraphZen.Infrastructure/Infrastructure/StringUtils.cs index 41f2bb635..f695bb639 100644 --- a/src/GraphZen.Infrastructure/Infrastructure/StringUtils.cs +++ b/src/GraphZen.Infrastructure/Infrastructure/StringUtils.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.Infrastructure; public static class StringUtils @@ -12,7 +10,11 @@ public static class StringUtils public static string QuotedOrList(this IReadOnlyList source) { // TODO: source = Check.NotEmpty(source, nameof(source)); - if (source.Count == 0) throw new ArgumentException("Must contain at least one value.", nameof(source)); + if (source.Count == 0) + { + throw new ArgumentException("Must contain at least one value.", nameof(source)); + } + return source.Select(v => $"\"{v}\"").ToArray().OrList(); } @@ -26,7 +28,10 @@ public static string OrList( (list, value) => { var (quoted, index) = value; - if (index == 0) return quoted; + if (index == 0) + { + return quoted; + } return list + (selected.Length > 2 ? ", " : " ") + (index == selected.Length - 1 ? "or " : "") + quoted; @@ -47,7 +52,10 @@ public static IReadOnlyList GetSuggestionList(string input, { var distance = GetLexicalDistance(input, option); var threshold = Math.Max(Math.Max(inputThreshold, option.Length / 2), 1); - if (distance <= threshold) optionsByDistance[option] = distance; + if (distance <= threshold) + { + optionsByDistance[option] = distance; + } } return optionsByDistance.OrderBy(_ => _.Value).Select(_ => _.Key).ToArray(); @@ -63,9 +71,15 @@ public static int GetLexicalDistance(string a, string b) var bLength = b.Length; var d = new int[aLength + 1, bLength + 1]; - if (aLength == 0) return bLength; + if (aLength == 0) + { + return bLength; + } - if (bLength == 0) return aLength; + if (bLength == 0) + { + return aLength; + } for (var i = 0; i <= aLength; d[i, 0] = i++) { @@ -76,15 +90,17 @@ public static int GetLexicalDistance(string a, string b) } for (var i = 1; i <= aLength; i++) - for (var j = 1; j <= bLength; j++) { - var cost = b[j - 1] == a[i - 1] ? 0 : 1; + for (var j = 1; j <= bLength; j++) + { + var cost = b[j - 1] == a[i - 1] ? 0 : 1; - d[i, j] = Math.Min( - Math.Min(d[i - 1, j] + 1, d[i, j - 1] + 1), - d[i - 1, j - 1] + cost); + d[i, j] = Math.Min( + Math.Min(d[i - 1, j] + 1, d[i, j - 1] + 1), + d[i - 1, j - 1] + cost); + } } return d[aLength, bLength]; } -} \ No newline at end of file +} diff --git a/src/GraphZen.Infrastructure/Infrastructure/ValueInspector.cs b/src/GraphZen.Infrastructure/Infrastructure/ValueInspector.cs index c8c35ce47..367cd02ed 100644 --- a/src/GraphZen.Infrastructure/Infrastructure/ValueInspector.cs +++ b/src/GraphZen.Infrastructure/Infrastructure/ValueInspector.cs @@ -3,7 +3,6 @@ using System.Collections; using System.Text.Json.Nodes; -using GraphZen.Infrastructure; namespace GraphZen.Infrastructure; @@ -18,9 +17,13 @@ public static T Dump(this T value, Func selector, string? prefix = public static T Dump(this T value, string label = "_", bool expanded = false) { if (expanded) + { Console.WriteLine($"= {label} =\n{value.Inspect(true)}"); + } else + { Console.WriteLine($"\t\t{label} \t\t-> {value.Inspect()}"); + } return value; } @@ -57,4 +60,4 @@ internal static string Inspect(this object? value, bool expanded = false) return value.ToString() ?? string.Empty; } } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/AssemblyAttributes.cs b/src/GraphZen.LanguageModel/AssemblyAttributes.cs index d21d98db5..e2222d1a9 100644 --- a/src/GraphZen.LanguageModel/AssemblyAttributes.cs +++ b/src/GraphZen.LanguageModel/AssemblyAttributes.cs @@ -5,4 +5,4 @@ [assembly: InternalsVisibleTo("GraphZen.Tests")] [assembly: InternalsVisibleTo("GraphZen.QueryEngine")] -[assembly: InternalsVisibleTo("GraphZen.TypeSystem")] \ No newline at end of file +[assembly: InternalsVisibleTo("GraphZen.TypeSystem")] diff --git a/src/GraphZen.LanguageModel/DocumentValidator.cs b/src/GraphZen.LanguageModel/DocumentValidator.cs index a03908b3f..eaa57d3a8 100644 --- a/src/GraphZen.LanguageModel/DocumentValidator.cs +++ b/src/GraphZen.LanguageModel/DocumentValidator.cs @@ -27,4 +27,4 @@ public IEnumerable Validate(DocumentSyntax schemaDocument, validationVisitor.Visit(schemaDocument); return validationContext.GetErrors(); } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/GlobalUsings.cs b/src/GraphZen.LanguageModel/GlobalUsings.cs index 5b5bc45b7..28f0d2a40 100644 --- a/src/GraphZen.LanguageModel/GlobalUsings.cs +++ b/src/GraphZen.LanguageModel/GlobalUsings.cs @@ -2,4 +2,4 @@ // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. global using GraphZen.Infrastructure; -global using GraphZen.LanguageModel.Internal; \ No newline at end of file +global using GraphZen.LanguageModel.Internal; diff --git a/src/GraphZen.LanguageModel/GraphQLException.cs b/src/GraphZen.LanguageModel/GraphQLException.cs index d0548e46a..9713f98bc 100644 --- a/src/GraphZen.LanguageModel/GraphQLException.cs +++ b/src/GraphZen.LanguageModel/GraphQLException.cs @@ -29,4 +29,4 @@ internal GraphQLException(GraphQLServerError error) : base(Check.NotNull(error, public GraphQLServerError GraphQLError { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/GraphQLServerError.cs b/src/GraphZen.LanguageModel/GraphQLServerError.cs index bd15a0eac..4185f0dc7 100644 --- a/src/GraphZen.LanguageModel/GraphQLServerError.cs +++ b/src/GraphZen.LanguageModel/GraphQLServerError.cs @@ -25,8 +25,11 @@ public GraphQLServerError(string message, Source = source ?? nodes?.FirstOrDefault()?.Location?.Source; InnerException = innerException; if (Positions != null && Source != null) + { Locations = Positions.Select(Source.GetLocation).ToList(); + } else if (Nodes != null && Source != null) + { Locations = Nodes .Where(_ => _?.Location != null) .Select(n => @@ -34,6 +37,7 @@ public GraphQLServerError(string message, Debug.Assert(n.Location != null); return Source.GetLocation(n.Location.Start); }).ToList(); + } } @@ -60,11 +64,20 @@ private bool Equals(GraphQLServerError other) => public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } - if (obj.GetType() != GetType()) return false; + if (obj.GetType() != GetType()) + { + return false; + } return Equals((GraphQLServerError)obj); } @@ -93,4 +106,4 @@ public GraphQLServerError WithLocationInfo(IReadOnlyList nodes, Resp new(Message, nodes, Source, Positions, Check.NotNull(path, nameof(path)).AsReadOnlyList(), InnerException); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/IDocumentValidator.cs b/src/GraphZen.LanguageModel/IDocumentValidator.cs index 1dd18dabd..324699187 100644 --- a/src/GraphZen.LanguageModel/IDocumentValidator.cs +++ b/src/GraphZen.LanguageModel/IDocumentValidator.cs @@ -9,4 +9,4 @@ public interface IDocumentValidator { IEnumerable Validate(DocumentSyntax schemaDocument, DocumentSyntax? initialSchemaDocument = null); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/AssemblyAttributes.cs b/src/GraphZen.LanguageModel/LanguageModel/AssemblyAttributes.cs index 2c613388c..6623be328 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/AssemblyAttributes.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/AssemblyAttributes.cs @@ -4,4 +4,4 @@ using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("GraphZen")] -[assembly: InternalsVisibleTo("GraphZen.Tests")] \ No newline at end of file +[assembly: InternalsVisibleTo("GraphZen.Tests")] diff --git a/src/GraphZen.LanguageModel/LanguageModel/Break.cs b/src/GraphZen.LanguageModel/LanguageModel/Break.cs index a0927f49d..1aaa64dcb 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Break.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Break.cs @@ -5,4 +5,4 @@ namespace GraphZen.LanguageModel; public sealed class Break : VisitAction { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/ContinueAction.cs b/src/GraphZen.LanguageModel/LanguageModel/ContinueAction.cs index 84fc58d8f..ebb14544a 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/ContinueAction.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/ContinueAction.cs @@ -5,4 +5,4 @@ namespace GraphZen.LanguageModel; public sealed class ContinueAction : VisitAction { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/GraphQLSyntaxVisitor.cs b/src/GraphZen.LanguageModel/LanguageModel/GraphQLSyntaxVisitor.cs index 4ffe9d93c..11f9b4fa5 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/GraphQLSyntaxVisitor.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/GraphQLSyntaxVisitor.cs @@ -25,4 +25,4 @@ public abstract partial class GraphQLSyntaxVisitor public virtual TResult OnEnter(SyntaxNode node) => default!; public virtual TResult OnLeave(SyntaxNode node) => default!; -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/GraphQLSyntaxWalker.cs b/src/GraphZen.LanguageModel/LanguageModel/GraphQLSyntaxWalker.cs index 5a57487d4..218da1052 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/GraphQLSyntaxWalker.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/GraphQLSyntaxWalker.cs @@ -51,4 +51,4 @@ public override void Visit(SyntaxNode node) node.VisitLeave(this); } } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/IParser.cs b/src/GraphZen.LanguageModel/LanguageModel/IParser.cs index 170706784..7bd50fdc4 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/IParser.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/IParser.cs @@ -12,4 +12,4 @@ public interface IParser TypeSyntax ParseType(string type); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/IPrinter.cs b/src/GraphZen.LanguageModel/LanguageModel/IPrinter.cs index d01cb4048..97a58ee4c 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/IPrinter.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/IPrinter.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; public interface IPrinter { string Print(SyntaxNode node); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DescriptionGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DescriptionGrammar.cs index 3c103926c..75623caf0 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DescriptionGrammar.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DescriptionGrammar.cs @@ -16,4 +16,4 @@ internal static partial class Grammar return _; }) .Named("description"); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DirectiveDefinitionsGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DirectiveDefinitionsGrammar.cs index 039c0623f..9e944f524 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DirectiveDefinitionsGrammar.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DirectiveDefinitionsGrammar.cs @@ -12,17 +12,17 @@ internal static partial class Grammar /// private static TokenListParser DirectiveDefinition { get; } = (from desc in Parse.Ref(() => Description!).AsNullable().OptionalOrDefault() - from directive in Keyword("directive")! - from at in AtSymbol! - from name in Name! - from args in ArgumentsDefinition!.AsNullable().OptionalOrDefault() - from @on in Keyword("on")! - from locations in DirectiveLocations! - select new DirectiveDefinitionSyntax(name!, locations!, desc, args, - SyntaxLocation.FromMany(desc, directive, at, name!, - args?.GetLocation() - , @on, - locations!.GetLocation()))) + from directive in Keyword("directive")! + from at in AtSymbol! + from name in Name! + from args in ArgumentsDefinition!.AsNullable().OptionalOrDefault() + from @on in Keyword("on")! + from locations in DirectiveLocations! + select new DirectiveDefinitionSyntax(name!, locations!, desc, args, + SyntaxLocation.FromMany(desc, directive, at, name!, + args?.GetLocation() + , @on, + locations!.GetLocation()))) .Try() .Named("directive definition"); @@ -31,8 +31,8 @@ from locations in DirectiveLocations! /// private static TokenListParser DirectiveLocations { get; } = (from pipe in Parse.Ref(() => Pipe!).AsNullable().OptionalOrDefault() - from locations in DirectiveLocation!.ManyDelimitedBy(Pipe!) - select locations) + from locations in DirectiveLocation!.ManyDelimitedBy(Pipe!) + select locations) .Try() .Named("directive locations"); @@ -56,4 +56,4 @@ from locations in DirectiveLocations! private static TokenListParser TypeSystemDirectiveLocation { get; } = KeywordIn(DirectiveLocationHelper.TypeSystemDirectiveLocations.Values) .Named("type system directive location"); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DirectiveGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DirectiveGrammar.cs index 0a293399d..242382e4d 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DirectiveGrammar.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DirectiveGrammar.cs @@ -18,9 +18,9 @@ internal static partial class Grammar /// internal static TokenListParser Directive { get; } = (from at in Parse.Ref(() => AtSymbol!.Named("directive symbol")) - from name in Name!.Named("directive name") - from args in Arguments!.AsNullable().OptionalOrDefault().Named("directive arguments") - select new DirectiveSyntax(name!, args, - SyntaxLocation.FromMany(at, name!, args.GetLocation()))).Try() + from name in Name!.Named("directive name") + from args in Arguments!.AsNullable().OptionalOrDefault().Named("directive arguments") + select new DirectiveSyntax(name!, args, + SyntaxLocation.FromMany(at, name!, args.GetLocation()))).Try() .Named("directive"); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DirectiveLocationHelper.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DirectiveLocationHelper.cs index 6af1090b9..4b3bf5bf5 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DirectiveLocationHelper.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DirectiveLocationHelper.cs @@ -53,7 +53,9 @@ internal static string ToStringValue(this DirectiveLocation loc) { if (ExecutableDirectiveLocations.TryGetValue(loc, out var value) || TypeSystemDirectiveLocations.TryGetValue(loc, out value)) + { return value; + } throw new Exception($"No string value defined for {loc}"); } @@ -61,9 +63,15 @@ internal static string ToStringValue(this DirectiveLocation loc) internal static DirectiveLocation Parse(string value) { Check.NotNull(value, nameof(value)); - if (TypeSystemDirectiveLocationsByName.TryGetValue(value, out var result)) return result; + if (TypeSystemDirectiveLocationsByName.TryGetValue(value, out var result)) + { + return result; + } - if (ExecutableDirectiveLocationsByName.TryGetValue(value, out result)) return result; + if (ExecutableDirectiveLocationsByName.TryGetValue(value, out result)) + { + return result; + } throw new Exception($"Unable to find Directive Location that matches value \"{value}\"."); } @@ -96,4 +104,4 @@ public static class DirectiveLocationExtensions public static string GetDisplayValue(this DirectiveLocation directiveLocation) => DirectiveLocationDisplayValues[directiveLocation]; -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DocumentGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DocumentGrammar.cs index 65d1d1828..2f0a1ff01 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DocumentGrammar.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/DocumentGrammar.cs @@ -13,10 +13,10 @@ internal static partial class Grammar /// internal static TokenListParser Document { get; } = (from leadingComments in Parse.Ref(() => Comment!.Many()) - from definitions in Parse.Ref(() => Definition!).Many() - from trailingComments in Comment!.Many() - select new DocumentSyntax(definitions, - definitions.GetLocation().Location)) + from definitions in Parse.Ref(() => Definition!).Many() + from trailingComments in Comment!.Many() + select new DocumentSyntax(definitions, + definitions.GetLocation().Location)) .Named("document"); /// @@ -24,11 +24,11 @@ from definitions in Parse.Ref(() => Definition!).Many() /// private static TokenListParser Definition { get; } = (from leadingComments in Parse.Ref(() => Comment!.Many()) - from def in ExecutableDefinition!.Select(_ => (DefinitionSyntax)_) - .Or(TypeSystemDefinition!.Select(_ => (DefinitionSyntax)_)) - .Or(TypeSystemExtension!.Select(_ => (DefinitionSyntax)_)) - from trailingComments in Comment!.Many() - select def) + from def in ExecutableDefinition!.Select(_ => (DefinitionSyntax)_) + .Or(TypeSystemDefinition!.Select(_ => (DefinitionSyntax)_)) + .Or(TypeSystemExtension!.Select(_ => (DefinitionSyntax)_)) + from trailingComments in Comment!.Many() + select def) .Named("definition"); /// @@ -38,4 +38,4 @@ from definitions in Parse.Ref(() => Definition!).Many() Parse.Ref(() => OperationDefintion!).Select(_ => (ExecutableDefinitionSyntax)_) .Or(FragmentDefinition!.Select(_ => (ExecutableDefinitionSyntax)_)) .Named("executable definition"); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/EnumTypeDefinitionGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/EnumTypeDefinitionGrammar.cs index 0f548aa8b..889733ba1 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/EnumTypeDefinitionGrammar.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/EnumTypeDefinitionGrammar.cs @@ -12,12 +12,12 @@ internal static partial class Grammar /// private static TokenListParser EnumTypeDefinition { get; } = (from desc in Parse.Ref(() => Description!).AsNullable().OptionalOrDefault() - from @enum in Keyword("enum")! - from name in Name! - from directives in Directives.AsNullable().OptionalOrDefault() - from values in EnumValuesDefinition!.AsNullable().OptionalOrDefault() - select new EnumTypeDefinitionSyntax(name!, desc, directives, values, - SyntaxLocation.FromMany(desc, @enum, name!, directives.GetLocation(), values.GetLocation()))) + from @enum in Keyword("enum")! + from name in Name! + from directives in Directives.AsNullable().OptionalOrDefault() + from values in EnumValuesDefinition!.AsNullable().OptionalOrDefault() + select new EnumTypeDefinitionSyntax(name!, desc, directives, values, + SyntaxLocation.FromMany(desc, @enum, name!, directives.GetLocation(), values.GetLocation()))) .Named("enum type definition"); /// @@ -25,9 +25,9 @@ from directives in Directives.AsNullable().OptionalOrDefault() /// private static TokenListParser EnumValuesDefinition { get; } = (from lb in Parse.Ref(() => LeftBrace!) - from values in EnumValueDefinition!.Many() - from rb in RightBrace! - select values) + from values in EnumValueDefinition!.Many() + from rb in RightBrace! + select values) .Try() .Named("enum values"); @@ -36,10 +36,10 @@ from rb in RightBrace! /// private static TokenListParser EnumValueDefinition { get; } = (from desc in Parse.Ref(() => Description!.AsNullable().OptionalOrDefault()) - from value in EnumValue! - from directives in Directives.AsNullable().OptionalOrDefault() - select new EnumValueDefinitionSyntax(value!, desc, directives, - SyntaxLocation.FromMany(desc, value!, directives.GetLocation()))) + from value in EnumValue! + from directives in Directives.AsNullable().OptionalOrDefault() + select new EnumValueDefinitionSyntax(value!, desc, directives, + SyntaxLocation.FromMany(desc, value!, directives.GetLocation()))) .Try() .Named("enum value"); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/EnumTypeExtensionGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/EnumTypeExtensionGrammar.cs index a7c979cb3..fe79e0ef8 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/EnumTypeExtensionGrammar.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/EnumTypeExtensionGrammar.cs @@ -13,18 +13,18 @@ internal static partial class Grammar /// private static TokenListParser EnumTypeExtension { get; } = (from extend in Keyword("extend") - from @enum in Keyword("enum")! - from name in Name! - from directives in Directives.AsNullable().OptionalOrDefault() - from values in EnumValuesDefinition - select new EnumTypeExtensionSyntax(name!, directives, values!, - SyntaxLocation.FromMany(extend, name!, directives.GetLocation(), values!.GetLocation()))).Try() + from @enum in Keyword("enum")! + from name in Name! + from directives in Directives.AsNullable().OptionalOrDefault() + from values in EnumValuesDefinition + select new EnumTypeExtensionSyntax(name!, directives, values!, + SyntaxLocation.FromMany(extend, name!, directives.GetLocation(), values!.GetLocation()))).Try() .Or((from extend in Keyword("extend") - from @enum in Keyword("enum")! - from name in Name! - from directives in Directives - select new EnumTypeExtensionSyntax(name!, directives!, null!, - SyntaxLocation.FromMany(extend, name!, directives!.GetLocation()))).Try()) + from @enum in Keyword("enum")! + from name in Name! + from directives in Directives + select new EnumTypeExtensionSyntax(name!, directives!, null!, + SyntaxLocation.FromMany(extend, name!, directives!.GetLocation()))).Try()) .Try() .Named("enum type extension"); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/FieldGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/FieldGrammar.cs index 41013abe1..cef58952b 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/FieldGrammar.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/FieldGrammar.cs @@ -10,24 +10,24 @@ internal static partial class Grammar { internal static TokenListParser Field { get; } = (from firstName in Parse.Ref(() => Name!.AsNullable().OptionalOrDefault()) - from aliasedName in (from colon in Colon - from aliasedName in Name! - select aliasedName).AsNullable().OptionalOrDefault() - from arguments in Arguments!.AsNullable().OptionalOrDefault().Named("field arguments") - from directives in Directives.AsNullable().OptionalOrDefault().Named("field directives") - from selectionSet in SelectionSet!.AsNullable().OptionalOrDefault().Named("field selections") - let alias = aliasedName != null ? firstName : null - let name = aliasedName ?? firstName - where firstName != null - select new FieldSyntax(name!, - alias, - arguments, - directives, - selectionSet, - SyntaxLocation.FromMany(alias!, name!, arguments?.GetLocation(), - selectionSet, - directives?.GetLocation() - ))) + from aliasedName in (from colon in Colon + from aliasedName in Name! + select aliasedName).AsNullable().OptionalOrDefault() + from arguments in Arguments!.AsNullable().OptionalOrDefault().Named("field arguments") + from directives in Directives.AsNullable().OptionalOrDefault().Named("field directives") + from selectionSet in SelectionSet!.AsNullable().OptionalOrDefault().Named("field selections") + let alias = aliasedName != null ? firstName : null + let name = aliasedName ?? firstName + where firstName != null + select new FieldSyntax(name!, + alias, + arguments, + directives, + selectionSet, + SyntaxLocation.FromMany(alias!, name!, arguments?.GetLocation(), + selectionSet, + directives?.GetLocation() + ))) .Try() .Named("field"); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/FragmentGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/FragmentGrammar.cs index 7c663d199..5e744a27e 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/FragmentGrammar.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/FragmentGrammar.cs @@ -10,43 +10,43 @@ internal static partial class Grammar { private static TokenListParser TypeCondition { get; } = (from @on in Keyword("on") - from type in NamedType! - select type!) + from type in NamedType! + select type!) .Try() .Named("type condition"); private static TokenListParser FragmentName { get; } = (from name in Parse.Ref(() => Name!) - where !name.Value.Equals("on", StringComparison.OrdinalIgnoreCase) - select name) + where !name.Value.Equals("on", StringComparison.OrdinalIgnoreCase) + select name) .Try() .Named("fragment name"); internal static TokenListParser FragmentSpread { get; } = (from spread in Parse.Ref(() => Spread!) - from name in FragmentName.AsNullable().OptionalOrDefault() - from directives in Directives.AsNullable().OptionalOrDefault() - where name != null - select new FragmentSpreadSyntax(name, directives, - SyntaxLocation.FromMany(spread, name, directives.GetLocation()))) + from name in FragmentName.AsNullable().OptionalOrDefault() + from directives in Directives.AsNullable().OptionalOrDefault() + where name != null + select new FragmentSpreadSyntax(name, directives, + SyntaxLocation.FromMany(spread, name, directives.GetLocation()))) .Try() .Named("fragment spread"); internal static TokenListParser InlineFragment => (from spread in Spread - from typeCondition in TypeCondition.AsNullable().OptionalOrDefault() - from directives in Directives.AsNullable().OptionalOrDefault() - from selectionSet in SelectionSet - select new InlineFragmentSyntax(selectionSet!, typeCondition, directives, - new SyntaxLocation(spread, selectionSet!))).Named("inline fragment"); + from typeCondition in TypeCondition.AsNullable().OptionalOrDefault() + from directives in Directives.AsNullable().OptionalOrDefault() + from selectionSet in SelectionSet + select new InlineFragmentSyntax(selectionSet!, typeCondition, directives, + new SyntaxLocation(spread, selectionSet!))).Named("inline fragment"); internal static TokenListParser FragmentDefinition => (from fragment in Keyword("fragment") - from fragmentName in FragmentName - from type in TypeCondition.AsNullable().OptionalOrDefault() - from directives in Directives.AsNullable().OptionalOrDefault() - from selectionSet in SelectionSet - select new FragmentDefinitionSyntax(fragmentName!, type, selectionSet!, directives, - new SyntaxLocation(fragment, selectionSet!))).Named("fragment definition"); -} \ No newline at end of file + from fragmentName in FragmentName + from type in TypeCondition.AsNullable().OptionalOrDefault() + from directives in Directives.AsNullable().OptionalOrDefault() + from selectionSet in SelectionSet + select new FragmentDefinitionSyntax(fragmentName!, type, selectionSet!, directives, + new SyntaxLocation(fragment, selectionSet!))).Named("fragment definition"); +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/Grammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/Grammar.cs index 2faf351d6..926808acd 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/Grammar.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/Grammar.cs @@ -12,10 +12,10 @@ internal static partial class Grammar /// internal static TokenListParser Argument { get; } = (from desc in Parse.Ref(() => Description!).AsNullable().OptionalOrDefault() - from name in Parse.Ref(() => Name!.Named("argument name")) - from colon in Colon! - from value in Value!.Named("argument value") - select new ArgumentSyntax(name!, desc, value, SyntaxLocation.FromMany(name!, value))).Try() + from name in Parse.Ref(() => Name!.Named("argument name")) + from colon in Colon! + from value in Value!.Named("argument value") + select new ArgumentSyntax(name!, desc, value, SyntaxLocation.FromMany(name!, value))).Try() .Named("argument"); /// @@ -23,8 +23,8 @@ from colon in Colon! /// internal static TokenListParser Arguments { get; } = (from lp in Parse.Ref(() => LeftParen!) - from args in Argument!.Many() - from rp in RightParen! - select args).Try() + from args in Argument!.Many() + from rp in RightParen! + select args).Try() .Named("arguments"); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InputObjectTypeExtensionGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InputObjectTypeExtensionGrammar.cs index 26ad667ff..30277cca7 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InputObjectTypeExtensionGrammar.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InputObjectTypeExtensionGrammar.cs @@ -12,19 +12,19 @@ internal static partial class Grammar /// private static TokenListParser InputObjectTypeExtension { get; } = (from extend in Keyword("extend") - from input in Keyword("input") - from name in Parse.Ref(() => Name!) - from directives in Directives.AsNullable().OptionalOrDefault() - from fields in InputFieldsDefinition! - select new InputObjectTypeExtensionSyntax(name!, directives, fields!, - SyntaxLocation.FromMany(extend, fields!.GetLocation()))) + from input in Keyword("input") + from name in Parse.Ref(() => Name!) + from directives in Directives.AsNullable().OptionalOrDefault() + from fields in InputFieldsDefinition! + select new InputObjectTypeExtensionSyntax(name!, directives, fields!, + SyntaxLocation.FromMany(extend, fields!.GetLocation()))) .Try().Or ((from extend in Keyword("extend") - from input in Keyword("input") - from name in Parse.Ref(() => Name!) - from directives in Directives - select new InputObjectTypeExtensionSyntax(name!, directives!, null, - SyntaxLocation.FromMany(extend, directives!.GetLocation()))) + from input in Keyword("input") + from name in Parse.Ref(() => Name!) + from directives in Directives + select new InputObjectTypeExtensionSyntax(name!, directives!, null, + SyntaxLocation.FromMany(extend, directives!.GetLocation()))) .Try()) .Named("input object type extension"); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InputObjectTypeGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InputObjectTypeGrammar.cs index 68edf053d..dc3f4f02e 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InputObjectTypeGrammar.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InputObjectTypeGrammar.cs @@ -12,12 +12,12 @@ internal static partial class Grammar /// private static TokenListParser InputObjectTypeDefinition { get; } = (from desc in Parse.Ref(() => Description!).AsNullable().OptionalOrDefault() - from input in Keyword("input")! - from name in Name! - from directives in Directives.AsNullable().OptionalOrDefault() - from fields in InputFieldsDefinition!.AsNullable().OptionalOrDefault() - select new InputObjectTypeDefinitionSyntax(name!, desc, directives, fields, - SyntaxLocation.FromMany(desc, input, name!, directives.GetLocation(), fields.GetLocation()))) + from input in Keyword("input")! + from name in Name! + from directives in Directives.AsNullable().OptionalOrDefault() + from fields in InputFieldsDefinition!.AsNullable().OptionalOrDefault() + select new InputObjectTypeDefinitionSyntax(name!, desc, directives, fields, + SyntaxLocation.FromMany(desc, input, name!, directives.GetLocation(), fields.GetLocation()))) .Named("input object type definition"); /// @@ -25,9 +25,9 @@ from directives in Directives.AsNullable().OptionalOrDefault() /// private static TokenListParser InputFieldsDefinition { get; } = (from lb in Parse.Ref(() => LeftBrace!) - from values in InputValueDefinition!.Many() - from rb in RightBrace! - select values) + from values in InputValueDefinition!.Many() + from rb in RightBrace! + select values) .Try() .Named("input fields definition"); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InputTypeGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InputTypeGrammar.cs index 0eda021a1..9296a867a 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InputTypeGrammar.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InputTypeGrammar.cs @@ -9,14 +9,14 @@ internal static partial class Grammar { private static TokenListParser NamedType { get; } = (from name in Parse.Ref(() => Name!) - select new NamedTypeSyntax(name, name.Location)) + select new NamedTypeSyntax(name, name.Location)) .Named("named type"); private static TokenListParser ListType { get; } = (from leftBracket in Parse.Ref(() => LeftBracket!) - from type in Type! - from rightBracket in RightBracket! - select new ListTypeSyntax(type!, new SyntaxLocation(leftBracket, rightBracket))) + from type in Type! + from rightBracket in RightBracket! + select new ListTypeSyntax(type!, new SyntaxLocation(leftBracket, rightBracket))) .Try() .Named("list type"); @@ -24,10 +24,10 @@ from rightBracket in RightBracket! (from type in ListType .Select(n => (NullableTypeSyntax)n) .Or(NamedType.Select(n => (NullableTypeSyntax)n)) - from bang in Bang!.AsNullable().OptionalOrDefault() - select bang == null - ? type! - : new NonNullTypeSyntax(type!, SyntaxLocation.FromMany(type!, bang)) as TypeSyntax) + from bang in Bang!.AsNullable().OptionalOrDefault() + select bang == null + ? type! + : new NonNullTypeSyntax(type!, SyntaxLocation.FromMany(type!, bang)) as TypeSyntax) .Try() .Named("type"); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InputValuesGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InputValuesGrammar.cs index 1b54cbd30..d4d4ac6c9 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InputValuesGrammar.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InputValuesGrammar.cs @@ -11,7 +11,7 @@ internal static partial class Grammar { private static TokenListParser NullValue { get; } = (from @null in Keyword("null") - select SyntaxFactory.NullValue()) + select SyntaxFactory.NullValue()) .Try() .Named("null value"); @@ -20,33 +20,33 @@ select SyntaxFactory.NullValue()) /// private static TokenListParser EnumValue { get; } = (from name in Parse.Ref(() => Name!) - where EnumValueSyntax.IsValidValue(name.Value) - select new EnumValueSyntax(name)) + where EnumValueSyntax.IsValidValue(name.Value) + select new EnumValueSyntax(name)) .Try() .Named("enum value"); private static TokenListParser ListValue { get; } = (from leftBracket in Parse.Ref(() => LeftBracket!) - from values in Value!.Many() - from rightBracket in RightBracket! - select new ListValueSyntax(values!, new SyntaxLocation(leftBracket, rightBracket))) + from values in Value!.Many() + from rightBracket in RightBracket! + select new ListValueSyntax(values!, new SyntaxLocation(leftBracket, rightBracket))) .Try() .Named("list value"); private static TokenListParser ObjectField { get; } = (from n in Parse.Ref(() => Name!) - from c in Colon! - from v in Value! - select SyntaxFactory.ObjectField(n, v!)) + from c in Colon! + from v in Value! + select SyntaxFactory.ObjectField(n, v!)) .Try() .Named("object field"); private static TokenListParser ObjectValue { get; } = (from lb in Parse.Ref(() => LeftBrace!) - from fields in ObjectField!.Many() - from rb in RightBrace! - select new ObjectValueSyntax(fields!, new SyntaxLocation(lb, rb))) + from fields in ObjectField!.Many() + from rb in RightBrace! + select new ObjectValueSyntax(fields!, new SyntaxLocation(lb, rb))) .Try().Named("object value"); private static TokenListParser IntValue { get; } = @@ -94,4 +94,4 @@ from rb in RightBrace! .Or(ListValue.Select(_ => (ValueSyntax)_)) .Or(ObjectValue.Select(_ => (ValueSyntax)_)) .Named("value"); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InterfaceTypeDefinitionGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InterfaceTypeDefinitionGrammar.cs index 41da4491c..9c62a5781 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InterfaceTypeDefinitionGrammar.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InterfaceTypeDefinitionGrammar.cs @@ -12,11 +12,11 @@ internal static partial class Grammar /// private static TokenListParser InterfaceTypeDefinition { get; } = (from desc in Parse.Ref(() => Description!.AsNullable().OptionalOrDefault()) - from @interface in Keyword("interface") - from name in Name! - from directives in Directives.AsNullable().OptionalOrDefault() - from fields in FieldsDefinition!.AsNullable().OptionalOrDefault() - select new InterfaceTypeDefinitionSyntax(name!, desc, directives, fields, - SyntaxLocation.FromMany(desc, @interface, name!, directives.GetLocation(), fields.GetLocation()))) + from @interface in Keyword("interface") + from name in Name! + from directives in Directives.AsNullable().OptionalOrDefault() + from fields in FieldsDefinition!.AsNullable().OptionalOrDefault() + select new InterfaceTypeDefinitionSyntax(name!, desc, directives, fields, + SyntaxLocation.FromMany(desc, @interface, name!, directives.GetLocation(), fields.GetLocation()))) .Named("interface"); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InterfaceTypeExtensionGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InterfaceTypeExtensionGrammar.cs index d011e29f2..b24dbab2b 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InterfaceTypeExtensionGrammar.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/InterfaceTypeExtensionGrammar.cs @@ -12,12 +12,12 @@ internal static partial class Grammar /// private static TokenListParser InterfaceTypeExtension { get; } = (from extend in Keyword("extend") - from iface in Keyword("interface") - from name in Name! - from directives in Directives.AsNullable().OptionalOrDefault() - from fields in FieldsDefinition! - select new InterfaceTypeExtensionSyntax(name!, directives, fields!, - SyntaxLocation.FromMany(extend, fields!.GetLocation()))).Try().Or( + from iface in Keyword("interface") + from name in Name! + from directives in Directives.AsNullable().OptionalOrDefault() + from fields in FieldsDefinition! + select new InterfaceTypeExtensionSyntax(name!, directives, fields!, + SyntaxLocation.FromMany(extend, fields!.GetLocation()))).Try().Or( from extend in Keyword("extend") from iface in Keyword("interface") from name in Name! @@ -25,4 +25,4 @@ from directives in Directives select new InterfaceTypeExtensionSyntax(name!, directives!, null, SyntaxLocation.FromMany(extend, directives!.GetLocation())) ).Try().Named("interface type extension"); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/LexicalTokens.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/LexicalTokens.cs index 613cb5ed8..cfd8d5e46 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/LexicalTokens.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/LexicalTokens.cs @@ -75,7 +75,10 @@ private static TokenListParser KeywordIn(IEnumerable(input); @@ -88,4 +91,4 @@ private static TokenListParser Punctuator(TokenKind .EqualTo(tokenKind) .Select(t => new PunctuatorSyntax(t.Span.ToLocation())); } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/ObjectTypeDefinitionGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/ObjectTypeDefinitionGrammar.cs index daaadc474..b2b7d1492 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/ObjectTypeDefinitionGrammar.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/ObjectTypeDefinitionGrammar.cs @@ -12,26 +12,26 @@ internal static partial class Grammar /// private static TokenListParser ObjectTypeDefinition { get; } = (from desc in Parse.Ref(() => Description!).AsNullable().OptionalOrDefault() - from type in Keyword("type") - from typeName in Name - from interfaces in ImplementsIntefaces!.AsNullable().OptionalOrDefault() - from directives in Directives.AsNullable().OptionalOrDefault() - from fields in FieldsDefinition!.AsNullable().OptionalOrDefault() - select new ObjectTypeDefinitionSyntax(typeName!, - desc, - interfaces, directives, fields, - SyntaxLocation.FromMany(desc, type, typeName!, interfaces?.GetLocation(), - directives?.GetLocation(), - fields?.GetLocation()))).Named("object type definition"); + from type in Keyword("type") + from typeName in Name + from interfaces in ImplementsIntefaces!.AsNullable().OptionalOrDefault() + from directives in Directives.AsNullable().OptionalOrDefault() + from fields in FieldsDefinition!.AsNullable().OptionalOrDefault() + select new ObjectTypeDefinitionSyntax(typeName!, + desc, + interfaces, directives, fields, + SyntaxLocation.FromMany(desc, type, typeName!, interfaces?.GetLocation(), + directives?.GetLocation(), + fields?.GetLocation()))).Named("object type definition"); /// /// http://facebook.github.io/graphql/June2018/#ImplementsInterfaces /// private static TokenListParser ImplementsIntefaces { get; } = (from impl in Keyword("implements") - from amp in Ampersand.Optional() - from ifaces in NamedType.Select(nt => nt).ManyDelimitedBy(Ampersand.OptionalOrDefault()) - select ifaces!) + from amp in Ampersand.Optional() + from ifaces in NamedType.Select(nt => nt).ManyDelimitedBy(Ampersand.OptionalOrDefault()) + select ifaces!) .Named("implements interfaces"); /// @@ -39,9 +39,9 @@ from ifaces in NamedType.Select(nt => nt).ManyDelimitedBy(Ampersand.OptionalOrDe /// private static TokenListParser FieldsDefinition { get; } = (from lb in Parse.Ref(() => LeftBrace!) - from defs in FieldDefinition!.Many() - from rb in RightBrace - select defs) + from defs in FieldDefinition!.Many() + from rb in RightBrace + select defs) .Try() .Named("fields definition"); @@ -51,35 +51,35 @@ from rb in RightBrace /// private static TokenListParser FieldDefinition { get; } = (from desc in Parse.Ref(() => Description!).AsNullable().OptionalOrDefault() - from name in Name - from args in ArgumentsDefinition!.AsNullable().OptionalOrDefault() - from c in Colon - from type in Type - from directives in Directives.AsNullable().OptionalOrDefault() - select new FieldDefinitionSyntax(name!, type!, desc, args, directives, - SyntaxLocation.FromMany(desc, name!, args?.GetLocation(), c, type!))) + from name in Name + from args in ArgumentsDefinition!.AsNullable().OptionalOrDefault() + from c in Colon + from type in Type + from directives in Directives.AsNullable().OptionalOrDefault() + select new FieldDefinitionSyntax(name!, type!, desc, args, directives, + SyntaxLocation.FromMany(desc, name!, args?.GetLocation(), c, type!))) .Try() .Named("field definition"); private static TokenListParser ArgumentsDefinition { get; } = (from lp in Parse.Ref(() => LeftParen!) - from defs in InputValueDefinition!.Many() - from rp in RightParen - select defs) + from defs in InputValueDefinition!.Many() + from rp in RightParen + select defs) .Try() .Named("arguments definition"); private static TokenListParser InputValueDefinition { get; } = (from desc in Parse.Ref(() => Description!).AsNullable().OptionalOrDefault() - from name in Name - from c in Colon - from type in Type - from defaultValue in DefaultValue!.AsNullable().OptionalOrDefault() - from directives in Directives.AsNullable().OptionalOrDefault() - select new InputValueDefinitionSyntax(name!, type!, desc, defaultValue, directives, - SyntaxLocation.FromMany( - desc, name!, type!, defaultValue, directives?.GetLocation()))) + from name in Name + from c in Colon + from type in Type + from defaultValue in DefaultValue!.AsNullable().OptionalOrDefault() + from directives in Directives.AsNullable().OptionalOrDefault() + select new InputValueDefinitionSyntax(name!, type!, desc, defaultValue, directives, + SyntaxLocation.FromMany( + desc, name!, type!, defaultValue, directives?.GetLocation()))) .Try() .Named("input value definition"); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/ObjectTypeExtensionGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/ObjectTypeExtensionGrammar.cs index fc17ddcb2..b0a07549f 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/ObjectTypeExtensionGrammar.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/ObjectTypeExtensionGrammar.cs @@ -9,30 +9,30 @@ internal static partial class Grammar { private static TokenListParser ObjectTypeExtension { get; } = (from extend in Keyword("extend") - from type in Keyword("type") - from name in Name - from ifaces in ImplementsIntefaces.AsNullable().OptionalOrDefault() - from directives in Directives.AsNullable().OptionalOrDefault() - from fields in FieldsDefinition - select new ObjectTypeExtensionSyntax(name!, ifaces, directives, fields!, - SyntaxLocation.FromMany(extend, name!, ifaces?.GetLocation(), directives?.GetLocation(), - fields?.GetLocation()))).Try() + from type in Keyword("type") + from name in Name + from ifaces in ImplementsIntefaces.AsNullable().OptionalOrDefault() + from directives in Directives.AsNullable().OptionalOrDefault() + from fields in FieldsDefinition + select new ObjectTypeExtensionSyntax(name!, ifaces, directives, fields!, + SyntaxLocation.FromMany(extend, name!, ifaces?.GetLocation(), directives?.GetLocation(), + fields?.GetLocation()))).Try() .Or( (from extend in Keyword("extend") - from type in Keyword("type") - from name in Name - from ifaces in ImplementsIntefaces.AsNullable().OptionalOrDefault() - from directives in Directives - select new ObjectTypeExtensionSyntax(name!, ifaces, directives!, null, - SyntaxLocation.FromMany(extend, name!, ifaces?.GetLocation(), directives?.GetLocation()))) + from type in Keyword("type") + from name in Name + from ifaces in ImplementsIntefaces.AsNullable().OptionalOrDefault() + from directives in Directives + select new ObjectTypeExtensionSyntax(name!, ifaces, directives!, null, + SyntaxLocation.FromMany(extend, name!, ifaces?.GetLocation(), directives?.GetLocation()))) .Try() ).Or( (from extend in Keyword("extend") - from type in Keyword("type") - from name in Name - from ifaces in ImplementsIntefaces - select new ObjectTypeExtensionSyntax(name!, ifaces!, null, null, - SyntaxLocation.FromMany(extend, name!, ifaces?.GetLocation()))).Try() + from type in Keyword("type") + from name in Name + from ifaces in ImplementsIntefaces + select new ObjectTypeExtensionSyntax(name!, ifaces!, null, null, + SyntaxLocation.FromMany(extend, name!, ifaces?.GetLocation()))).Try() ) .Named("object type extension"); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/OperationDefinitionGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/OperationDefinitionGrammar.cs index cd3368f65..a97a0f1b3 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/OperationDefinitionGrammar.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/OperationDefinitionGrammar.cs @@ -24,22 +24,22 @@ from selectionSet in SelectionSet! private static TokenListParser OperationType { get; } = (from name in Token.EqualTo(TokenKind.Name).Named("operation type") - let nameValue = name.ToStringValue() - let isQuery = nameValue?.Equals("query", StringComparison.OrdinalIgnoreCase) ?? false - let isMutation = nameValue?.Equals("mutation", StringComparison.OrdinalIgnoreCase) ?? false - let isSubscription = nameValue?.Equals("subscription", StringComparison.OrdinalIgnoreCase) ?? false - where isQuery || isMutation || isSubscription - let type = isQuery - ? LanguageModel.OperationType.Query - : isMutation - ? LanguageModel.OperationType.Mutation - : LanguageModel.OperationType.Subscription - select (type, name.Span.ToLocation())) + let nameValue = name.ToStringValue() + let isQuery = nameValue?.Equals("query", StringComparison.OrdinalIgnoreCase) ?? false + let isMutation = nameValue?.Equals("mutation", StringComparison.OrdinalIgnoreCase) ?? false + let isSubscription = nameValue?.Equals("subscription", StringComparison.OrdinalIgnoreCase) ?? false + where isQuery || isMutation || isSubscription + let type = isQuery + ? LanguageModel.OperationType.Query + : isMutation + ? LanguageModel.OperationType.Mutation + : LanguageModel.OperationType.Subscription + select (type, name.Span.ToLocation())) .Named("operation type"); private static TokenListParser QueryShorthandOpeartion { get; } = (from selectionSet in Parse.Ref(() => SelectionSet!) - select new OperationDefinitionSyntax(LanguageModel.OperationType.Query, selectionSet, - location: selectionSet.Location)) + select new OperationDefinitionSyntax(LanguageModel.OperationType.Query, selectionSet, + location: selectionSet.Location)) .Named("query shortand operation"); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/ScalarTypeExtensionGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/ScalarTypeExtensionGrammar.cs index fe3ea9e96..b97e5cba1 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/ScalarTypeExtensionGrammar.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/ScalarTypeExtensionGrammar.cs @@ -12,11 +12,11 @@ internal static partial class Grammar /// private static TokenListParser ScalarTypeExtension { get; } = (from extend in Keyword("extend") - from scalar in Keyword("scalar") - from name in Parse.Ref(() => Name!) - from directives in Directives - select new ScalarTypeExtensionSyntax(name!, directives!, - SyntaxLocation.FromMany(extend, directives!.GetLocation()))) + from scalar in Keyword("scalar") + from name in Parse.Ref(() => Name!) + from directives in Directives + select new ScalarTypeExtensionSyntax(name!, directives!, + SyntaxLocation.FromMany(extend, directives!.GetLocation()))) .Try() .Named("scalar type extension"); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/ScalarTypeGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/ScalarTypeGrammar.cs index 4c659e977..4e6bb4e5c 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/ScalarTypeGrammar.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/ScalarTypeGrammar.cs @@ -9,11 +9,11 @@ internal static partial class Grammar { private static TokenListParser ScalarTypeDefinitionSyntax { get; } = (from desc in Parse.Ref(() => Description!).AsNullable().OptionalOrDefault() - from scalar in Keyword("scalar") - from name in Name - from directives in Directives.AsNullable().OptionalOrDefault() - select new ScalarTypeDefinitionSyntax(name!, desc, directives, - SyntaxLocation.FromMany(desc, scalar, name!, directives.GetLocation()))) + from scalar in Keyword("scalar") + from name in Name + from directives in Directives.AsNullable().OptionalOrDefault() + select new ScalarTypeDefinitionSyntax(name!, desc, directives, + SyntaxLocation.FromMany(desc, scalar, name!, directives.GetLocation()))) .Try() .Named("scalar type"); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/SchemaExtensionGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/SchemaExtensionGrammar.cs index ea22e109c..6425a79d5 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/SchemaExtensionGrammar.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/SchemaExtensionGrammar.cs @@ -12,16 +12,16 @@ internal static partial class Grammar /// private static TokenListParser SchemaExtension { get; } = (from extend in Keyword("extend") - from schema in Keyword("schema") - from directives in Directives.AsNullable().OptionalOrDefault() - from lb in Parse.Ref(() => LeftBrace!) - from defs in OperationTypeDefinition!.Many() - from rb in RightBrace - select new SchemaExtensionSyntax(directives, defs!, SyntaxLocation.FromMany(extend, rb))).Try().Or( + from schema in Keyword("schema") + from directives in Directives.AsNullable().OptionalOrDefault() + from lb in Parse.Ref(() => LeftBrace!) + from defs in OperationTypeDefinition!.Many() + from rb in RightBrace + select new SchemaExtensionSyntax(directives, defs!, SyntaxLocation.FromMany(extend, rb))).Try().Or( from extend in Keyword("extend") from schema in Keyword("schema") from directives in Directives select new SchemaExtensionSyntax(directives!, null, SyntaxLocation.FromMany(extend, directives!.GetLocation())) ).Try().Named("schema extension"); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/SchemaGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/SchemaGrammar.cs index a59ee1003..4b691b840 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/SchemaGrammar.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/SchemaGrammar.cs @@ -9,20 +9,20 @@ internal static partial class Grammar { private static TokenListParser SchemaDefinition { get; } = (from schema in Keyword("schema") - from directives in Directives.AsNullable().OptionalOrDefault() - from leftBrace in Parse.Ref(() => LeftBrace!) - from operationTypeDefinitionNodes in OperationTypeDefinition!.Many() - from rightBrace in RightBrace - select new SchemaDefinitionSyntax(operationTypeDefinitionNodes!, directives, - SyntaxLocation.FromMany(schema, rightBrace))).Try().Named("schema definition"); + from directives in Directives.AsNullable().OptionalOrDefault() + from leftBrace in Parse.Ref(() => LeftBrace!) + from operationTypeDefinitionNodes in OperationTypeDefinition!.Many() + from rightBrace in RightBrace + select new SchemaDefinitionSyntax(operationTypeDefinitionNodes!, directives, + SyntaxLocation.FromMany(schema, rightBrace))).Try().Named("schema definition"); private static TokenListParser OperationTypeDefinition { get; } = (from opType in Parse.Ref(() => OperationType!) - from colon in Colon - from type in NamedType - select new OperationTypeDefinitionSyntax(opType.type, - type!, - SyntaxLocation.FromMany(opType.location, type!.Location))) + from colon in Colon + from type in NamedType + select new OperationTypeDefinitionSyntax(opType.type, + type!, + SyntaxLocation.FromMany(opType.location, type!.Location))) .Try() .Named("operation type definition"); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/SelectionSetGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/SelectionSetGrammar.cs index aa9873454..c4b2f5714 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/SelectionSetGrammar.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/SelectionSetGrammar.cs @@ -12,10 +12,10 @@ internal static partial class Grammar /// internal static TokenListParser SelectionSet { get; } = (from lb in Parse.Ref(() => LeftBrace!) - from selections in Selection! - .AtLeastOnce() - from rb in RightBrace - select new SelectionSetSyntax(selections, new SyntaxLocation(lb, rb))) + from selections in Selection! + .AtLeastOnce() + from rb in RightBrace + select new SelectionSetSyntax(selections, new SyntaxLocation(lb, rb))) .Named("selection set"); @@ -23,4 +23,4 @@ from rb in RightBrace Parse.Ref(() => Field!).Select(_ => (SelectionSyntax)_) .Or(Parse.Ref(() => FragmentSpread!.Select(_ => (SelectionSyntax)_))) .Or(InlineFragment!.Select(_ => (SelectionSyntax)_)).Named("selection"); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/TypeExtensionGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/TypeExtensionGrammar.cs index 969512a13..c12ec7598 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/TypeExtensionGrammar.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/TypeExtensionGrammar.cs @@ -15,4 +15,4 @@ internal static partial class Grammar .Or(Parse.Ref(() => EnumTypeExtension!).Select(_ => (TypeExtensionSyntax)_)) .Or(Parse.Ref(() => InputObjectTypeExtension!).Select(_ => (TypeExtensionSyntax)_)) .Named("type extension"); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/TypeSystemDefinitionGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/TypeSystemDefinitionGrammar.cs index 7a9cc3c1a..12d541629 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/TypeSystemDefinitionGrammar.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/TypeSystemDefinitionGrammar.cs @@ -21,4 +21,4 @@ internal static partial class Grammar .Or(Parse.Ref(() => EnumTypeDefinition!).Select(_ => (TypeDefinitionSyntax)_).Try()) .Or(Parse.Ref(() => InputObjectTypeDefinition!).Select(_ => (TypeDefinitionSyntax)_).Try()) .Named("type definition"); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/TypeSystemExtensionGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/TypeSystemExtensionGrammar.cs index 5340bd45e..e2b310c60 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/TypeSystemExtensionGrammar.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/TypeSystemExtensionGrammar.cs @@ -11,4 +11,4 @@ internal static partial class Grammar Parse.Ref(() => SchemaExtension!).Select(_ => (TypeSystemExtensionSyntax)_) .Or(Parse.Ref(() => TypeExtension!).Select(_ => (TypeSystemExtensionSyntax)_)) .Named("type system extension"); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/UnionTypeDefinitionGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/UnionTypeDefinitionGrammar.cs index fa109b3a0..b924a401f 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/UnionTypeDefinitionGrammar.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/UnionTypeDefinitionGrammar.cs @@ -9,12 +9,12 @@ internal static partial class Grammar { private static TokenListParser UnionTypeDefinition { get; } = (from desc in Parse.Ref(() => Description!).AsNullable().OptionalOrDefault() - from union in Keyword("union") - from name in Name - from directives in Directives.AsNullable().OptionalOrDefault() - from types in UnionMemberTypes!.AsNullable().OptionalOrDefault() - select new UnionTypeDefinitionSyntax(name!, desc, directives, types, - SyntaxLocation.FromMany(desc, union, name!, directives?.GetLocation(), types?.GetLocation()))) + from union in Keyword("union") + from name in Name + from directives in Directives.AsNullable().OptionalOrDefault() + from types in UnionMemberTypes!.AsNullable().OptionalOrDefault() + select new UnionTypeDefinitionSyntax(name!, desc, directives, types, + SyntaxLocation.FromMany(desc, union, name!, directives?.GetLocation(), types?.GetLocation()))) .Named("union type definition"); /// @@ -28,4 +28,4 @@ from types in NamedType.AtLeastOnceDelimitedBy(Pipe) select types!) .Try() .Named("union member types"); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/UnionTypeExtensionGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/UnionTypeExtensionGrammar.cs index 2e0adc1f4..9de0e0b6b 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/UnionTypeExtensionGrammar.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/UnionTypeExtensionGrammar.cs @@ -12,11 +12,11 @@ internal static partial class Grammar /// private static TokenListParser UnionTypeExtension { get; } = (from extend in Keyword("extend") - from union in Keyword("union") - from name in Parse.Ref(() => Name!) - from directives in Directives - select new UnionTypeExtensionSyntax(name!, directives!, null, - SyntaxLocation.FromMany(extend, directives!.GetLocation()))) + from union in Keyword("union") + from name in Parse.Ref(() => Name!) + from directives in Directives + select new UnionTypeExtensionSyntax(name!, directives!, null, + SyntaxLocation.FromMany(extend, directives!.GetLocation()))) .Select(_ => { return _; }) .Try() .Or(from extend in Keyword("extend") @@ -27,4 +27,4 @@ from types in UnionMemberTypes select new UnionTypeExtensionSyntax(name!, directives, types!, SyntaxLocation.FromMany(extend, types!.GetLocation()))).Try() .Named("union type extension"); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/VariablesGrammar.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/VariablesGrammar.cs index 30e0b5f50..a3bf9cd14 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/VariablesGrammar.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Grammar/VariablesGrammar.cs @@ -12,9 +12,9 @@ internal static partial class Grammar /// private static TokenListParser VariableDefinitions { get; } = (from lp in Parse.Ref(() => LeftParen!) - from variableDefinitionNodes in VariableDefinition!.Many() - from rp in RightParen - select variableDefinitionNodes) + from variableDefinitionNodes in VariableDefinition!.Many() + from rp in RightParen + select variableDefinitionNodes) .Named("variable definitions"); /// @@ -22,10 +22,10 @@ from rp in RightParen /// internal static TokenListParser VariableDefinition { get; } = (from v in Parse.Ref(() => Variable!) - from c in Colon - from t in Type - from defaultValue in DefaultValue!.AsNullable().OptionalOrDefault() - select new VariableDefinitionSyntax(v, t!, defaultValue, SyntaxLocation.FromMany(v, c, t!, defaultValue))) + from c in Colon + from t in Type + from defaultValue in DefaultValue!.AsNullable().OptionalOrDefault() + select new VariableDefinitionSyntax(v, t!, defaultValue, SyntaxLocation.FromMany(v, c, t!, defaultValue))) .Named("variable definition"); /// @@ -33,8 +33,8 @@ from t in Type /// internal static TokenListParser Variable { get; } = (from d in Parse.Ref(() => DollarSign!) - from n in Name!.Named("variable name") - select new VariableSyntax(n, new SyntaxLocation(d, n))) + from n in Name!.Named("variable name") + select new VariableSyntax(n, new SyntaxLocation(d, n))) .Named("variable"); /// @@ -42,7 +42,7 @@ from t in Type /// private static TokenListParser DefaultValue { get; } = (from assignment in Parse.Ref(() => Assignment!).Named("assignment") - from value in Value!.Named("default value") - select value!) + from value in Value!.Named("default value") + select value!) .Named("default value"); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/LanguageHelpers.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/LanguageHelpers.cs index 817bb531b..33282df24 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/LanguageHelpers.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/LanguageHelpers.cs @@ -17,8 +17,10 @@ public static string ThrowIfInvalidGraphQLName(this string name) { Check.NotNull(name, nameof(name)); if (!name.IsValidGraphQLName()) + { throw new Exception( $"'{name}' is not a valid GraphQL name. Names are limited to underscores and alpha-numeric ASCII characters."); + } return name; } @@ -43,18 +45,26 @@ public static string BlockStringValue(string rawString) if (indent < line.Length && (commonIndent == null || indent < commonIndent.Value)) { commonIndent = indent; - if (commonIndent == 0) break; + if (commonIndent == 0) + { + break; + } } } if (commonIndent.HasValue) + { for (var i = 1; i < lines.Count; i++) { var line = lines[i]; Debug.Assert(line != null, nameof(line) + " != null"); - if (line.Length > commonIndent.Value) lines[i] = line.Substring(commonIndent.Value); + if (line.Length > commonIndent.Value) + { + lines[i] = line.Substring(commonIndent.Value); + } } + } while (lines.Count > 0 && string.IsNullOrWhiteSpace(lines[0])) { @@ -82,17 +92,25 @@ public static string BlockStringValueOld(string rawString) if (indent < line.Length && (commonIndent == null || indent < commonIndent)) { commonIndent = indent; - if (commonIndent == 0) break; + if (commonIndent == 0) + { + break; + } } } if (commonIndent.HasValue) + { for (var i = 1; i < lines.Count; i++) { var line = lines[i]; Debug.Assert(line != null, nameof(line) + " != null"); - if (line.Length > commonIndent.Value) lines[i] = line.Substring(commonIndent.Value); + if (line.Length > commonIndent.Value) + { + lines[i] = line.Substring(commonIndent.Value); + } } + } while (lines.Count > 0 && string.IsNullOrWhiteSpace(lines[0])) { @@ -119,4 +137,4 @@ private static int GetIndent(this string str) return i; } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/LanguageModelClrTypeExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/LanguageModelClrTypeExtensions.cs index 0099f9673..78259cd2b 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/LanguageModelClrTypeExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/LanguageModelClrTypeExtensions.cs @@ -23,7 +23,10 @@ public static string GetGraphQLName(this Type clrType, object? source = null) { if (clrType.TryGetGraphQLNameWithoutValidation(out var maybeInvalidName, source)) { - if (maybeInvalidName.IsValidGraphQLName()) return maybeInvalidName; + if (maybeInvalidName.IsValidGraphQLName()) + { + return maybeInvalidName; + } throw new Exception( $"Failed to get a valid GraphQL name for CLR type '{clrType}' because it was invalid. The invalid name was '{maybeInvalidName}'."); @@ -38,7 +41,10 @@ private static bool TryGetGraphQLNameWithoutValidation(this Type clrType, [NotNu Check.NotNull(clrType, nameof(clrType)); name = null; - if (clrType.TryGetGraphQLNameFromDataAnnotation(out name)) return true; + if (clrType.TryGetGraphQLNameFromDataAnnotation(out name)) + { + return true; + } if (source != null) { @@ -72,4 +78,4 @@ public static bool TryGetGraphQLNameFromDataAnnotation(this Type clrType, [NotNu .SingleOrDefault()?.Name; return name != null; } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/NodeExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/NodeExtensions.cs index aab9a5d24..005bfe937 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/NodeExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/NodeExtensions.cs @@ -40,7 +40,10 @@ internal static bool NodesEqual( IEnumerable otherNodes) where T : SyntaxNode { var sequenceEquals = nodes.SequenceEqual(otherNodes); - if (sequenceEquals) return true; + if (sequenceEquals) + { + return true; + } return false; } @@ -51,4 +54,4 @@ private struct LocationContainer : ISyntaxNodeLocation public SyntaxLocation? Location { get; } } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Parser.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Parser.cs index 5e3a96ff6..2e975f9c7 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Parser.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Parser.cs @@ -15,4 +15,4 @@ public static class Parser public static TypeSyntax ParseType(string text) => Instance.ParseType(text); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/ParserNullabilityExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/ParserNullabilityExtensions.cs index c67ca4552..60c392e31 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/ParserNullabilityExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/ParserNullabilityExtensions.cs @@ -13,4 +13,4 @@ internal static class ParserNullabilityExtensions internal static TokenListParser AsNullable(this TokenListParser parser) where T : class => parser!; -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/Printer.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/Printer.cs index 3c6882251..0f53eb8d3 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/Printer.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/Printer.cs @@ -24,7 +24,10 @@ public string Print(SyntaxNode node) private void PrintNode(SyntaxNode? node) { - if (node == null) return; + if (node == null) + { + return; + } switch (node) { @@ -49,7 +52,10 @@ private void PrintNode(SyntaxNode? node) // Operation type and name Wrap($"{def.OperationType.ToString().ToLower()} ", def.Name); // Variable definitions - if (def.VariableDefinitions.Any()) Wrap("(", () => Join(def.VariableDefinitions, ", "), ")"); + if (def.VariableDefinitions.Any()) + { + Wrap("(", () => Join(def.VariableDefinitions, ", "), ")"); + } // Directives Append(' '); @@ -62,7 +68,10 @@ private void PrintNode(SyntaxNode? node) Block(set.Selections); break; case FieldSyntax field: - if (field.Alias != null) Wrap("", field.Alias, ": "); + if (field.Alias != null) + { + Wrap("", field.Alias, ": "); + } PrintNode(field.Name); PrintArguments(field.Arguments); @@ -78,7 +87,10 @@ private void PrintNode(SyntaxNode? node) PrintNode(varDef.Variable); Append(": "); PrintNode(varDef.VariableType); - if (varDef.DefaultValue != null) Wrap(" = ", varDef.DefaultValue); + if (varDef.DefaultValue != null) + { + Wrap(" = ", varDef.DefaultValue); + } break; case FragmentSpreadSyntax fragmentSpread: @@ -87,7 +99,10 @@ private void PrintNode(SyntaxNode? node) break; case InlineFragmentSyntax inlineFragment: Append("... "); - if (inlineFragment.TypeCondition != null) Wrap("on ", inlineFragment.TypeCondition, " "); + if (inlineFragment.TypeCondition != null) + { + Wrap("on ", inlineFragment.TypeCondition, " "); + } PrintDirectives(inlineFragment.Directives); PrintNode(inlineFragment.SelectionSet); @@ -158,10 +173,16 @@ private void PrintNode(SyntaxNode? node) PrintDescription(objectDef); Append("type "); PrintNode(objectDef.Name); - if (objectDef.Interfaces.Any()) Wrap(" implements ", () => Join(objectDef.Interfaces, " & ")); + if (objectDef.Interfaces.Any()) + { + Wrap(" implements ", () => Join(objectDef.Interfaces, " & ")); + } PrintDirectives(objectDef.Directives); - if (objectDef.Fields.Any()) Append(" "); + if (objectDef.Fields.Any()) + { + Append(" "); + } Block(objectDef.Fields); break; @@ -188,7 +209,10 @@ private void PrintNode(SyntaxNode? node) PrintDescription(interfaceDef); Wrap("interface ", interfaceDef.Name); PrintDirectives(interfaceDef.Directives); - if (interfaceDef.Fields.Any()) Append(" "); + if (interfaceDef.Fields.Any()) + { + Append(" "); + } Block(interfaceDef.Fields); break; @@ -207,7 +231,10 @@ private void PrintNode(SyntaxNode? node) PrintDescription(enumType); Wrap("enum ", enumType.Name); PrintDirectives(enumType.Directives); - if (enumType.Values.Any()) Append(" "); + if (enumType.Values.Any()) + { + Append(" "); + } Block(enumType.Values); break; @@ -215,7 +242,10 @@ private void PrintNode(SyntaxNode? node) PrintDescription(inputObjectDef); Wrap("input ", inputObjectDef.Name); PrintDirectives(inputObjectDef.Directives); - if (inputObjectDef.Fields.Any()) Append(" "); + if (inputObjectDef.Fields.Any()) + { + Append(" "); + } Block(inputObjectDef.Fields); break; @@ -234,14 +264,20 @@ private void PrintNode(SyntaxNode? node) case EnumTypeExtensionSyntax enumExtension: Wrap("extend enum ", enumExtension.Name); PrintDirectives(enumExtension.Directives); - if (enumExtension.Values.Any()) Append(" "); + if (enumExtension.Values.Any()) + { + Append(" "); + } Block(enumExtension.Values); break; case InterfaceTypeExtensionSyntax ifaceExt: Wrap("extend interface ", ifaceExt.Name); PrintDirectives(ifaceExt.Directives); - if (ifaceExt.Fields.Any()) Append(" "); + if (ifaceExt.Fields.Any()) + { + Append(" "); + } Block(ifaceExt.Fields); break; @@ -252,10 +288,16 @@ private void PrintNode(SyntaxNode? node) case ObjectTypeExtensionSyntax objectExt: Wrap("extend type ", objectExt.Name); - if (objectExt.Interfaces.Any()) Wrap(" implements ", () => Join(objectExt.Interfaces, " & ")); + if (objectExt.Interfaces.Any()) + { + Wrap(" implements ", () => Join(objectExt.Interfaces, " & ")); + } PrintDirectives(objectExt.Directives); - if (objectExt.Fields.Any()) Append(" "); + if (objectExt.Fields.Any()) + { + Append(" "); + } Block(objectExt.Fields); break; @@ -263,7 +305,10 @@ private void PrintNode(SyntaxNode? node) case SchemaExtensionSyntax schemaExt: Append("extend schema"); PrintDirectives(schemaExt.Directives); - if (schemaExt.OperationTypes.Any()) Append(" "); + if (schemaExt.OperationTypes.Any()) + { + Append(" "); + } Block(schemaExt.OperationTypes); break; @@ -280,7 +325,10 @@ private void PrintNode(SyntaxNode? node) case InputObjectTypeExtensionSyntax inputExt: Wrap("extend input ", inputExt.Name); PrintDirectives(inputExt.Directives); - if (inputExt.Fields.Any()) Append(" "); + if (inputExt.Fields.Any()) + { + Append(" "); + } Block(inputExt.Fields); break; @@ -382,7 +430,10 @@ private void PrintArguments(IReadOnlyList arguments) private void PrintArguments(IReadOnlyList arguments) { - if (arguments.Any()) Wrap("(", () => { Join(arguments, ", "); }, ")"); + if (arguments.Any()) + { + Wrap("(", () => { Join(arguments, ", "); }, ")"); + } } @@ -457,7 +508,10 @@ public void Join(IReadOnlyList nodes, Action? seperatorAction = null { PrintNode(node); var isLastElement = i == nodes.Count; - if (hasSeperator && !isLastElement) seperatorAction!(); + if (hasSeperator && !isLastElement) + { + seperatorAction!(); + } i++; } @@ -465,8 +519,9 @@ public void Join(IReadOnlyList nodes, Action? seperatorAction = null private void Join(IReadOnlyList nodes, string? seperator = null) { - Join(nodes, seperator != null ? () => { Append(seperator); } : null); + Join(nodes, seperator != null ? () => { Append(seperator); } + : null); } #endregion -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/SpecScalarSyntaxNodes.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/SpecScalarSyntaxNodes.cs index 67fe2e77b..190326aea 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/SpecScalarSyntaxNodes.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/SpecScalarSyntaxNodes.cs @@ -36,4 +36,4 @@ internal static class SpecScalarSyntaxNodes public static ImmutableArray All { get; } = ImmutableArray.Create(String, ID, Int, Float, Boolean); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/SuperPowerTokenizer.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/SuperPowerTokenizer.cs index 647306fa8..fdf9b8a08 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/SuperPowerTokenizer.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/SuperPowerTokenizer.cs @@ -34,7 +34,10 @@ public static TextParser BlockStringToken { Debug.Assert(delimmiter != null, nameof(delimmiter) + " != null"); var begin = delimmiter(i); - if (!begin.HasValue) return begin; + if (!begin.HasValue) + { + return begin; + } var content = begin.Remainder; @@ -43,7 +46,10 @@ public static TextParser BlockStringToken // ReSharper disable once PossibleNullReferenceException content = Span.EqualTo("\\\"\"\"").Value(Unit.Value).Try()(content).Remainder; var end = delimmiter(content); - if (end.HasValue) return end; + if (end.HasValue) + { + return end; + } content = content.ConsumeChar().Remainder; } @@ -78,4 +84,4 @@ public static TextParser BlockStringToken .Match(Character.EqualTo('}'), TokenKind.RightBrace) .Match(Span.EqualTo("..."), TokenKind.Spread) .Build(); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/SuperpowerParser.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/SuperpowerParser.cs index 663ab46b1..d81c3ce5c 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/SuperpowerParser.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/SuperpowerParser.cs @@ -35,4 +35,4 @@ private static T Parse(string text, TokenListParser parser) Debug.Assert(result.Value != null); return result.Value; } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/TextSpanExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/TextSpanExtensions.cs index 23d8752aa..6e106a33c 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/TextSpanExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/TextSpanExtensions.cs @@ -13,4 +13,4 @@ internal static SyntaxLocation ToLocation(this TextSpan span) var end = start + span.Length; return new SyntaxLocation(start, end, span.Position.Line, span.Position.Column, new Source(span.Source!)); } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Internal/TokenKind.cs b/src/GraphZen.LanguageModel/LanguageModel/Internal/TokenKind.cs index 25958edd9..7aae7f7af 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Internal/TokenKind.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Internal/TokenKind.cs @@ -69,4 +69,4 @@ internal enum TokenKind [Token(Category = "token", Description = "ampersand", Example = "&")] Ampersand -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/ParallelSyntaxWalker.cs b/src/GraphZen.LanguageModel/LanguageModel/ParallelSyntaxWalker.cs index b6f9878d3..955978068 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/ParallelSyntaxWalker.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/ParallelSyntaxWalker.cs @@ -23,22 +23,34 @@ private bool IsValidVisitor(GraphQLSyntaxVisitor visitor) => public override void OnEnter(SyntaxNode node) { if (node != null) + { foreach (var visitor in Visitors) { if (IsValidVisitor(visitor)) + { HandleResult(node.VisitEnter(visitor), visitor, node); + } } + } } public override void OnLeave(SyntaxNode node) { if (node != null) + { foreach (var visitor in Visitors) { - if (IsValidVisitor(visitor)) HandleResult(node.VisitLeave(visitor), visitor, node); + if (IsValidVisitor(visitor)) + { + HandleResult(node.VisitLeave(visitor), visitor, node); + } - if (Skips.TryGetValue(visitor, out var n) && n == node) Skips.Remove(visitor); + if (Skips.TryGetValue(visitor, out var n) && n == node) + { + Skips.Remove(visitor); + } } + } } private void HandleResult(VisitAction result, GraphQLSyntaxVisitor visitor, @@ -54,4 +66,4 @@ private void HandleResult(VisitAction result, GraphQLSyntaxVisitor break; } } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Skip.cs b/src/GraphZen.LanguageModel/LanguageModel/Skip.cs index e5a5fe262..53e0e80af 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Skip.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Skip.cs @@ -5,4 +5,4 @@ namespace GraphZen.LanguageModel; public sealed class Skip : VisitAction { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Source.cs b/src/GraphZen.LanguageModel/LanguageModel/Source.cs index a0e83385f..d2cd7aa00 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Source.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Source.cs @@ -18,11 +18,20 @@ public class Source public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } - if (obj.GetType() != GetType()) return false; + if (obj.GetType() != GetType()) + { + return false; + } return Equals((Source)obj); } @@ -38,7 +47,10 @@ public SourceLocation GetLocation(int position) for (var i = 0; i < matches.Count; i++) { var match = matches[i]; - if (match.Index >= position) break; + if (match.Index >= position) + { + break; + } line += 1; column = position + 1 - (match.Index + match.Length); @@ -46,4 +58,4 @@ public SourceLocation GetLocation(int position) return new SourceLocation(line, column); } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/SourceLocation.cs b/src/GraphZen.LanguageModel/LanguageModel/SourceLocation.cs index 7c052395a..eabdfa77e 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/SourceLocation.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/SourceLocation.cs @@ -29,4 +29,4 @@ public override int GetHashCode() public static bool operator ==(SourceLocation left, SourceLocation right) => left.Equals(right); public static bool operator !=(SourceLocation left, SourceLocation right) => !left.Equals(right); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ArgumentSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ArgumentSyntax.cs index 148f335dd..fb1932dc2 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ArgumentSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ArgumentSyntax.cs @@ -57,9 +57,15 @@ public override IEnumerable Children public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is ArgumentSyntax && Equals((ArgumentSyntax)obj); } @@ -71,4 +77,4 @@ public override int GetHashCode() return (Name.GetHashCode() * 397) ^ Value.GetHashCode(); } } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ArgumentSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ArgumentSyntaxExtensions.cs index 23aab1d55..a92c71435 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ArgumentSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ArgumentSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class ArgumentSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/BooleanValueSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/BooleanValueSyntax.cs index b18997024..1d2cb7ad1 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/BooleanValueSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/BooleanValueSyntax.cs @@ -29,12 +29,18 @@ public partial class BooleanValueSyntax : ValueSyntax public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is BooleanValueSyntax && Equals((BooleanValueSyntax)obj); } public override int GetHashCode() => Value.GetHashCode(); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/BooleanValueSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/BooleanValueSyntaxExtensions.cs index 6a854b56b..0b88a4fec 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/BooleanValueSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/BooleanValueSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class BooleanValueSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/DefinitionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/DefinitionSyntax.cs index 2cbcc4bc6..11ccaa7ad 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/DefinitionSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/DefinitionSyntax.cs @@ -12,4 +12,4 @@ public abstract class DefinitionSyntax : SyntaxNode protected DefinitionSyntax(SyntaxLocation? location) : base(location) { } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/DirectiveDefinitionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/DirectiveDefinitionSyntax.cs index 70378ecf9..808a75c9e 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/DirectiveDefinitionSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/DirectiveDefinitionSyntax.cs @@ -53,9 +53,15 @@ private bool Equals(DirectiveDefinitionSyntax other) => public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is DirectiveDefinitionSyntax && Equals((DirectiveDefinitionSyntax)obj); } @@ -71,4 +77,4 @@ public override int GetHashCode() return hashCode; } } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/DirectiveDefinitionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/DirectiveDefinitionSyntaxExtensions.cs index 8f9224506..be4b2aeca 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/DirectiveDefinitionSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/DirectiveDefinitionSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class DirectiveDefinitionSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/DirectiveSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/DirectiveSyntax.cs index 27a924179..4e037d3c3 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/DirectiveSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/DirectiveSyntax.cs @@ -36,9 +36,15 @@ private bool Equals(DirectiveSyntax other) => public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is DirectiveSyntax && Equals((DirectiveSyntax)obj); } @@ -50,4 +56,4 @@ public override int GetHashCode() return (Name.GetHashCode() * 397) ^ Arguments.GetHashCode(); } } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/DirectiveSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/DirectiveSyntaxExtensions.cs index 2659f94d1..ee8360617 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/DirectiveSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/DirectiveSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class DirectiveSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/DocumentSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/DocumentSyntax.cs index c1d26cd75..dfcdf3607 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/DocumentSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/DocumentSyntax.cs @@ -53,20 +53,28 @@ public DocumentSyntax(IReadOnlyList definitions, var implementations = new Dictionary>(); foreach (var objectType in GetObjectTypeMap().Values) - foreach (var iface in objectType.Interfaces) { - if (implementations.TryGetValue(iface.Name.Value, out - var impls)) - ((HashSet)impls).Add(objectType); - else - implementations[iface.Name.Value] = - new HashSet { objectType }; + foreach (var iface in objectType.Interfaces) + { + if (implementations.TryGetValue(iface.Name.Value, out + var impls)) + { + ((HashSet)impls).Add(objectType); + } + else + { + implementations[iface.Name.Value] = + new HashSet { objectType }; + } + } } foreach (var abstractType in GetAbstractTypeMap().Values) { if (!implementations.ContainsKey(abstractType.Name.Value)) + { implementations[abstractType.Name.Value] = new HashSet(); + } } return new ReadOnlyDictionary>( @@ -100,28 +108,40 @@ public bool IsTypeSubTypeOf(TypeSyntax maybeSubType, TypeSyntax superType) { Check.NotNull(maybeSubType, nameof(maybeSubType)); Check.NotNull(superType, nameof(superType)); - if (maybeSubType.Equals(superType)) return true; + if (maybeSubType.Equals(superType)) + { + return true; + } if (superType is NonNullTypeSyntax nnSuper) { if (maybeSubType is NonNullTypeSyntax nnMaybeSub) + { return IsTypeSubTypeOf(nnMaybeSub.OfType, nnSuper.OfType); + } return false; } if (maybeSubType is NonNullTypeSyntax nnMaybeSubType) + { return IsTypeSubTypeOf(nnMaybeSubType.OfType, superType); + } if (superType is ListTypeSyntax listSuper) { if (maybeSubType is ListTypeSyntax listMaybeSub) + { return IsTypeSubTypeOf(listMaybeSub.OfType, listSuper.OfType); + } return false; } - if (maybeSubType is ListTypeSyntax) return false; + if (maybeSubType is ListTypeSyntax) + { + return false; + } if ( // Is super type abstract type? @@ -130,7 +150,9 @@ public bool IsTypeSubTypeOf(TypeSyntax maybeSubType, TypeSyntax superType) && GetObjectTypeMap().TryGetValue(((NamedTypeSyntax)maybeSubType).Name.Value, out var maybeSubTypeObjectType) && IsPossibleType(abstractSuperType, maybeSubTypeObjectType)) + { return true; + } return false; } @@ -140,10 +162,12 @@ private IReadOnlyCollection GetPossibleTypes( TypeDefinitionSyntax abstractType) { if (abstractType is UnionTypeDefinitionSyntax unionType) + { return unionType.MemberTypes.Select(_ => // ReSharper disable once PossibleNullReferenceException GetObjectTypeMap().TryGetValue(_.Name.Value, out var outputType) ? outputType : null) .Where(_ => _ != null).ToReadOnlyList()!; + } return GetImplementationMap().TryGetValue(abstractType.Name.Value, out var possibleTypes) ? possibleTypes @@ -154,8 +178,10 @@ private bool IsPossibleType(TypeDefinitionSyntax abstractType, ObjectTypeDefinitionSyntax possibleType) { if (!_possibleTypeMap.ContainsKey(abstractType.Name.Value)) + { _possibleTypeMap[abstractType.Name.Value] = GetPossibleTypes(abstractType).ToDictionary(_ => _.Name.Value, _ => true); + } return _possibleTypeMap.TryGetValue(abstractType.Name.Value, out var possibleTypesMap) && possibleTypesMap.ContainsKey(possibleType.Name.Value); @@ -173,12 +199,18 @@ public DocumentSyntax WithFilteredDefinitions(Func predi public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is DocumentSyntax syntax && Equals(syntax); } public override int GetHashCode() => Definitions.GetHashCode(); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/DocumentSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/DocumentSyntaxExtensions.cs index b34fc8964..f7ac632af 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/DocumentSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/DocumentSyntaxExtensions.cs @@ -124,4 +124,4 @@ public static DocumentSyntax WithSortedChildren(this DocumentSyntax document) return new DocumentSyntax(sorted.ToReadOnlyList()); } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumTypeDefinitionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumTypeDefinitionSyntax.cs index 5b378c397..9837b172c 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumTypeDefinitionSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumTypeDefinitionSyntax.cs @@ -55,9 +55,15 @@ private bool Equals(EnumTypeDefinitionSyntax other) => public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is EnumTypeDefinitionSyntax && Equals((EnumTypeDefinitionSyntax)obj); } @@ -73,4 +79,4 @@ public override int GetHashCode() return hashCode; } } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumTypeDefinitionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumTypeDefinitionSyntaxExtensions.cs index 5297c29fc..fdf8f5436 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumTypeDefinitionSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumTypeDefinitionSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class EnumTypeDefinitionSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumTypeExtensionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumTypeExtensionSyntax.cs index fb583c1a5..80352e4b0 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumTypeExtensionSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumTypeExtensionSyntax.cs @@ -44,9 +44,15 @@ private bool Equals(EnumTypeExtensionSyntax other) => public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is EnumTypeExtensionSyntax && Equals((EnumTypeExtensionSyntax)obj); } @@ -61,4 +67,4 @@ public override int GetHashCode() return hashCode; } } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumTypeExtensionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumTypeExtensionSyntaxExtensions.cs index a4e0ec5e9..8b80a8f92 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumTypeExtensionSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumTypeExtensionSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class EnumTypeExtensionSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumValueDefinitionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumValueDefinitionSyntax.cs index 25001561b..3e7b7d112 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumValueDefinitionSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumValueDefinitionSyntax.cs @@ -42,9 +42,15 @@ private bool Equals(EnumValueDefinitionSyntax other) => public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is EnumValueDefinitionSyntax && Equals((EnumValueDefinitionSyntax)obj); } @@ -61,4 +67,4 @@ public override int GetHashCode() } public override string ToString() => Value.ToString(); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumValueDefinitionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumValueDefinitionSyntaxExtensions.cs index 8dfc3ced6..135eaa652 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumValueDefinitionSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumValueDefinitionSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class EnumValueDefinitionSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumValueSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumValueSyntax.cs index 8bb0df73f..3eb7d14c5 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumValueSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumValueSyntax.cs @@ -14,9 +14,11 @@ public EnumValueSyntax(NameSyntax value) : base(Check.NotNull(value, nameof(valu Value = value.Value; if (!IsValidValue(value.Value)) + { throw new ArgumentException( $"Enum values cannot be 'true', 'false', or 'null'. Supplied value was: '{value.Value}'", nameof(value)); + } } @@ -42,9 +44,15 @@ internal static bool IsValidValue(string value) public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is EnumValueSyntax && Equals((EnumValueSyntax)obj); } @@ -54,4 +62,4 @@ public override bool Equals(object? obj) public override object GetValue() => Value; public override string ToString() => Value; -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumValueSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumValueSyntaxExtensions.cs index 7380e734c..4a3354859 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumValueSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/EnumValueSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class EnumValueSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ExecutableDefinitionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ExecutableDefinitionSyntax.cs index 284071cc9..7c9a3c445 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ExecutableDefinitionSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ExecutableDefinitionSyntax.cs @@ -12,4 +12,4 @@ public abstract class ExecutableDefinitionSyntax : DefinitionSyntax protected ExecutableDefinitionSyntax(SyntaxLocation? location) : base(location) { } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FieldDefinitionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FieldDefinitionSyntax.cs index 9479c6a9e..906aa03bd 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FieldDefinitionSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FieldDefinitionSyntax.cs @@ -59,9 +59,15 @@ private bool Equals(FieldDefinitionSyntax other) => public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is FieldDefinitionSyntax && Equals((FieldDefinitionSyntax)obj); } @@ -80,4 +86,4 @@ public override int GetHashCode() } public override string ToString() => Name.ToString(); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FieldDefinitionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FieldDefinitionSyntaxExtensions.cs index 06ee55797..25ba2d088 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FieldDefinitionSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FieldDefinitionSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class FieldDefinitionSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FieldSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FieldSyntax.cs index 5fc958bd3..8c5f17642 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FieldSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FieldSyntax.cs @@ -73,9 +73,15 @@ private bool Equals(FieldSyntax other) => public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is FieldSyntax && Equals((FieldSyntax)obj); } @@ -92,4 +98,4 @@ public override int GetHashCode() return hashCode; } } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FieldSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FieldSyntaxExtensions.cs index 158d054bd..5b15c6f43 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FieldSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FieldSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class FieldSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FloatValueSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FloatValueSyntax.cs index e69128be2..561ad899d 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FloatValueSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FloatValueSyntax.cs @@ -27,9 +27,15 @@ public FloatValueSyntax(string value, SyntaxLocation? location = null) : base(lo public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is FloatValueSyntax && Equals((FloatValueSyntax)obj); } @@ -37,4 +43,4 @@ public override bool Equals(object? obj) public override int GetHashCode() => Value.GetHashCode(); public override object GetValue() => Value; -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FloatValueSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FloatValueSyntaxExtensions.cs index 3ee98e233..1a6a673b6 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FloatValueSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FloatValueSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class FloatValueSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FragmentDefinitionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FragmentDefinitionSyntax.cs index 571302cea..47e4aa244 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FragmentDefinitionSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FragmentDefinitionSyntax.cs @@ -56,9 +56,15 @@ private bool Equals(FragmentDefinitionSyntax other) => public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is FragmentDefinitionSyntax && Equals((FragmentDefinitionSyntax)obj); } @@ -74,4 +80,4 @@ public override int GetHashCode() return hashCode; } } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FragmentDefinitionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FragmentDefinitionSyntaxExtensions.cs index dbb6f39e1..7dff5d7d5 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FragmentDefinitionSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FragmentDefinitionSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class FragmentDefinitionSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FragmentSpreadSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FragmentSpreadSyntax.cs index 4a8ba3057..dbf6db7ba 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FragmentSpreadSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FragmentSpreadSyntax.cs @@ -15,7 +15,9 @@ public FragmentSpreadSyntax(NameSyntax name, { Name = Check.NotNull(name, nameof(name)); if (Name.Value.Equals("on", StringComparison.CurrentCultureIgnoreCase)) + { throw new ArgumentException("Fragment spreads cannot use the name 'on'."); + } Directives = directives ?? DirectiveSyntax.EmptyList; } @@ -41,9 +43,15 @@ private bool Equals(FragmentSpreadSyntax other) => public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is FragmentSpreadSyntax && Equals((FragmentSpreadSyntax)obj); } @@ -55,4 +63,4 @@ public override int GetHashCode() return (Name.GetHashCode() * 397) ^ Directives.GetHashCode(); } } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FragmentSpreadSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FragmentSpreadSyntaxExtensions.cs index 20f055540..4803e1783 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/FragmentSpreadSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/FragmentSpreadSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class FragmentSpreadSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/IArgumentsNode.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/IArgumentsNode.cs index d2ce9ba2f..1c96535a8 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/IArgumentsNode.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/IArgumentsNode.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; public interface IArgumentsNode { IReadOnlyList Arguments { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/IDescribedSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/IDescribedSyntax.cs index 331d8c67d..e9245b21d 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/IDescribedSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/IDescribedSyntax.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; public interface IDescribedSyntax { StringValueSyntax? Description { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/IDirectivesSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/IDirectivesSyntax.cs index c1311c9e8..42c9eef0a 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/IDirectivesSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/IDirectivesSyntax.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; public interface IDirectivesSyntax { IReadOnlyList Directives { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/IFieldsNode.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/IFieldsNode.cs index 8506b3a75..7450cb078 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/IFieldsNode.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/IFieldsNode.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; public interface IFieldsNode : INamedSyntax { IReadOnlyList Fields { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/IFragmentTypeConditionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/IFragmentTypeConditionSyntax.cs index ec36e5427..b5be58f9f 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/IFragmentTypeConditionSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/IFragmentTypeConditionSyntax.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; public interface IFragmentTypeConditionSyntax { NamedTypeSyntax? TypeCondition { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/INamedSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/INamedSyntax.cs index 91b8653cb..fab015735 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/INamedSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/INamedSyntax.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; public interface INamedSyntax { NameSyntax Name { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ISyntaxNodeLocation.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ISyntaxNodeLocation.cs index 4589cfc99..0d30b22d8 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ISyntaxNodeLocation.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ISyntaxNodeLocation.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; public interface ISyntaxNodeLocation { SyntaxLocation? Location { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InlineFragmentSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InlineFragmentSyntax.cs index a38551eec..f4636ff37 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InlineFragmentSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InlineFragmentSyntax.cs @@ -42,9 +42,15 @@ private bool Equals(InlineFragmentSyntax other) => public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is InlineFragmentSyntax && Equals((InlineFragmentSyntax)obj); } @@ -59,4 +65,4 @@ public override int GetHashCode() return hashCode; } } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InlineFragmentSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InlineFragmentSyntaxExtensions.cs index f7a71db6b..980dc73c5 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InlineFragmentSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InlineFragmentSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class InlineFragmentSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputObjectTypeDefinitionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputObjectTypeDefinitionSyntax.cs index 6592f3f00..a9716532b 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputObjectTypeDefinitionSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputObjectTypeDefinitionSyntax.cs @@ -43,9 +43,15 @@ private bool Equals(InputObjectTypeDefinitionSyntax other) => public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is InputObjectTypeDefinitionSyntax && Equals((InputObjectTypeDefinitionSyntax)obj); } @@ -61,4 +67,4 @@ public override int GetHashCode() return hashCode; } } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputObjectTypeDefinitionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputObjectTypeDefinitionSyntaxExtensions.cs index 57bd995e2..fd12ff313 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputObjectTypeDefinitionSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputObjectTypeDefinitionSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class InputObjectTypeDefinitionSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputObjectTypeExtensionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputObjectTypeExtensionSyntax.cs index f6e1e64c2..53b80dfef 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputObjectTypeExtensionSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputObjectTypeExtensionSyntax.cs @@ -34,9 +34,15 @@ private bool Equals(InputObjectTypeExtensionSyntax other) => public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is InputObjectTypeExtensionSyntax && Equals((InputObjectTypeExtensionSyntax)obj); } @@ -51,4 +57,4 @@ public override int GetHashCode() return hashCode; } } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputObjectTypeExtensionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputObjectTypeExtensionSyntaxExtensions.cs index 1b83a8255..5b7de14b5 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputObjectTypeExtensionSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputObjectTypeExtensionSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class InputObjectTypeExtensionSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputValueDefinitionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputValueDefinitionSyntax.cs index 05758c296..ca0dd0c97 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputValueDefinitionSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputValueDefinitionSyntax.cs @@ -63,9 +63,15 @@ private bool Equals(InputValueDefinitionSyntax other) => public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is InputValueDefinitionSyntax && Equals((InputValueDefinitionSyntax)obj); } @@ -84,4 +90,4 @@ public override int GetHashCode() } public override string ToString() => Name.ToString(); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputValueDefinitionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputValueDefinitionSyntaxExtensions.cs index 71973dade..cbe2b0bb5 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputValueDefinitionSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InputValueDefinitionSyntaxExtensions.cs @@ -8,4 +8,4 @@ public static class InputValueDefinitionSyntaxExtensions { public static bool IsRequiredArgument(this InputValueDefinitionSyntax arg) => arg.Type is NonNullTypeSyntax && arg.DefaultValue == null; -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/IntValueSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/IntValueSyntax.cs index 32ea49c02..0853d5641 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/IntValueSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/IntValueSyntax.cs @@ -24,9 +24,15 @@ public partial class IntValueSyntax : ValueSyntax public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is IntValueSyntax && Equals((IntValueSyntax)obj); } @@ -35,4 +41,4 @@ public override bool Equals(object? obj) public override object GetValue() => Value; -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/IntValueSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/IntValueSyntaxExtensions.cs index 0d2374a21..8699cc2bc 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/IntValueSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/IntValueSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class IntValueSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeDefinitionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeDefinitionSyntax.cs index da3dd07af..1101d64da 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeDefinitionSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeDefinitionSyntax.cs @@ -51,9 +51,15 @@ private bool Equals(InterfaceTypeDefinitionSyntax other) => public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is InterfaceTypeDefinitionSyntax && Equals((InterfaceTypeDefinitionSyntax)obj); } @@ -69,4 +75,4 @@ public override int GetHashCode() return hashCode; } } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeDefinitionSyntaxExensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeDefinitionSyntaxExensions.cs index 1b56fb161..932ecfc73 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeDefinitionSyntaxExensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeDefinitionSyntaxExensions.cs @@ -13,4 +13,4 @@ public static InterfaceTypeDefinitionSyntax WithSortedChildren(this InterfaceTyp interfaceNode.Fields.OrderByName().ToReadOnlyList(), interfaceNode.Location); } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeDefinitionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeDefinitionSyntaxExtensions.cs index 5f4680869..1f7360ad3 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeDefinitionSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeDefinitionSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class InterfaceTypeDefinitionSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeExtensionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeExtensionSyntax.cs index 416ab460f..1bd473456 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeExtensionSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeExtensionSyntax.cs @@ -32,9 +32,15 @@ private bool Equals(InterfaceTypeExtensionSyntax other) => public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is InterfaceTypeExtensionSyntax && Equals((InterfaceTypeExtensionSyntax)obj); } @@ -49,4 +55,4 @@ public override int GetHashCode() return hashCode; } } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeExtensionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeExtensionSyntaxExtensions.cs index 7a48333b4..6c62c31df 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeExtensionSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/InterfaceTypeExtensionSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class InterfaceTypeExtensionSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ListTypeSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ListTypeSyntax.cs index b31afbddd..685ca8ad0 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ListTypeSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ListTypeSyntax.cs @@ -27,9 +27,15 @@ public override IEnumerable Children public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is ListTypeSyntax && Equals((ListTypeSyntax)obj); } @@ -38,4 +44,4 @@ public override bool Equals(object? obj) public override string ToString() => ToSyntaxString(); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ListTypeSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ListTypeSyntaxExtensions.cs index 864f8c3c7..a72321cbd 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ListTypeSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ListTypeSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class ListTypeSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ListValueSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ListValueSyntax.cs index 0bee2c730..d5a246874 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ListValueSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ListValueSyntax.cs @@ -25,9 +25,15 @@ public ListValueSyntax(IReadOnlyList values, SyntaxLocation? locati public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is ListValueSyntax && Equals((ListValueSyntax)obj); } @@ -35,4 +41,4 @@ public override bool Equals(object? obj) public override int GetHashCode() => Values.GetHashCode(); public override object GetValue() => Values; -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ListValueSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ListValueSyntaxExtensions.cs index 08ab17b46..789bb49f4 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ListValueSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ListValueSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class ListValueSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NameSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NameSyntax.cs index 4f8773dd4..40a2f5f6a 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NameSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NameSyntax.cs @@ -15,8 +15,10 @@ public NameSyntax(string value, SyntaxLocation? location = null) : base(location { Value = Check.NotNull(value, nameof(value)); if (!value.IsValidGraphQLName()) + { throw new ArgumentException( $"Error creating name '{value}': Names are limited to underscores and alpha-numeric ASCII characters."); + } } /// @@ -36,9 +38,15 @@ public NameSyntax(string value, SyntaxLocation? location = null) : base(location public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is NameSyntax syntax && Equals(syntax); } @@ -46,4 +54,4 @@ public override bool Equals(object? obj) public override int GetHashCode() => Value.GetHashCode(); public override string ToString() => Value; -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NameSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NameSyntaxExtensions.cs index c559d65d5..fb2489388 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NameSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NameSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class NameSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NamedSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NamedSyntaxExtensions.cs index cccd4c125..c4fcff769 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NamedSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NamedSyntaxExtensions.cs @@ -28,4 +28,4 @@ public static bool TryFindByName( result = source.SingleOrDefault(_ => _.Name.Value == name); return result != null; } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NamedTypeSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NamedTypeSyntax.cs index 976ad8d9a..f91ca6eb6 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NamedTypeSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NamedTypeSyntax.cs @@ -28,9 +28,15 @@ public override IEnumerable Children public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is NamedTypeSyntax && Equals((NamedTypeSyntax)obj); } @@ -38,4 +44,4 @@ public override bool Equals(object? obj) public override int GetHashCode() => Name.GetHashCode(); public override string ToString() => Name.ToString(); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NamedTypeSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NamedTypeSyntaxExtensions.cs index 83effd7a7..d3a9c62cb 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NamedTypeSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NamedTypeSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class NamedTypeSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NonNullTypeSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NonNullTypeSyntax.cs index a3142e602..ef97ef318 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NonNullTypeSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NonNullTypeSyntax.cs @@ -27,9 +27,15 @@ public override IEnumerable Children public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is NonNullTypeSyntax && Equals((NonNullTypeSyntax)obj); } @@ -37,4 +43,4 @@ public override bool Equals(object? obj) public override int GetHashCode() => OfType.GetHashCode(); public override string ToString() => $"{OfType}!"; -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NonNullTypeSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NonNullTypeSyntaxExtensions.cs index 526facf49..97225c892 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NonNullTypeSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NonNullTypeSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class NonNullTypeSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NullValueSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NullValueSyntax.cs index 292d049ee..561909438 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NullValueSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NullValueSyntax.cs @@ -19,9 +19,15 @@ public NullValueSyntax(SyntaxLocation? location = null) : base(location) public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is NullValueSyntax; } @@ -30,4 +36,4 @@ public override bool Equals(object? obj) public override object? GetValue() => null; -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NullValueSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NullValueSyntaxExtensions.cs index da6037bb7..bc513e7f8 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NullValueSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NullValueSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class NullValueSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NullableTypeSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NullableTypeSyntax.cs index b4e033ba4..5f44f1b8c 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/NullableTypeSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/NullableTypeSyntax.cs @@ -11,4 +11,4 @@ public abstract class NullableTypeSyntax : TypeSyntax protected NullableTypeSyntax(SyntaxLocation? location) : base(location) { } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectFieldSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectFieldSyntax.cs index cdcbacfeb..1339ae727 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectFieldSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectFieldSyntax.cs @@ -45,9 +45,15 @@ public override IEnumerable Children public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is ObjectFieldSyntax && Equals((ObjectFieldSyntax)obj); } @@ -59,4 +65,4 @@ public override int GetHashCode() return (Name.GetHashCode() * 397) ^ Value.GetHashCode(); } } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectFieldSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectFieldSyntaxExtensions.cs index 802164535..e16e9a90d 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectFieldSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectFieldSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class ObjectFieldSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectTypeDefinitionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectTypeDefinitionSyntax.cs index 49cb27d6a..78d14f252 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectTypeDefinitionSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectTypeDefinitionSyntax.cs @@ -62,9 +62,15 @@ private bool Equals(ObjectTypeDefinitionSyntax other) => public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is ObjectTypeDefinitionSyntax && Equals((ObjectTypeDefinitionSyntax)obj); } @@ -83,4 +89,4 @@ public override int GetHashCode() } public override string ToString() => Name.ToString(); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectTypeDefinitionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectTypeDefinitionSyntaxExtensions.cs index 2aea3d0ce..8c3cfcd7c 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectTypeDefinitionSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectTypeDefinitionSyntaxExtensions.cs @@ -15,4 +15,4 @@ public static ObjectTypeDefinitionSyntax WithSortedChildren(this ObjectTypeDefin objectNode.Fields.OrderByName() .ToReadOnlyList(), objectNode.Location); } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectTypeExtensionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectTypeExtensionSyntax.cs index 00a7e6f31..2b5b597ef 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectTypeExtensionSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectTypeExtensionSyntax.cs @@ -39,9 +39,15 @@ private bool Equals(ObjectTypeExtensionSyntax other) => public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is ObjectTypeExtensionSyntax && Equals((ObjectTypeExtensionSyntax)obj); } @@ -57,4 +63,4 @@ public override int GetHashCode() return hashCode; } } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectTypeExtensionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectTypeExtensionSyntaxExtensions.cs index f68614e25..ce1ab8a03 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectTypeExtensionSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectTypeExtensionSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class ObjectTypeExtensionSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectValueSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectValueSyntax.cs index fee716b9f..fdd90942f 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectValueSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectValueSyntax.cs @@ -26,9 +26,15 @@ public ObjectValueSyntax(IReadOnlyList fields, SyntaxLocation public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is ObjectValueSyntax && Equals((ObjectValueSyntax)obj); } @@ -37,4 +43,4 @@ public override bool Equals(object? obj) public override object GetValue() => Fields; -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectValueSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectValueSyntaxExtensions.cs index ec12dabac..66aecf06b 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectValueSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ObjectValueSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class ObjectValueSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationDefinitionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationDefinitionSyntax.cs index 313bafc01..91ab24ea3 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationDefinitionSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationDefinitionSyntax.cs @@ -65,9 +65,15 @@ private bool Equals(OperationDefinitionSyntax other) => public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is OperationDefinitionSyntax && Equals((OperationDefinitionSyntax)obj); } @@ -84,4 +90,4 @@ public override int GetHashCode() return hashCode; } } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationDefinitionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationDefinitionSyntaxExtensions.cs index 368faf71d..531eab72d 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationDefinitionSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationDefinitionSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class OperationDefinitionSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationType.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationType.cs index c1743a7ca..c0e66789f 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationType.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationType.cs @@ -23,4 +23,4 @@ public enum OperationType /// A long-lived request that fetches data in response to source events. /// Subscription = 30 -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationTypeDefinitionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationTypeDefinitionSyntax.cs index ed2dc0cc6..90d14817c 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationTypeDefinitionSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationTypeDefinitionSyntax.cs @@ -37,9 +37,15 @@ private bool Equals(OperationTypeDefinitionSyntax other) => public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is OperationTypeDefinitionSyntax && Equals((OperationTypeDefinitionSyntax)obj); } @@ -51,4 +57,4 @@ public override int GetHashCode() return ((int)OperationType * 397) ^ Type.GetHashCode(); } } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationTypeDefinitionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationTypeDefinitionSyntaxExtensions.cs index 1228e3a42..ef7640e7b 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationTypeDefinitionSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/OperationTypeDefinitionSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class OperationTypeDefinitionSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/PunctuatorSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/PunctuatorSyntax.cs index e8f6ccde8..a473c221e 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/PunctuatorSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/PunctuatorSyntax.cs @@ -10,4 +10,4 @@ public PunctuatorSyntax(SyntaxLocation? location) : base(location) } public override IEnumerable Children => Enumerable.Empty(); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/PunctuatorSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/PunctuatorSyntaxExtensions.cs index 2b5190f2f..f7e7e228f 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/PunctuatorSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/PunctuatorSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class PunctuatorSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ScalarTypeDefinitionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ScalarTypeDefinitionSyntax.cs index b737d1701..120901517 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ScalarTypeDefinitionSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ScalarTypeDefinitionSyntax.cs @@ -47,9 +47,15 @@ private bool Equals(ScalarTypeDefinitionSyntax other) => public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is ScalarTypeDefinitionSyntax && Equals((ScalarTypeDefinitionSyntax)obj); } @@ -64,4 +70,4 @@ public override int GetHashCode() return hashCode; } } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ScalarTypeDefinitionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ScalarTypeDefinitionSyntaxExtensions.cs index a1973d178..ea8a3a8a5 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ScalarTypeDefinitionSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ScalarTypeDefinitionSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class ScalarTypeDefinitionSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ScalarTypeExtensionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ScalarTypeExtensionSyntax.cs index 9be3a6eb0..f120f200b 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ScalarTypeExtensionSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ScalarTypeExtensionSyntax.cs @@ -27,9 +27,15 @@ private bool Equals(ScalarTypeExtensionSyntax other) => public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is ScalarTypeExtensionSyntax && Equals((ScalarTypeExtensionSyntax)obj); } @@ -41,4 +47,4 @@ public override int GetHashCode() return (Name.GetHashCode() * 397) ^ Directives.GetHashCode(); } } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ScalarTypeExtensionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ScalarTypeExtensionSyntaxExtensions.cs index 7203365e8..a5ae5e7e5 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ScalarTypeExtensionSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ScalarTypeExtensionSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class ScalarTypeExtensionSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SchemaDefinitionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SchemaDefinitionSyntax.cs index d14637f92..934b4f43a 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SchemaDefinitionSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SchemaDefinitionSyntax.cs @@ -49,9 +49,15 @@ public SchemaDefinitionSyntax WithRootOperation(OperationTypeDefinitionSyntax de public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is SchemaDefinitionSyntax && Equals((SchemaDefinitionSyntax)obj); } @@ -63,4 +69,4 @@ public override int GetHashCode() return (RootOperationTypes.GetHashCode() * 397) ^ Directives.GetHashCode(); } } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SchemaDefinitionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SchemaDefinitionSyntaxExtensions.cs index a0417b276..b106519b2 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SchemaDefinitionSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SchemaDefinitionSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class SchemaDefinitionSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SchemaExtensionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SchemaExtensionSyntax.cs index 0c56d5945..60b0b4ed9 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SchemaExtensionSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SchemaExtensionSyntax.cs @@ -37,9 +37,15 @@ private bool Equals(SchemaExtensionSyntax other) => public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is SchemaExtensionSyntax && Equals((SchemaExtensionSyntax)obj); } @@ -51,4 +57,4 @@ public override int GetHashCode() return (OperationTypes.GetHashCode() * 397) ^ Directives.GetHashCode(); } } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SchemaExtensionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SchemaExtensionSyntaxExtensions.cs index 0468f1bda..3889f09e1 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SchemaExtensionSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SchemaExtensionSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class SchemaExtensionSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SelectionSetSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SelectionSetSyntax.cs index 6a2a08e7c..6c9f021ec 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SelectionSetSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SelectionSetSyntax.cs @@ -30,12 +30,18 @@ public SelectionSetSyntax(IReadOnlyList selections, public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is SelectionSetSyntax && Equals((SelectionSetSyntax)obj); } public override int GetHashCode() => Selections.GetHashCode(); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SelectionSetSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SelectionSetSyntaxExtensions.cs index 24b93a26b..f6be513e7 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SelectionSetSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SelectionSetSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class SelectionSetSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SelectionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SelectionSyntax.cs index 3c6487e02..a4bdac5e1 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SelectionSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SelectionSyntax.cs @@ -14,4 +14,4 @@ protected SelectionSyntax(SyntaxLocation? location) : base(location) } public abstract IReadOnlyList Directives { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/StringValueSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/StringValueSyntax.cs index 00b406942..68052fe6b 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/StringValueSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/StringValueSyntax.cs @@ -34,9 +34,15 @@ private bool Equals(StringValueSyntax other) => public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is StringValueSyntax && Equals((StringValueSyntax)obj); } @@ -54,4 +60,4 @@ public override int GetHashCode() public override object GetValue() => Value; public override string ToString() => $"\"{Value}\""; -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/StringValueSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/StringValueSyntaxExtensions.cs index 61635e09d..53d3204d7 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/StringValueSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/StringValueSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class StringValueSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SyntaxFactory.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SyntaxFactory.cs index 031bac75e..8d328233b 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SyntaxFactory.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SyntaxFactory.cs @@ -185,4 +185,4 @@ public static ScalarTypeDefinitionSyntax ScalarTypeDefinition(NameSyntax name, [DebuggerStepThrough] public static SelectionSetSyntax SelectionSet(params SelectionSyntax[] selections) => new(selections); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SyntaxLocation.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SyntaxLocation.cs index 1b04c3687..4f170cb90 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SyntaxLocation.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SyntaxLocation.cs @@ -25,9 +25,15 @@ public SyntaxLocation(SyntaxLocation start, SyntaxLocation end) : public SyntaxLocation(int start, int end, int line, int column, Source source) { - if (start < 0) throw new ArgumentException($"Location start index ({start}) must be greater than 0."); + if (start < 0) + { + throw new ArgumentException($"Location start index ({start}) must be greater than 0."); + } - if (end < start) throw new ArgumentException($"Location start (${start}) must precede end (${end})."); + if (end < start) + { + throw new ArgumentException($"Location start (${start}) must precede end (${end})."); + } Start = start; End = end; @@ -48,11 +54,20 @@ public SyntaxLocation(int start, int end, int line, int column, Source source) public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } - if (obj.GetType() != GetType()) return false; + if (obj.GetType() != GetType()) + { + return false; + } return Equals((SyntaxLocation)obj); } @@ -77,7 +92,10 @@ public override int GetHashCode() Check.NotNull(locations, nameof(locations)); var locs = locations.Where(l => l != null).OrderBy(_ => _!.Start).ToArray(); - if (locs.Length == 0) return null; + if (locs.Length == 0) + { + return null; + } var min = locs[0]; var max = locs[locs.Length - 1]; @@ -86,4 +104,4 @@ public override int GetHashCode() Debug.Assert(max != null, nameof(max) + " != null"); return new SyntaxLocation(min.Start, max.End, min.Line, min.Column, min.Source); } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SyntaxNode.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SyntaxNode.cs index 5d2cf8cdb..da866cdee 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SyntaxNode.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SyntaxNode.cs @@ -44,4 +44,4 @@ public IEnumerable DescendantNodes() public string ToSyntaxString() => _printed.Value; -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SyntaxNodeExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SyntaxNodeExtensions.cs index c39c53af4..7e27cebb3 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/SyntaxNodeExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/SyntaxNodeExtensions.cs @@ -38,4 +38,4 @@ public static bool IsSchemaOfCommonNames(this SchemaDefinitionSyntax schemaDefin Check.NotNull(schemaDefinitionNode, nameof(schemaDefinitionNode)); return schemaDefinitionNode.RootOperationTypes.All(ot => ot.Type.Name.Value == ot.OperationType.ToString()); } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeDefinitionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeDefinitionSyntax.cs index b6253b8f8..a2d8d6aa1 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeDefinitionSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeDefinitionSyntax.cs @@ -20,4 +20,4 @@ protected TypeDefinitionSyntax(SyntaxLocation? location) : base(location) public abstract NameSyntax Name { get; } public string GetDisplayValue() => Name.Value; -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeExtensionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeExtensionSyntax.cs index 8da493eff..7a320dbb3 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeExtensionSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeExtensionSyntax.cs @@ -14,4 +14,4 @@ protected TypeExtensionSyntax(SyntaxLocation? location) : base(location) } public abstract NameSyntax Name { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeSyntax.cs index 04eb4cc46..3be5b6054 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeSyntax.cs @@ -34,4 +34,4 @@ TypeSyntax FindNamedType(TypeSyntax node) return (NamedTypeSyntax)FindNamedType(this); } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeSystemDefinitionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeSystemDefinitionSyntax.cs index bed4e7b0c..b45cfb0b3 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeSystemDefinitionSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeSystemDefinitionSyntax.cs @@ -12,4 +12,4 @@ public abstract class TypeSystemDefinitionSyntax : DefinitionSyntax protected TypeSystemDefinitionSyntax(SyntaxLocation? location) : base(location) { } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeSystemExtensionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeSystemExtensionSyntax.cs index 115a155c2..ff4c980c6 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeSystemExtensionSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/TypeSystemExtensionSyntax.cs @@ -12,4 +12,4 @@ public abstract class TypeSystemExtensionSyntax : DefinitionSyntax protected TypeSystemExtensionSyntax(SyntaxLocation? location) : base(location) { } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/UnionTypeDefinitionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/UnionTypeDefinitionSyntax.cs index fcde02419..080088cd7 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/UnionTypeDefinitionSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/UnionTypeDefinitionSyntax.cs @@ -48,9 +48,15 @@ private bool Equals(UnionTypeDefinitionSyntax other) => public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is UnionTypeDefinitionSyntax && Equals((UnionTypeDefinitionSyntax)obj); } @@ -66,4 +72,4 @@ public override int GetHashCode() return hashCode; } } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/UnionTypeDefinitonSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/UnionTypeDefinitonSyntaxExtensions.cs index 4c425b823..2964ee379 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/UnionTypeDefinitonSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/UnionTypeDefinitonSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class UnionTypeDefinitionSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/UnionTypeExtensionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/UnionTypeExtensionSyntax.cs index b1412ac20..4bdbf5af9 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/UnionTypeExtensionSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/UnionTypeExtensionSyntax.cs @@ -34,9 +34,15 @@ private bool Equals(UnionTypeExtensionSyntax other) => public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is UnionTypeExtensionSyntax && Equals((UnionTypeExtensionSyntax)obj); } @@ -51,4 +57,4 @@ public override int GetHashCode() return hashCode; } } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/UnionTypeExtensionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/UnionTypeExtensionSyntaxExtensions.cs index 55bc332fd..79b0a1412 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/UnionTypeExtensionSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/UnionTypeExtensionSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class UnionTypeExtensionSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ValueSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ValueSyntax.cs index a4e99fc67..3ccee97c4 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/ValueSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/ValueSyntax.cs @@ -19,4 +19,4 @@ protected ValueSyntax(SyntaxLocation? location) : base(location) public abstract object? GetValue(); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/VariableDefinitionSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/VariableDefinitionSyntax.cs index 45930d41d..fb7936ed9 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/VariableDefinitionSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/VariableDefinitionSyntax.cs @@ -41,7 +41,10 @@ public override IEnumerable Children { yield return Variable; yield return VariableType; - if (DefaultValue != null) yield return DefaultValue; + if (DefaultValue != null) + { + yield return DefaultValue; + } } } @@ -53,9 +56,15 @@ private bool Equals(VariableDefinitionSyntax other) => public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is VariableDefinitionSyntax && Equals((VariableDefinitionSyntax)obj); } @@ -70,4 +79,4 @@ public override int GetHashCode() return hashCode; } } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/VariableDefinitionSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/VariableDefinitionSyntaxExtensions.cs index ba718bad6..737d4cd84 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/VariableDefinitionSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/VariableDefinitionSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class VariableDefinitionSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/VariableSyntax.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/VariableSyntax.cs index 3e9c23b0f..956129aac 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/VariableSyntax.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/VariableSyntax.cs @@ -31,9 +31,15 @@ public override IEnumerable Children public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } return obj is VariableSyntax && Equals((VariableSyntax)obj); } @@ -43,4 +49,4 @@ public override bool Equals(object? obj) public override object GetValue() => $"${Name.Value}"; public override string ToString() => $"${Name}"; -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Syntax/VariableSyntaxExtensions.cs b/src/GraphZen.LanguageModel/LanguageModel/Syntax/VariableSyntaxExtensions.cs index 6e83a2b96..5706250ba 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Syntax/VariableSyntaxExtensions.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Syntax/VariableSyntaxExtensions.cs @@ -6,4 +6,4 @@ namespace GraphZen.LanguageModel; [UsedImplicitly] public static class VariableSyntaxExtensions { -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/DocumentValidationContext.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/DocumentValidationContext.cs index ca5aa57d1..54035e650 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Validation/DocumentValidationContext.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/DocumentValidationContext.cs @@ -16,4 +16,4 @@ public DocumentValidationContext(DocumentSyntax schema, DocumentSyntax? initialS public DocumentSyntax Schema => AST; -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/DocumentValidationRuleVisitor.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/DocumentValidationRuleVisitor.cs index 72df28bbc..58e5ec6c1 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Validation/DocumentValidationRuleVisitor.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/DocumentValidationRuleVisitor.cs @@ -8,4 +8,4 @@ public abstract class DocumentValidationRuleVisitor : ValidationRuleVisitor protected DocumentValidationRuleVisitor(DocumentValidationContext context) : base(context) { } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/DocumentValidationRules.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/DocumentValidationRules.cs index 66a44afa5..37ffe7b4b 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Validation/DocumentValidationRules.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/DocumentValidationRules.cs @@ -90,4 +90,4 @@ public static class DocumentValidationRules ObjectsMustHaveFields, InputObjectFieldsMustHaveInputTypes }).ToList(); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/ParallelValidationVisitor.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/ParallelValidationVisitor.cs index f7e11daf4..fd49d857c 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Validation/ParallelValidationVisitor.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/ParallelValidationVisitor.cs @@ -22,4 +22,4 @@ public override void OnLeave(SyntaxNode node) base.OnLeave(node); _validationContext.Leave(node); } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/EnumTypesMustBeWellDefined.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/EnumTypesMustBeWellDefined.cs index 6fa4eabbd..b279f5b6d 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/EnumTypesMustBeWellDefined.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/EnumTypesMustBeWellDefined.cs @@ -58,4 +58,4 @@ public override VisitAction LeaveDocument(DocumentSyntax node) return false; } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/FieldArgsMustBeProperlynamed.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/FieldArgsMustBeProperlynamed.cs index 0b82001b3..9386a4d7e 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/FieldArgsMustBeProperlynamed.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/FieldArgsMustBeProperlynamed.cs @@ -8,4 +8,4 @@ public class FieldArgsMustBeProperlyNamed : DocumentValidationRuleVisitor public FieldArgsMustBeProperlyNamed(DocumentValidationContext context) : base(context) { } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/FieldArgumentsMustHaveInputTypes.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/FieldArgumentsMustHaveInputTypes.cs index 95a69b898..237b7ceea 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/FieldArgumentsMustHaveInputTypes.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/FieldArgumentsMustHaveInputTypes.cs @@ -27,12 +27,14 @@ public override VisitAction LeaveDocument(DocumentSyntax node) var argNamedType = arg.Type.GetNamedType(); var inputType = inputTypes.FirstOrDefault(_ => _.Name.Equals(argNamedType.Name)); if (inputType == null) + { ReportError( $"The type of {typeName}.{field}({arg}:) must be Input Type but got: {arg.Type}.", arg); + } } return false; } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/InputObjectFieldsMustHaveInputTypes.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/InputObjectFieldsMustHaveInputTypes.cs index 323f6cf72..c4ef617fd 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/InputObjectFieldsMustHaveInputTypes.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/InputObjectFieldsMustHaveInputTypes.cs @@ -21,10 +21,12 @@ public override VisitAction LeaveDocument(DocumentSyntax node) var fieldNamedType = field.Type.GetNamedType(); var inputFieldType = inputTypes.FirstOrDefault(_ => _.Name.Equals(fieldNamedType.Name)); if (inputFieldType == null) + { ReportError($"The type of {inputObject}.{field} must be Input Type but got: {field.Type}.", field.Type); + } } return false; } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/InputObjectsMustHaveFields.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/InputObjectsMustHaveFields.cs index a7a4fc67e..0415a7a0a 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/InputObjectsMustHaveFields.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/InputObjectsMustHaveFields.cs @@ -43,21 +43,25 @@ public override VisitAction LeaveDocument(DocumentSyntax node) .Concat(inputExts.SelectMany(_ => _.Fields)) .ToArray(); if (!inputFields.Any()) + { ReportError($"Input Object type {input.Key} must define one or more fields.", // ReSharper disable twice PossibleNullReferenceException input.Value.Select(_ => _.Name).Concat(inputExts.Select(_ => _.Name)).ToArray()); + } foreach (var inputField in inputFields) { var inputFieldNamedType = inputField.Type.GetNamedType(); var inputType = inputTypes.FirstOrDefault(_ => _.Name.Value == inputFieldNamedType.Name.Value); if (inputType == null) + { ReportError( $"The type of {input.Key}.{inputField} must be Input Type but got: {inputField.Type}.", inputField.Type); + } } } return false; } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/InterfaceExtensionsShouldBeValid.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/InterfaceExtensionsShouldBeValid.cs index 50f90ba0b..50532ec47 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/InterfaceExtensionsShouldBeValid.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/InterfaceExtensionsShouldBeValid.cs @@ -45,9 +45,11 @@ public override VisitAction LeaveDocument(DocumentSyntax node) { // TODO: check if implemented field type is a subtype of expected field type if (!implementedField.FieldType.Equals(expectedField.FieldType)) + { ReportError( $"Interface field {implementedInterface}.{expectedField} expects type {expectedField.FieldType} but {objectType}.{implementedField} is type {implementedField.FieldType}.", expectedField.FieldType, implementedField.FieldType); + } foreach (var expectedArg in expectedField.Arguments) { @@ -55,9 +57,11 @@ public override VisitAction LeaveDocument(DocumentSyntax node) // ReSharper disable once PossibleNullReferenceException _.Name.Value == expectedArg.Name.Value && _.Type.Equals(expectedArg.Type)); if (implementedArg == null) + { ReportError( $"Interface field argument {implementedInterface}.{expectedField}({expectedArg.Name}:) expected but {objectType}.{implementedField} does not provide it.", expectedArg, implementedField); + } } } } @@ -66,4 +70,4 @@ public override VisitAction LeaveDocument(DocumentSyntax node) return false; } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/InterfaceFieldsMustHaveOutputTypes.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/InterfaceFieldsMustHaveOutputTypes.cs index 62b7111be..3cba0b22d 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/InterfaceFieldsMustHaveOutputTypes.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/InterfaceFieldsMustHaveOutputTypes.cs @@ -28,11 +28,13 @@ public override VisitAction LeaveDocument(DocumentSyntax node) var outputType = outputTypes.FirstOrDefault(_ => _.Name.Equals(fieldNamedType.Name)); if (outputType == null) + { ReportError( $"The type of {typeName}.{field} must be Output Type but got: {field.FieldType}.", field.FieldType); + } } return false; } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/LoneSchemaDefinition.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/LoneSchemaDefinition.cs index 9b2afa061..db4cd6386 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/LoneSchemaDefinition.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/LoneSchemaDefinition.cs @@ -8,4 +8,4 @@ public class LoneSchemaDefinition : DocumentValidationRuleVisitor public LoneSchemaDefinition(DocumentValidationContext context) : base(context) { } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/ObjectFieldsMustHaveOutputTypes.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/ObjectFieldsMustHaveOutputTypes.cs index bebc810ba..e5950e823 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/ObjectFieldsMustHaveOutputTypes.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/ObjectFieldsMustHaveOutputTypes.cs @@ -13,16 +13,20 @@ public override VisitAction LeaveDocument(DocumentSyntax node) { var outputTypes = node.GetOutputTypeDefinitions(); foreach (var objectType in outputTypes.OfType()) - foreach (var field in objectType.Fields) { - var innerFieldType = field.FieldType.GetNamedType(); - var isOutputType = outputTypes.Any(_ => _.Name.Value == innerFieldType.Name.Value); - if (!isOutputType) - ReportError( - $"The type of {objectType}.{field} must be Output Type but got: {field.FieldType}.", - field.FieldType); + foreach (var field in objectType.Fields) + { + var innerFieldType = field.FieldType.GetNamedType(); + var isOutputType = outputTypes.Any(_ => _.Name.Value == innerFieldType.Name.Value); + if (!isOutputType) + { + ReportError( + $"The type of {objectType}.{field} must be Output Type but got: {field.FieldType}.", + field.FieldType); + } + } } return false; } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/ObjectsCanOnlyImplementUniqueInterfaces.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/ObjectsCanOnlyImplementUniqueInterfaces.cs index b10d28c0f..f7ed9008c 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/ObjectsCanOnlyImplementUniqueInterfaces.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/ObjectsCanOnlyImplementUniqueInterfaces.cs @@ -30,15 +30,19 @@ public override VisitAction LeaveDocument(DocumentSyntax node) // ReSharper disable once PossibleNullReferenceException var interfaceName = @interface.Name.Value; if (!interfaces.Contains(interfaceName)) + { ReportError( $"Type {objectName} must only implement Interface types, it cannot implement {interfaceName}.", @interface); + } if (interfacesByName.Count > 1) + { ReportError($"Type {objectName} can only implement {interfaceName} once.", interfacesByName); + } } } return false; } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/ObjectsMustAdhereToInterfaceTheyImplement.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/ObjectsMustAdhereToInterfaceTheyImplement.cs index 9c6a5969e..cf46c8984 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/ObjectsMustAdhereToInterfaceTheyImplement.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/ObjectsMustAdhereToInterfaceTheyImplement.cs @@ -37,27 +37,34 @@ public override VisitAction LeaveDocument(DocumentSyntax schema) foreach (var @interface in interfaces) { if (interfaceFieldMap.TryGetValue(@interface, out var interfaceFields)) + { foreach (var interfaceField in interfaceFields) { if (fieldMap.TryGetValue(interfaceField.Name, out var objectField)) { if (!schema.IsTypeSubTypeOf(objectField.FieldType, interfaceField.FieldType)) + { ReportError( $"Interface field {@interface}.{interfaceField} expects type {interfaceField.FieldType} but {objectType}.{objectField} is type {objectField.FieldType}.", objectField.FieldType, interfaceField.FieldType); + } foreach (var interfaceArg in interfaceField.Arguments) { var objectArg = objectField.Arguments.FirstOrDefault(_ => _.Name.Equals(interfaceArg.Name)); if (objectArg == null) + { ReportError( $"Interface field argument {@interface}.{interfaceField}({interfaceArg}:) expected but {objectType}.{objectField} does not provide it.", interfaceArg, objectField); + } else if (!objectArg.Type.Equals(interfaceArg.Type)) + { ReportError( $"Interface field argument {@interface}.{interfaceField}({interfaceArg}:) expects type {interfaceArg.Type} but {objectType}.{objectField}({objectArg}:) is type {objectArg.Type}.", interfaceArg.Type, objectArg.Type); + } } foreach (var objectArg in objectField.Arguments) @@ -65,9 +72,11 @@ public override VisitAction LeaveDocument(DocumentSyntax schema) var interfaceArg = interfaceField.Arguments.FirstOrDefault(_ => _.Name.Equals(objectArg.Name)); if (interfaceArg == null && objectArg.IsRequiredArgument()) + { ReportError( $"Object field {objectType}.{objectField} includes required argument {objectArg} that is missing from the Interface field {@interface}.{interfaceField}.", objectArg, interfaceField); + } } } else @@ -77,6 +86,7 @@ public override VisitAction LeaveDocument(DocumentSyntax schema) interfaceField, objectType.Name); } } + } } // Validate object impelments interfaces @@ -85,4 +95,4 @@ public override VisitAction LeaveDocument(DocumentSyntax schema) return false; } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/ObjectsMustHaveFields.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/ObjectsMustHaveFields.cs index 221e2c3af..f778b8c5d 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/ObjectsMustHaveFields.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/ObjectsMustHaveFields.cs @@ -56,4 +56,4 @@ public override VisitAction LeaveDocument(DocumentSyntax node) return false; } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/SchemaMustHaveRootObjectTypes.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/SchemaMustHaveRootObjectTypes.cs index a30f3cff2..9eec46983 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/SchemaMustHaveRootObjectTypes.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/SchemaMustHaveRootObjectTypes.cs @@ -27,10 +27,14 @@ public override VisitAction LeaveDocument(DocumentSyntax node) .FirstOrDefault(_ => _.Name.Value == queryTypeName); var queryRootOperationType = (SyntaxNode?)queryRootOpeartionTypeDef?.Type ?? queryType; if (queryType == null) + { ReportError("Query root type must be provided.", _schema!); + } else if (!(queryType is ObjectTypeDefinitionSyntax)) + { ReportError($"Query root type must be Object type, it cannot be {queryType.Name.Value}.", queryRootOperationType!); + } var mutationRootOpeartionTypeDef = _schema?.RootOperationTypes.FirstOrDefault(_ => _.OperationType == OperationType.Mutation); @@ -39,9 +43,11 @@ public override VisitAction LeaveDocument(DocumentSyntax node) .FirstOrDefault(_ => _.Name.Value == mutationTypeName); var mutationRootOperationType = (SyntaxNode?)mutationRootOpeartionTypeDef?.Type ?? mutationType; if (mutationType != null && !(mutationType is ObjectTypeDefinitionSyntax)) + { ReportError( $"Mutation root type must be Object type if provided, it cannot be {mutationType.Name.Value}.", mutationRootOperationType!); + } var subscriptionRootOpeartionTypeDef = _schema?.RootOperationTypes.FirstOrDefault(_ => _.OperationType == OperationType.Subscription); @@ -51,10 +57,12 @@ public override VisitAction LeaveDocument(DocumentSyntax node) var subscriptionRootOperationType = (SyntaxNode?)subscriptionRootOpeartionTypeDef?.Type ?? subscriptionType; if (subscriptionType != null && !(subscriptionType is ObjectTypeDefinitionSyntax)) + { ReportError( $"Subscription root type must be Object type if provided, it cannot be {subscriptionType.Name.Value}.", subscriptionRootOperationType!); + } return true; } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/UnionTypesMustBeValid.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/UnionTypesMustBeValid.cs index 910aff007..d9bd8f944 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/UnionTypesMustBeValid.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/Rules/UnionTypesMustBeValid.cs @@ -44,7 +44,9 @@ public override VisitAction LeaveDocument(DocumentSyntax node) // ReSharper disable once PossibleNullReferenceException var types = union.MemberTypes.Concat(unionExtensions.SelectMany(_ => _.Types)).ToList(); if (!types.Any()) + { ReportError($"Union type {unionTypeName} must define one or more member types.", nodes); + } // ReSharper disable once PossibleNullReferenceException foreach (var duplicateTypes in types @@ -64,12 +66,14 @@ public override VisitAction LeaveDocument(DocumentSyntax node) return _.Name.Value == type.Name.Value; }); if (objectType == null) + { ReportError( $"Union type {unionTypeName} can only include Object types, it cannot include {type.Name.Value}.", type); + } } } return false; } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/ValidationContext.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/ValidationContext.cs index 08fd866fd..fd27b72e0 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Validation/ValidationContext.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/ValidationContext.cs @@ -39,4 +39,4 @@ public void ReportError(GraphQLServerError error) public IReadOnlyCollection GetErrors() => Errors.AsReadOnly(); -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/ValidationRule.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/ValidationRule.cs index 997bbc0f8..48ee43dc0 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Validation/ValidationRule.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/ValidationRule.cs @@ -3,4 +3,4 @@ namespace GraphZen.LanguageModel.Validation; -public delegate ValidationRuleVisitor ValidationRule(ValidationContext context); \ No newline at end of file +public delegate ValidationRuleVisitor ValidationRule(ValidationContext context); diff --git a/src/GraphZen.LanguageModel/LanguageModel/Validation/ValidationRuleVisitor.cs b/src/GraphZen.LanguageModel/LanguageModel/Validation/ValidationRuleVisitor.cs index 363d6ff06..12228bdf7 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/Validation/ValidationRuleVisitor.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/Validation/ValidationRuleVisitor.cs @@ -24,4 +24,4 @@ public void ReportError(string message, IReadOnlyList nodes) { ReportError(new GraphQLServerError(message, nodes)); } -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/VisitAction.cs b/src/GraphZen.LanguageModel/LanguageModel/VisitAction.cs index e27bd7677..d1903dc9b 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/VisitAction.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/VisitAction.cs @@ -10,4 +10,4 @@ public abstract class VisitAction public static VisitAction Skip { get; } = new Skip(); public static implicit operator VisitAction(bool value) => value ? Continue : Skip; -} \ No newline at end of file +} diff --git a/src/GraphZen.LanguageModel/LanguageModel/VistitorContext.cs b/src/GraphZen.LanguageModel/LanguageModel/VistitorContext.cs index 5b0d5530e..81d60db3d 100644 --- a/src/GraphZen.LanguageModel/LanguageModel/VistitorContext.cs +++ b/src/GraphZen.LanguageModel/LanguageModel/VistitorContext.cs @@ -5,4 +5,4 @@ namespace GraphZen.LanguageModel; public class VistitorContext { -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/AssemblyAttributes.cs b/src/GraphZen.QueryEngine/AssemblyAttributes.cs index 5dc084b98..a6907dfd6 100644 --- a/src/GraphZen.QueryEngine/AssemblyAttributes.cs +++ b/src/GraphZen.QueryEngine/AssemblyAttributes.cs @@ -3,4 +3,4 @@ using System.Runtime.CompilerServices; -[assembly: InternalsVisibleTo("GraphZen.Tests")] \ No newline at end of file +[assembly: InternalsVisibleTo("GraphZen.Tests")] diff --git a/src/GraphZen.QueryEngine/GlobalUsings.cs b/src/GraphZen.QueryEngine/GlobalUsings.cs index b455400ef..43a56dcd6 100644 --- a/src/GraphZen.QueryEngine/GlobalUsings.cs +++ b/src/GraphZen.QueryEngine/GlobalUsings.cs @@ -4,4 +4,4 @@ global using GraphZen.Infrastructure; global using GraphZen.LanguageModel; global using GraphZen.TypeSystem; -global using GraphZen.TypeSystem.Taxonomy; \ No newline at end of file +global using GraphZen.TypeSystem.Taxonomy; diff --git a/src/GraphZen.QueryEngine/QueryEngine/Execute.cs b/src/GraphZen.QueryEngine/QueryEngine/Execute.cs index fca950ce9..ca630b2cf 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/Execute.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/Execute.cs @@ -5,4 +5,4 @@ namespace GraphZen.QueryEngine; internal static class Execute { -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/ExecutionContext.cs b/src/GraphZen.QueryEngine/QueryEngine/ExecutionContext.cs index 23b6cd170..639fb7adf 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/ExecutionContext.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/ExecutionContext.cs @@ -62,7 +62,10 @@ private static Maybe DefaultFieldResovler(object source, dynamic args, GraphQLContext context, ResolveInfo info) { - if (source == null) return Maybe.None(); + if (source == null) + { + return Maybe.None(); + } var fieldNameFirstCharUpper = info.FieldName.FirstCharToUpper(); Debug.Assert(fieldNameFirstCharUpper != null, nameof(fieldNameFirstCharUpper) + " != null"); @@ -84,26 +87,38 @@ private static Maybe DefaultFieldResovler(object source, dynamic args, if (i == 0) { if (parameterType == typeof(object) || parameterType == typeof(DynamicDictionary)) + { parameters.Add(args); + } else + { throw new Exception( $"The arguments resolver parameter had an unexpected type of \"{parameterType}\". Expected either \"{typeof(object)}\" or \"{typeof(DynamicDictionary)}\"."); + } } else if (i == 1) { if (parameterType.IsAssignableFrom(typeof(GraphQLContext))) + { parameters.Add(context); + } else + { throw new Exception( $"The context resolver parameter had an unexpected type of \"{parameterType}\". Expected a type of \"{typeof(GraphQLContext)}\"."); + } } else if (i == 2) { if (parameterType == typeof(ResolveInfo)) + { parameters.Add(info); + } else + { throw new Exception( $"The context resolver parameter had an unexpected type of \"{parameterType}\". Expected a type of \"{typeof(GraphQLContext)}\"."); + } } else { @@ -119,11 +134,17 @@ private static Maybe DefaultFieldResovler(object source, dynamic args, } var field = type.GetField(fieldNameFirstCharUpper) ?? type.GetField(info.FieldName); - if (field != null) return Maybe.Some(field.GetValue(source)!); + if (field != null) + { + return Maybe.Some(field.GetValue(source)!); + } var method = type.GetMethod(fieldNameFirstCharUpper) ?? type.GetMethod(info.FieldName); - if (method != null) return InvokeMethodByArgName(method); + if (method != null) + { + return InvokeMethodByArgName(method); + } Maybe InvokeMethodByArgName(MethodInfo mi) { @@ -192,9 +213,13 @@ internal static Maybe Build( { case OperationDefinitionSyntax operationDefinition: if (operation != null && operationName == null) + { hasMultipleAssumedOperations = true; + } else if (operationName == null || operationDefinition.Name?.Value == operationName) + { operation = operationDefinition; + } break; case FragmentDefinitionSyntax fragmentDefinition: @@ -206,9 +231,13 @@ internal static Maybe Build( if (operation == null) { if (operationName != null) + { errors.Add(new GraphQLServerError($"Unkown operation named '{operationName}'")); + } else + { errors.Add(new GraphQLServerError("Must provide an operation")); + } } else if (hasMultipleAssumedOperations) { @@ -223,12 +252,19 @@ internal static Maybe Build( operation.VariableDefinitions, rawVariableValues ?? new Dictionary()); if (coercedVariableValues is Some> some) + { variableValues = some.Value; + } else if (coercedVariableValues is None> none) + { errors.AddRange(none.Errors); + } } - if (!errors.IsEmpty) return Maybe.None(errors); + if (!errors.IsEmpty) + { + return Maybe.None(errors); + } var exeContext = new ExecutionContext(schema, rootValue, fragments, context, operation!, variableValues!, errors, options); @@ -266,4 +302,4 @@ public PreBuiltSchemaContext(Schema schema) : base(schema) { } } -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/ExecutionFunctions.cs b/src/GraphZen.QueryEngine/QueryEngine/ExecutionFunctions.cs index 2a0e8b595..90f735f73 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/ExecutionFunctions.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/ExecutionFunctions.cs @@ -84,7 +84,10 @@ internal static async Task ExecuteAsync( catch (Exception e) { exeContext.AddError(e); - if (exeContext.Options.ThrowOnError) throw; + if (exeContext.Options.ThrowOnError) + { + throw; + } return null; } @@ -147,7 +150,10 @@ internal static async Task ExecuteAsync( var maybeResult = await ResolveFieldAsync(exeContext, parentType, sourceValue, nodes, fieldPath); - if (maybeResult is Some someResult) results[responseName] = someResult.Value; + if (maybeResult is Some someResult) + { + results[responseName] = someResult.Value; + } } return results; @@ -163,8 +169,10 @@ private static async Task> ResolveFieldAsync( var fieldName = fieldNode.Name.Value; var fieldDef = GetFieldDef(exeContext, exeContext.Schema, parentType, fieldName); - if (fieldDef == null) return Maybe.None(); - + if (fieldDef == null) + { + return Maybe.None(); + } var info = exeContext.Build(fieldDef, fieldNodes, parentType, path); @@ -185,19 +193,24 @@ private static async Task> CompleteValueCatchingErrorAsync(Executi try { if (maybeResult is Some someResult) + { if (someResult.Value is Task awaitable) { await awaitable; var result = awaitable.GetResult(); maybeResult = Maybe.Some(result!); } + } var completed = await CompleteValueAsync(exeContext, returnType, fieldNodes, info, path, maybeResult); return completed; } catch (GraphQLException e) { - if (exeContext.Options.ThrowOnError) throw; + if (exeContext.Options.ThrowOnError) + { + throw; + } exeContext.Errors.Add(e.GraphQLError.WithLocationInfo(fieldNodes, path)); return Maybe.Some(null!); @@ -205,7 +218,10 @@ private static async Task> CompleteValueCatchingErrorAsync(Executi catch (Exception e) { exeContext.AddError(e); - if (exeContext.Options.ThrowOnError) throw; + if (exeContext.Options.ThrowOnError) + { + throw; + } return Maybe.Some(null!); } @@ -218,7 +234,10 @@ private static async Task> CompleteValueAsync( ResponsePath path, Maybe maybeResult) { - if (maybeResult is None none) none.ThrowFirstErrorOrDefault(); + if (maybeResult is None none) + { + none.ThrowFirstErrorOrDefault(); + } if (maybeResult is Some some) { @@ -234,20 +253,32 @@ private static async Task> CompleteValueAsync( $"Cannot return null for non - nullable field {info.ParentType.Name}.{info.FieldName}."); } - if (result == null) return Maybe.Some(null!); + if (result == null) + { + return Maybe.Some(null!); + } if (returnType is ListType listType) + { return await CompleteListValueAsync(exeContext, listType, fieldNodes, info, path, result); + } - if (returnType is ILeafType leafType) return CompleteLeafValue(leafType, result); + if (returnType is ILeafType leafType) + { + return CompleteLeafValue(leafType, result); + } if (returnType is IAbstractType abstractType) + { return await CompleteAbstractValueAsync(exeContext, abstractType, fieldNodes, info, path, result); + } if (returnType is ObjectType objectReturnType) + { return await CompleteObjectValueAsync(exeContext, objectReturnType, fieldNodes, info, path, result); + } } throw new GraphQLException($@"Cannot complete value of unexpected type ""{returnType?.GetType()}""."); @@ -305,11 +336,13 @@ private static ObjectType EnsureValidRuntimeType( } if (!exeContext.Schema.IsPossibleType(returnType, runtimeObjectType)) + { throw new GraphQLException( $"Runtime Object type \"{runtimeObjectType.Name}\" is not a possible type " + $"for \"{returnType.Name}\".", fieldNodes ); + } return runtimeObjectType; } @@ -346,8 +379,10 @@ private static async Task> CompleteObjectValueAsync( foreach (var fieldNode in fieldNodes) { if (fieldNode.SelectionSet != null) + { subFieldNodes = CollectFields(exeContext, returnType, fieldNode.SelectionSet, subFieldNodes, visitedFargmentNames); + } } return ExecuteFieldsAsync(exeContext, returnType, result, path, subFieldNodes); @@ -357,7 +392,9 @@ private static Maybe CompleteLeafValue(ILeafType returnType, object resu { var serializedResult = returnType.Serialize(result); if (serializedResult is None none) + { none.ThrowFirstErrorOrDefault($@"Expected a value of type `{returnType}` but received: {result}"); + } return serializedResult; } @@ -369,8 +406,10 @@ private static async Task> CompleteListValueAsync(ExecutionContext ResolveInfo info, ResponsePath path, object result) { if (result is string || !(result is IEnumerable collection)) + { throw new InvalidOperationException( $"Expected IEnumerable, but did not find one for field {info.ParentType.Name}"); + } var itemType = returnType.OfType; // var containsTask = false; @@ -383,10 +422,14 @@ private static async Task> CompleteListValueAsync(ExecutionContext var completedItem = await CompleteValueCatchingErrorAsync(exeContext, itemType, fieldNodes, info, fieldPath, itemValue); if (completedItem is Some some) + { completedResults.Add(some.Value); + } else + { throw new InvalidOperationException( $"There should always be a value produced by {nameof(CompleteValueCatchingErrorAsync)}"); + } index++; } @@ -413,9 +456,13 @@ private static async Task> ResolveFieldValueOrErrorAsync(Execution { var defaultResolverResult = exeContext.FieldResolver(sourceValue!, args, context, info); if (defaultResolverResult is Some someResult) + { result = someResult.Value; + } else + { Maybe.None(); + } } if (result is Task resultTask && result.GetType() != typeof(Task)) @@ -432,7 +479,10 @@ private static async Task> ResolveFieldValueOrErrorAsync(Execution } catch (Exception e) { - if (exeContext.Options.ThrowOnError) throw; + if (exeContext.Options.ThrowOnError) + { + throw; + } return Maybe.None(new GraphQLServerError(e.Message, fieldNodes, null, null, info.Path.AsReadOnlyList(), e)); @@ -445,16 +495,25 @@ private static async Task> ResolveFieldValueOrErrorAsync(Execution string fieldName) { if (fieldName == Introspection.SchemaMetaFieldDef.Name && schema.QueryType.Equals(parentType)) + { return Introspection.SchemaMetaFieldDef; + } if (fieldName == Introspection.TypeMetaFieldDef.Name && schema.QueryType.Equals(parentType)) + { return Introspection.TypeMetaFieldDef; + } - if (fieldName == Introspection.TypeNameMetaFieldDef.Name) return Introspection.TypeNameMetaFieldDef; + if (fieldName == Introspection.TypeNameMetaFieldDef.Name) + { + return Introspection.TypeNameMetaFieldDef; + } var field = parentType.FindField(fieldName); if (field == null && exeContext.Options.ThrowOnError) + { throw new Exception($"Unable to find field \"{fieldName}\" on {parentType.Name}"); + } return field; } @@ -470,17 +529,24 @@ internal static Dictionary> CollectFields(ExecutionCon switch (selection) { case FieldSyntax field: - if (!ShouldIncludeNode(exeContext, field)) continue; + if (!ShouldIncludeNode(exeContext, field)) + { + continue; + } if (!fields.ContainsKey(field.FieldEntryKey)) + { fields[field.FieldEntryKey] = new List(); + } fields[field.FieldEntryKey]?.Add(field); break; case InlineFragmentSyntax inlineFragment: if (!ShouldIncludeNode(exeContext, selection) || !DoesFragmentConditionMatch(exeContext, inlineFragment, runtimeType)) + { continue; + } CollectFields(exeContext, runtimeType, inlineFragment.SelectionSet, fields, visitedFragmentNames); @@ -489,13 +555,17 @@ internal static Dictionary> CollectFields(ExecutionCon var fragName = fragmentSpread.Name.Value; if (visitedFragmentNames.ContainsKey(fragName) || !ShouldIncludeNode(exeContext, fragmentSpread)) + { continue; + } visitedFragmentNames[fragName] = true; if (!exeContext.Fragments.TryGetValue(fragName, out var fragment) || !DoesFragmentConditionMatch(exeContext, fragment, runtimeType)) + { continue; + } CollectFields(exeContext, runtimeType, fragment.SelectionSet, fields, visitedFragmentNames); @@ -509,13 +579,21 @@ internal static Dictionary> CollectFields(ExecutionCon internal static bool DoesFragmentConditionMatch(ExecutionContext exeContext, IFragmentTypeConditionSyntax fragment, ObjectType type) { - if (fragment.TypeCondition == null) return true; + if (fragment.TypeCondition == null) + { + return true; + } var conditionalType = exeContext.Schema.GetTypeFromAst(fragment.TypeCondition); - if (type.Equals(conditionalType)) return true; + if (type.Equals(conditionalType)) + { + return true; + } if (conditionalType is IAbstractType abstractType) + { return exeContext.Schema.IsPossibleType(abstractType, type); + } return false; } @@ -524,11 +602,17 @@ internal static bool DoesFragmentConditionMatch(ExecutionContext exeContext, internal static bool ShouldIncludeNode(ExecutionContext exeContext, SyntaxNode node) { var skip = Values.GetDirectiveValues(SpecDirectives.Skip, node, exeContext.VariableValues); - if (skip != null && skip["if"] == true) return false; + if (skip != null && skip["if"] == true) + { + return false; + } var include = Values.GetDirectiveValues(SpecDirectives.Include, node, exeContext.VariableValues); - if (include != null && include["if"] == false) return false; + if (include != null && include["if"] == false) + { + return false; + } return true; } -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/ExecutionOptions.cs b/src/GraphZen.QueryEngine/QueryEngine/ExecutionOptions.cs index bd9311aec..2bcece9e9 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/ExecutionOptions.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/ExecutionOptions.cs @@ -6,4 +6,4 @@ namespace GraphZen.QueryEngine; public class ExecutionOptions { public bool ThrowOnError { get; set; } -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/ExecutionResult.cs b/src/GraphZen.QueryEngine/QueryEngine/ExecutionResult.cs index 9a56125b5..cad0f893f 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/ExecutionResult.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/ExecutionResult.cs @@ -22,4 +22,4 @@ public ExecutionResult(IDictionary? data, IEnumerable? Errors => _errors.Any() ? _errors : null; -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/Executor.cs b/src/GraphZen.QueryEngine/QueryEngine/Executor.cs index 9d787ac98..71a532399 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/Executor.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/Executor.cs @@ -11,4 +11,4 @@ public Task ExecuteAsync(Schema schema, DocumentSyntax document ExecutionOptions? options = null) => ExecutionFunctions.ExecuteAsync(schema, document, rootValue, context, variableValues, operationName, options); -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/IExecutionContext.cs b/src/GraphZen.QueryEngine/QueryEngine/IExecutionContext.cs index 308259092..e1e089fc3 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/IExecutionContext.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/IExecutionContext.cs @@ -5,4 +5,4 @@ namespace GraphZen.QueryEngine; public interface IExecutionContext { -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/IExecutor.cs b/src/GraphZen.QueryEngine/QueryEngine/IExecutor.cs index b0b43d1a5..a285ea2ce 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/IExecutor.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/IExecutor.cs @@ -9,4 +9,4 @@ Task ExecuteAsync(Schema schema, DocumentSyntax document, objec GraphQLContext? context = null, IDictionary? variableValues = null, string? operationName = null, ExecutionOptions? options = null); -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/Validation/IQueryValidator.cs b/src/GraphZen.QueryEngine/QueryEngine/Validation/IQueryValidator.cs index bb6dcc301..4f2c57875 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/Validation/IQueryValidator.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/Validation/IQueryValidator.cs @@ -6,4 +6,4 @@ namespace GraphZen.QueryEngine.Validation; public interface IQueryValidator { IReadOnlyCollection Validate(Schema schema, DocumentSyntax query); -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/Validation/QueryValidationContext.cs b/src/GraphZen.QueryEngine/QueryEngine/Validation/QueryValidationContext.cs index 576f10b4b..241e7a908 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/Validation/QueryValidationContext.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/Validation/QueryValidationContext.cs @@ -58,4 +58,4 @@ public override void Leave(SyntaxNode node) public IGraphQLType? GetInputType() => TypeInfo.GetInputType(); public IGraphQLType? GetParentInputType() => TypeInfo.GetParentInputType(); -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/Validation/QueryValidationRuleVisitor.cs b/src/GraphZen.QueryEngine/QueryEngine/Validation/QueryValidationRuleVisitor.cs index c8537ab70..eb4d65706 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/Validation/QueryValidationRuleVisitor.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/Validation/QueryValidationRuleVisitor.cs @@ -16,4 +16,4 @@ protected QueryValidationRuleVisitor(QueryValidationContext context) : base(cont public TypeInfo TypeInfo => Context.TypeInfo; -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/Validation/QueryValidationRules.cs b/src/GraphZen.QueryEngine/QueryEngine/Validation/QueryValidationRules.cs index 29b40f431..4671cf889 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/Validation/QueryValidationRules.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/Validation/QueryValidationRules.cs @@ -141,4 +141,4 @@ public static class QueryValidationRules OverlappingFieldsCanBeMerged, UniqueInputFieldNames }; -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/Validation/QueryValidator.cs b/src/GraphZen.QueryEngine/QueryEngine/Validation/QueryValidator.cs index 5dbc444b7..932fcfd1a 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/Validation/QueryValidator.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/Validation/QueryValidator.cs @@ -25,4 +25,4 @@ public IReadOnlyCollection Validate(Schema schema, DocumentS validationVisitor.Visit(query); return validationContext.GetErrors(); } -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/ExecutableDefinitions.cs b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/ExecutableDefinitions.cs index 4f68caa7d..63e7daaa1 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/ExecutableDefinitions.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/ExecutableDefinitions.cs @@ -26,4 +26,4 @@ public override VisitAction EnterDocument(DocumentSyntax node) return false; } -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/FieldsOnCorrectType.cs b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/FieldsOnCorrectType.cs index 6a954345d..397c5ac87 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/FieldsOnCorrectType.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/FieldsOnCorrectType.cs @@ -19,8 +19,13 @@ public static string UndefinedFieldMessage( var fieldNames = suggestedFieldNames.ToArray(); var message = $"Cannot query field \"{fieldName}\" on type \"{type}\"."; if (typeNames.Any()) + { message += $" Did you mean to use an inline fragment on {typeNames.QuotedOrList()}?"; - else if (fieldNames.Any()) message += $" Did you mean {fieldNames.QuotedOrList()}?"; + } + else if (fieldNames.Any()) + { + message += $" Did you mean {fieldNames.QuotedOrList()}?"; + } return message; } @@ -56,12 +61,18 @@ private IReadOnlyList GetSuggestedTypeNames(IGraphQLType type, string fi var interfaceUsageCount = new Dictionary(); foreach (var possibleType in Context.Schema.GetPossibleTypes(abstractType)) { - if (possibleType.FindField(fieldName) == null) continue; + if (possibleType.FindField(fieldName) == null) + { + continue; + } suggestedObjectTypes.Add(possibleType.Name); foreach (var possibleInterface in possibleType.Interfaces) { - if (possibleInterface.FindField(fieldName) == null) continue; + if (possibleInterface.FindField(fieldName) == null) + { + continue; + } interfaceUsageCount.Increment(possibleInterface.Name); } @@ -87,4 +98,4 @@ private IReadOnlyList GetSuggestedFieldNames(IGraphQLType type, string f return Array.Empty(); } -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/FragmentsOnCompositeTypes.cs b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/FragmentsOnCompositeTypes.cs index a09756faa..52cede41f 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/FragmentsOnCompositeTypes.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/FragmentsOnCompositeTypes.cs @@ -22,8 +22,10 @@ public override VisitAction EnterInlineFragment(InlineFragmentSyntax node) { var type = Context.Schema.GetTypeFromAst(typeCondition); if (type != null && !(type is ICompositeType)) + { ReportError(InlineFragmentOnNonCompositeErrorMessage(typeCondition.ToSyntaxString()), typeCondition); + } } return VisitAction.Continue; @@ -34,11 +36,13 @@ public override VisitAction EnterFragmentDefinition(FragmentDefinitionSyntax nod var type = Context.Schema.GetTypeFromAst(node.TypeCondition); { if (type != null && !(type is ICompositeType)) + { ReportError( FragmentOnNonCompositeErrorMessage(node.Name.Value, node.TypeCondition.ToSyntaxString()), node.TypeCondition); + } return VisitAction.Continue; } } -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/InputDocumentNonConflictingVariableInference.cs b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/InputDocumentNonConflictingVariableInference.cs index f033d4d79..e1d05329c 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/InputDocumentNonConflictingVariableInference.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/InputDocumentNonConflictingVariableInference.cs @@ -8,4 +8,4 @@ public class InputDocumentNonConflictingVariableInference : QueryValidationRuleV public InputDocumentNonConflictingVariableInference(QueryValidationContext context) : base(context) { } -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/KnownArgumentNames.cs b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/KnownArgumentNames.cs index 6e98696e3..340b53e69 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/KnownArgumentNames.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/KnownArgumentNames.cs @@ -8,4 +8,4 @@ public class KnownArgumentNames : QueryValidationRuleVisitor public KnownArgumentNames(QueryValidationContext context) : base(context) { } -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/KnownDirectives.cs b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/KnownDirectives.cs index 7b56a8350..d3f78766a 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/KnownDirectives.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/KnownDirectives.cs @@ -35,7 +35,9 @@ public override VisitAction EnterDirective(DirectiveSyntax node) var candidateLocation = GetDirectiveLocationForAstPath(Context.Ancestors); if (candidateLocation != null && !locations.Contains(candidateLocation.Value)) + { ReportError(MisplacedDirectiveMessage(name, candidateLocation.Value.ToStringValue()), node); + } return VisitAction.Continue; } @@ -47,19 +49,19 @@ public override VisitAction EnterDirective(DirectiveSyntax node) switch (appliedTo) { case OperationDefinitionSyntax op: - { - switch (op.OperationType) { - case OperationType.Query: - return DirectiveLocation.Query; - case OperationType.Mutation: - return DirectiveLocation.Mutation; - case OperationType.Subscription: - return DirectiveLocation.Subscription; - } + switch (op.OperationType) + { + case OperationType.Query: + return DirectiveLocation.Query; + case OperationType.Mutation: + return DirectiveLocation.Mutation; + case OperationType.Subscription: + return DirectiveLocation.Subscription; + } - break; - } + break; + } case FieldSyntax _: return DirectiveLocation.Field; case FragmentSpreadSyntax _: @@ -95,14 +97,14 @@ public override VisitAction EnterDirective(DirectiveSyntax node) case InputObjectTypeExtensionSyntax _: return DirectiveLocation.InputObject; case InputValueDefinitionSyntax _: - { - var parentNode = ancestors.ElementAt(2); - return parentNode is InputObjectTypeDefinitionSyntax - ? DirectiveLocation.InputFieldDefinition - : DirectiveLocation.ArgumentDefinition; - } + { + var parentNode = ancestors.ElementAt(2); + return parentNode is InputObjectTypeDefinitionSyntax + ? DirectiveLocation.InputFieldDefinition + : DirectiveLocation.ArgumentDefinition; + } } return null; } -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/KnownFragmentNames.cs b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/KnownFragmentNames.cs index 8899208b5..fcb58a6eb 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/KnownFragmentNames.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/KnownFragmentNames.cs @@ -15,8 +15,10 @@ public override VisitAction EnterFragmentSpread(FragmentSpreadSyntax node) { var fragmentName = node.Name.Value; if (!Context.Fragments.ContainsKey(fragmentName)) + { ReportError(UnknownFragmentMessage(fragmentName), node.Name); + } return VisitAction.Continue; } -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/KnownTypeNames.cs b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/KnownTypeNames.cs index 328c5d98a..9bf233135 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/KnownTypeNames.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/KnownTypeNames.cs @@ -12,7 +12,10 @@ public KnownTypeNames(QueryValidationContext context) : base(context) public static string UnknownTypeMessage(string typeName, IReadOnlyList suggestedTypes) { var message = $"Unknown type \"{typeName}\"."; - if (suggestedTypes.Any()) return $"{message} Did you mean {suggestedTypes.QuotedOrList()}?"; + if (suggestedTypes.Any()) + { + return $"{message} Did you mean {suggestedTypes.QuotedOrList()}?"; + } return message; } @@ -36,4 +39,4 @@ public override VisitAction EnterNamedType(NamedTypeSyntax node) return VisitAction.Continue; } -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/LoneAnonymousOperation.cs b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/LoneAnonymousOperation.cs index d5d6ea2fc..1356d9d52 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/LoneAnonymousOperation.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/LoneAnonymousOperation.cs @@ -22,8 +22,11 @@ public override VisitAction EnterDocument(DocumentSyntax node) public override VisitAction EnterOperationDefinition(OperationDefinitionSyntax node) { - if (node.Name == null && _operationCount > 1) ReportError(AnonymousOperationNotAloneMessage, node); + if (node.Name == null && _operationCount > 1) + { + ReportError(AnonymousOperationNotAloneMessage, node); + } return VisitAction.Continue; } -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/NoFragmentCycles.cs b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/NoFragmentCycles.cs index 91bc609bc..3643f714e 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/NoFragmentCycles.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/NoFragmentCycles.cs @@ -8,4 +8,4 @@ public class NoFragmentCycles : QueryValidationRuleVisitor public NoFragmentCycles(QueryValidationContext context) : base(context) { } -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/NoUndefinedVariables.cs b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/NoUndefinedVariables.cs index 47e12a7be..01cec8329 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/NoUndefinedVariables.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/NoUndefinedVariables.cs @@ -8,4 +8,4 @@ public class NoUndefinedVariables : QueryValidationRuleVisitor public NoUndefinedVariables(QueryValidationContext context) : base(context) { } -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/NoUnusedFragments.cs b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/NoUnusedFragments.cs index 62d5f9c39..e3785ef8a 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/NoUnusedFragments.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/NoUnusedFragments.cs @@ -8,4 +8,4 @@ public class NoUnusedFragments : QueryValidationRuleVisitor public NoUnusedFragments(QueryValidationContext context) : base(context) { } -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/NoUnusedVariables.cs b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/NoUnusedVariables.cs index 0d90e08ba..b02db5e55 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/NoUnusedVariables.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/NoUnusedVariables.cs @@ -8,4 +8,4 @@ public class NoUnusedVariables : QueryValidationRuleVisitor public NoUnusedVariables(QueryValidationContext context) : base(context) { } -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/OverlappingFieldsCanBeMerged.cs b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/OverlappingFieldsCanBeMerged.cs index 2d787b90a..1791b19b8 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/OverlappingFieldsCanBeMerged.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/OverlappingFieldsCanBeMerged.cs @@ -8,4 +8,4 @@ public class OverlappingFieldsCanBeMerged : QueryValidationRuleVisitor public OverlappingFieldsCanBeMerged(QueryValidationContext context) : base(context) { } -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/PossibleFragmentSpreads.cs b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/PossibleFragmentSpreads.cs index a2c23cb2a..7088fbb26 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/PossibleFragmentSpreads.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/PossibleFragmentSpreads.cs @@ -8,4 +8,4 @@ public class PossibleFragmentSpreads : QueryValidationRuleVisitor public PossibleFragmentSpreads(QueryValidationContext context) : base(context) { } -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/ProvidedRequiredArguments.cs b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/ProvidedRequiredArguments.cs index 5b98631e5..7f5193fed 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/ProvidedRequiredArguments.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/ProvidedRequiredArguments.cs @@ -8,4 +8,4 @@ public class ProvidedRequiredArguments : QueryValidationRuleVisitor public ProvidedRequiredArguments(QueryValidationContext context) : base(context) { } -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/ScalarLeafs.cs b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/ScalarLeafs.cs index 52d65bda5..f978c04d7 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/ScalarLeafs.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/ScalarLeafs.cs @@ -8,4 +8,4 @@ public class ScalarLeafs : QueryValidationRuleVisitor public ScalarLeafs(QueryValidationContext context) : base(context) { } -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/SingleFieldSubscriptions.cs b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/SingleFieldSubscriptions.cs index 247687a1b..16c635480 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/SingleFieldSubscriptions.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/SingleFieldSubscriptions.cs @@ -8,4 +8,4 @@ public class SingleFieldSubscriptions : QueryValidationRuleVisitor public SingleFieldSubscriptions(QueryValidationContext context) : base(context) { } -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/UniqueArgumentNames.cs b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/UniqueArgumentNames.cs index 7547835f8..ed7797b1b 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/UniqueArgumentNames.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/UniqueArgumentNames.cs @@ -8,4 +8,4 @@ public class UniqueArgumentNames : QueryValidationRuleVisitor public UniqueArgumentNames(QueryValidationContext context) : base(context) { } -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/UniqueDirectivesPerLocation.cs b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/UniqueDirectivesPerLocation.cs index 93759e189..79f019848 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/UniqueDirectivesPerLocation.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/UniqueDirectivesPerLocation.cs @@ -8,4 +8,4 @@ public class UniqueDirectivesPerLocation : QueryValidationRuleVisitor public UniqueDirectivesPerLocation(QueryValidationContext context) : base(context) { } -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/UniqueFragmentNames.cs b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/UniqueFragmentNames.cs index b0c484b21..ed6db8372 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/UniqueFragmentNames.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/UniqueFragmentNames.cs @@ -8,4 +8,4 @@ public class UniqueFragmentNames : QueryValidationRuleVisitor public UniqueFragmentNames(QueryValidationContext context) : base(context) { } -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/UniqueInputFieldNames.cs b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/UniqueInputFieldNames.cs index 36a434f01..84d2f6dbf 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/UniqueInputFieldNames.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/UniqueInputFieldNames.cs @@ -8,4 +8,4 @@ public class UniqueInputFieldNames : QueryValidationRuleVisitor public UniqueInputFieldNames(QueryValidationContext context) : base(context) { } -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/UniqueOperationNames.cs b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/UniqueOperationNames.cs index 575b684e9..e8ba6676b 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/UniqueOperationNames.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/UniqueOperationNames.cs @@ -20,14 +20,18 @@ public override VisitAction EnterOperationDefinition(OperationDefinitionSyntax n if (operationName != null) { if (_knownOperationNames.ContainsKey(operationName.Value)) + { ReportError(DuplicateOperationNameMessage(operationName.Value), _knownOperationNames[operationName.Value], operationName); + } else + { _knownOperationNames.Add(operationName.Value, operationName); + } } return false; } public override VisitAction EnterFragmentDefinition(FragmentDefinitionSyntax node) => false; -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/UniqueVariableNames.cs b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/UniqueVariableNames.cs index 21cb71fe8..98ee2bc4f 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/UniqueVariableNames.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/UniqueVariableNames.cs @@ -8,4 +8,4 @@ public class UniqueVariableNames : QueryValidationRuleVisitor public UniqueVariableNames(QueryValidationContext context) : base(context) { } -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/ValuesOfCorrectType.cs b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/ValuesOfCorrectType.cs index f6a1370a4..d92eb6eda 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/ValuesOfCorrectType.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/ValuesOfCorrectType.cs @@ -8,4 +8,4 @@ public class ValuesOfCorrectType : QueryValidationRuleVisitor public ValuesOfCorrectType(QueryValidationContext context) : base(context) { } -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/VariablesAreInputTypes.cs b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/VariablesAreInputTypes.cs index ba0cf9bd7..ee8a74844 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/VariablesAreInputTypes.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/VariablesAreInputTypes.cs @@ -8,4 +8,4 @@ public class VariablesAreInputTypes : QueryValidationRuleVisitor public VariablesAreInputTypes(QueryValidationContext context) : base(context) { } -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/VariablesInAllowedPosition.cs b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/VariablesInAllowedPosition.cs index ff83dbc44..883e6cca6 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/VariablesInAllowedPosition.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/Validation/Rules/VariablesInAllowedPosition.cs @@ -8,4 +8,4 @@ public class VariablesInAllowedPosition : QueryValidationRuleVisitor public VariablesInAllowedPosition(QueryValidationContext context) : base(context) { } -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/QueryEngine/Values.cs b/src/GraphZen.QueryEngine/QueryEngine/Values.cs index 6bf5dda1d..a2f0c0098 100644 --- a/src/GraphZen.QueryEngine/QueryEngine/Values.cs +++ b/src/GraphZen.QueryEngine/QueryEngine/Values.cs @@ -19,7 +19,10 @@ internal static class Values if (node is IDirectivesSyntax directivesNode) { var directiveNode = directivesNode.Directives.SingleOrDefault(_ => _.Name.Value == directive.Name); - if (directiveNode != null) return GetArgumentValues(directive, directiveNode, variableValues); + if (directiveNode != null) + { + return GetArgumentValues(directive, directiveNode, variableValues); + } } return null; @@ -53,7 +56,9 @@ internal static Maybe> GetVariableValues( // If no value was provided to a variable with a default value, // use the default value. if (Helpers.ValueFromAst(varDefNode.DefaultValue, varType) is Some some) + { coercedValues[varName] = some.Value; + } } else if ((!maybeValue.HasValue || (maybeValue is Some v && v.Value == null)) && varType is NonNullType) @@ -93,7 +98,10 @@ internal static Maybe> GetVariableValues( errors.AddRange(coercionErrors); } - if (coerced is Some some) coercedValues[varName] = some.Value; + if (coerced is Some some) + { + coercedValues[varName] = some.Value; + } } } } @@ -116,7 +124,10 @@ GraphQLServerError CoercianError(string message, SyntaxNode blame, ResponsePath? var pathStr = p?.ToString(); var msg = new StringBuilder(); msg.Append(message); - if (!string.IsNullOrEmpty(pathStr)) msg.Append($" at {pathStr}"); + if (!string.IsNullOrEmpty(pathStr)) + { + msg.Append($" at {pathStr}"); + } msg.Append(!string.IsNullOrEmpty(subMessage) ? $"; {subMessage}" : "."); return new GraphQLServerError(msg.ToString(), new[] { blame }, null, null, null, originalError); @@ -125,93 +136,112 @@ GraphQLServerError CoercianError(string message, SyntaxNode blame, ResponsePath? if (type is NonNullType nonNull) { if (value == null) + { return Maybe.None(CoercianError( $"Expected non-nullable type {type} not to be null", blameNode, path)); + } return CoerceValue(value, nonNull.OfType, blameNode, path); } - if (value == null) return Maybe.Some(null!); - + if (value == null) + { + return Maybe.Some(null!); + } switch (type) { case ListType list: - { - var errors = new List(); - var itemType = list.OfType; - - if (value is ICollection collection) { - var coercedValue = new List(); - var index = 0; - foreach (var item in collection) + var errors = new List(); + var itemType = list.OfType; + + if (value is ICollection collection) { - var coerced = CoerceValue(item, itemType, blameNode, path!.AddPath(index++)); - if (coerced is Some someItem) - coercedValue.Add(someItem.Value); - else if (coerced is None none) errors.AddRange(none.Errors); + var coercedValue = new List(); + var index = 0; + foreach (var item in collection) + { + var coerced = CoerceValue(item, itemType, blameNode, path!.AddPath(index++)); + if (coerced is Some someItem) + { + coercedValue.Add(someItem.Value); + } + else if (coerced is None none) + { + errors.AddRange(none.Errors); + } + } + + return errors.Any() ? Maybe.None(errors) : Maybe.Some(coercedValue); } - return errors.Any() ? Maybe.None(errors) : Maybe.Some(coercedValue); + // Lists accept a non-list value as a list of one + return CoerceValue(value, itemType, blameNode, null).Select(_ => new[] { _ }); } - - // Lists accept a non-list value as a list of one - return CoerceValue(value, itemType, blameNode, null).Select(_ => new[] { _ }); - } case InputObjectType inputObject: - { - if (!(value is IDictionary values)) - return Maybe.None(CoercianError($"Expected {type} to be an object", blameNode, - path)); + { + if (!(value is IDictionary values)) + { + return Maybe.None(CoercianError($"Expected {type} to be an object", blameNode, + path)); + } - var coercedValue = new Dictionary(); - var errors = new List(); + var coercedValue = new Dictionary(); + var errors = new List(); - // Ensure every defined field is valid - foreach (var field in inputObject.Fields.Values) - { - var fieldValue = values.TryGetValue(field.Name, out var fv) ? fv : null; - if (fieldValue == null) + // Ensure every defined field is valid + foreach (var field in inputObject.Fields.Values) { - if (field.DefaultValue is Some someValue) - coercedValue[field.Name] = someValue.Value; - else if (field.InputType is NonNullType) - errors.Add(CoercianError( - $"Field {path!.AddPath(field.Name)} of required type {field.InputType} was not provided", - blameNode, null)); + var fieldValue = values.TryGetValue(field.Name, out var fv) ? fv : null; + if (fieldValue == null) + { + if (field.DefaultValue is Some someValue) + { + coercedValue[field.Name] = someValue.Value; + } + else if (field.InputType is NonNullType) + { + errors.Add(CoercianError( + $"Field {path!.AddPath(field.Name)} of required type {field.InputType} was not provided", + blameNode, null)); + } + } + else + { + var coercedField = CoerceValue(fieldValue, field.InputType, blameNode, + path!.AddPath(field.Name)); + if (coercedField is None erred) + { + errors.AddRange(erred.Errors); + } + else if (!errors.Any() && coercedField is Some some) + { + coercedValue[field.Name] = some.Value; + } + } } - else + + + // Ensure every provided field is defined + foreach (var fieldName in values.Keys.Where(_ => + { + Debug.Assert(_ != null, nameof(_) + " != null"); + return !inputObject.HasField(_); + })) { - var coercedField = CoerceValue(fieldValue, field.InputType, blameNode, - path!.AddPath(field.Name)); - if (coercedField is None erred) - errors.AddRange(erred.Errors); - else if (!errors.Any() && coercedField is Some some) - coercedValue[field.Name] = some.Value; + // TODO: Suggestions for subMessage in error + var suggestions = "Did you mean to select another field?"; + errors.Add(CoercianError($"Field \"{fieldName}\" is not defined by type {type}", + blameNode, + path, + suggestions)); } - } - - // Ensure every provided field is defined - foreach (var fieldName in values.Keys.Where(_ => - { - Debug.Assert(_ != null, nameof(_) + " != null"); - return !inputObject.HasField(_); - })) - { - // TODO: Suggestions for subMessage in error - var suggestions = "Did you mean to select another field?"; - errors.Add(CoercianError($"Field \"{fieldName}\" is not defined by type {type}", - blameNode, - path, - suggestions)); + return errors.Any() ? Maybe.None(errors) : Maybe.Some(coercedValue); } - - return errors.Any() ? Maybe.None(errors) : Maybe.Some(coercedValue); - } case ScalarType scalarType: try { @@ -226,7 +256,10 @@ GraphQLServerError CoercianError(string message, SyntaxNode blame, ResponsePath? if (value is string strValue) { var enumValue = enumType.FindValue(strValue); - if (enumValue != null) return Maybe.Some(enumValue.Value); + if (enumValue != null) + { + return Maybe.Some(enumValue.Value); + } } // TODO: Suggestions @@ -275,14 +308,18 @@ public static DynamicDictionary GetArgumentValues(IArguments def, else if ((!hasValue || isNull) && argType is NonNullType) { if (isNull) + { throw new GraphQLException( $"Argument \"{name}\" of non-null type \"{argType}\" must not be null.", argumentNode!.Value); + } if (argumentNode?.Value is VariableSyntax var) + { throw new GraphQLException( $"Argument \"{name}\" of required type \"{argType}\" was provided the variable \"{var}\" which was not provided a runtime value.", argumentNode.Value); + } throw new GraphQLException( $"Argument \"{name}\" of required type \"{argType}\" was not provided.", @@ -304,8 +341,10 @@ public static DynamicDictionary GetArgumentValues(IArguments def, var valueNode = argumentNode.Value; var maybeCoerced = Helpers.ValueFromAst(valueNode, argType, variableValues); if (!(maybeCoerced is Some someCoerced)) + { throw new GraphQLException( $"Argument \"{name}\" has invalid value {valueNode.GetValue().Inspect()}.", node); + } coercedValues[name] = someCoerced.Value; } @@ -314,4 +353,4 @@ public static DynamicDictionary GetArgumentValues(IArguments def, return coercedValues; } -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/Utilities/Helpers.cs b/src/GraphZen.QueryEngine/Utilities/Helpers.cs index e23244d29..1b74b83bf 100644 --- a/src/GraphZen.QueryEngine/Utilities/Helpers.cs +++ b/src/GraphZen.QueryEngine/Utilities/Helpers.cs @@ -14,16 +14,25 @@ internal static Maybe ValueFromAst(ValueSyntax? valueSyntax, IGraphQLTyp bool IsMissingVariable(ValueSyntax value, IReadOnlyDictionary? vars) => value is VariableSyntax variable && (vars == null || !vars.ContainsKey(variable.Name.Value)); - if (valueSyntax == null) return Maybe.None(); + if (valueSyntax == null) + { + return Maybe.None(); + } if (type is NonNullType nonNull) { - if (valueSyntax is NullValueSyntax) return Maybe.None(); + if (valueSyntax is NullValueSyntax) + { + return Maybe.None(); + } return ValueFromAst(valueSyntax, nonNull.OfType, variables); } - if (valueSyntax is NullValueSyntax) return Maybe.Some(null!); + if (valueSyntax is NullValueSyntax) + { + return Maybe.Some(null!); + } if (valueSyntax is VariableSyntax variableNode) { @@ -43,7 +52,10 @@ bool IsMissingVariable(ValueSyntax value, IReadOnlyDictionary? v { if (IsMissingVariable(itemNode, variables)) { - if (itemType is NonNullType) return Maybe.None(); + if (itemType is NonNullType) + { + return Maybe.None(); + } coercedValues.Add(null); } @@ -51,9 +63,13 @@ bool IsMissingVariable(ValueSyntax value, IReadOnlyDictionary? v { var itemValue = ValueFromAst(itemNode, itemType, variables); if (itemValue is Some some) + { coercedValues.Add(some.Value); + } else + { return itemValue; + } } } @@ -83,17 +99,26 @@ bool IsMissingVariable(ValueSyntax value, IReadOnlyDictionary? v IsMissingVariable(fieldNode.Value, variables)) { if (field.DefaultValue is Some someDefaultValue) + { coercedObject[field.Name] = someDefaultValue.Value; - else if (field.InputType is NonNullType) return Maybe.None(); + } + else if (field.InputType is NonNullType) + { + return Maybe.None(); + } continue; } var fieldValue = ValueFromAst(fieldNode.Value, field.InputType, variables); if (fieldValue is Some fv) + { coercedObject[field.Name] = fv.Value; + } else + { return Maybe.None(); + } } return Maybe.Some(coercedObject); @@ -103,6 +128,7 @@ bool IsMissingVariable(ValueSyntax value, IReadOnlyDictionary? v } if (type is ILeafType leafType) + { try { return leafType.ParseLiteral(valueSyntax); @@ -111,7 +137,8 @@ bool IsMissingVariable(ValueSyntax value, IReadOnlyDictionary? v { return Maybe.None(); } + } throw new Exception($"Unknown type: {type}"); } -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/Utilities/IntrospecttionQuery.cs b/src/GraphZen.QueryEngine/Utilities/IntrospecttionQuery.cs index 81b7886fe..b89ee36ef 100644 --- a/src/GraphZen.QueryEngine/Utilities/IntrospecttionQuery.cs +++ b/src/GraphZen.QueryEngine/Utilities/IntrospecttionQuery.cs @@ -194,4 +194,4 @@ fragment TypeRef on __Type { public static string IntrospectionQuery(bool descriptions = true) => descriptions ? WithDescriptions : WithoutDescriptions; -} \ No newline at end of file +} diff --git a/src/GraphZen.QueryEngine/Utilities/TypeInfo.cs b/src/GraphZen.QueryEngine/Utilities/TypeInfo.cs index 0ccf588eb..27acc7697 100644 --- a/src/GraphZen.QueryEngine/Utilities/TypeInfo.cs +++ b/src/GraphZen.QueryEngine/Utilities/TypeInfo.cs @@ -41,17 +41,29 @@ public class TypeInfo var name = node.Name.Value; if (name == Introspection.SchemaMetaFieldDef.Name && schema.QueryType.Equals(parentType)) + { return Introspection.SchemaMetaFieldDef; + } if (name == Introspection.TypeMetaFieldDef.Name && schema.QueryType.Equals(parentType)) + { return Introspection.TypeMetaFieldDef; + } if (name == Introspection.TypeNameMetaFieldDef.Name && parentType is ICompositeType) + { return Introspection.TypeNameMetaFieldDef; + } - if (parentType is ObjectType objectType) return objectType.FindField(name); + if (parentType is ObjectType objectType) + { + return objectType.FindField(name); + } - if (parentType is InterfaceType interfaceType) return interfaceType.FindField(name); + if (parentType is InterfaceType interfaceType) + { + return interfaceType.FindField(name); + } return null; } @@ -85,7 +97,10 @@ public void Enter(SyntaxNode syntaxNode) if (parentType != null) { fieldDef = GetFieldDef(Schema, parentType, node); - if (fieldDef != null) fieldType = fieldDef.FieldType; + if (fieldDef != null) + { + fieldType = fieldDef.FieldType; + } } _fieldDefStack.Push(fieldDef); @@ -96,85 +111,92 @@ public void Enter(SyntaxNode syntaxNode) Directive = Schema.FindDirective(directive.Name.Value); break; case OperationDefinitionSyntax node: - { - IGraphQLType? type = null; - if (node.OperationType == OperationType.Query) - type = Schema.QueryType; - else if (node.OperationType == OperationType.Mutation) - type = Schema.MutationType; - else if (node.OperationType == OperationType.Subscription) type = Schema.SubscriptionType; - - _typeStack.Push(type); - break; - } + { + IGraphQLType? type = null; + if (node.OperationType == OperationType.Query) + { + type = Schema.QueryType; + } + else if (node.OperationType == OperationType.Mutation) + { + type = Schema.MutationType; + } + else if (node.OperationType == OperationType.Subscription) + { + type = Schema.SubscriptionType; + } + + _typeStack.Push(type); + break; + } case IFragmentTypeConditionSyntax node: - { - var typeCondition = node.TypeCondition; - var type = typeCondition != null - ? Schema.GetTypeFromAst(typeCondition) - : GetOutputType()?.GetNamedType(); - _typeStack.Push(type); - break; - } + { + var typeCondition = node.TypeCondition; + var type = typeCondition != null + ? Schema.GetTypeFromAst(typeCondition) + : GetOutputType()?.GetNamedType(); + _typeStack.Push(type); + break; + } case VariableDefinitionSyntax node: - { - var type = Schema.GetTypeFromAst(node.VariableType); - _inputTypeStack.Push(type); - break; - } + { + var type = Schema.GetTypeFromAst(node.VariableType); + _inputTypeStack.Push(type); + break; + } case ArgumentSyntax node: - { - Argument? argDef = null; - IGraphQLType? argType = null; - - var fieldOrDirective = (IArguments?)Directive ?? GetField(); - if (fieldOrDirective != null) { - argDef = fieldOrDirective.FindArgument(node.Name.Value); - argType = argDef?.InputType; + Argument? argDef = null; + IGraphQLType? argType = null; + + var fieldOrDirective = (IArguments?)Directive ?? GetField(); + if (fieldOrDirective != null) + { + argDef = fieldOrDirective.FindArgument(node.Name.Value); + argType = argDef?.InputType; + } + + Argument = argDef; + _defaultValueStack.Push(argDef != null && argDef.HasDefaultValue + ? Maybe.Some(argDef.DefaultValue!) + : Maybe.None()); + _inputTypeStack.Push(argType); + break; } - - Argument = argDef; - _defaultValueStack.Push(argDef != null && argDef.HasDefaultValue - ? Maybe.Some(argDef.DefaultValue!) - : Maybe.None()); - _inputTypeStack.Push(argType); - break; - } case ListValueSyntax _: - { - var listType = GetInputType()?.GetNullableType(); - var itemType = listType is ListType list ? list.OfType : listType; - _defaultValueStack.Push(null); - _inputTypeStack.Push(itemType); + { + var listType = GetInputType()?.GetNullableType(); + var itemType = listType is ListType list ? list.OfType : listType; + _defaultValueStack.Push(null); + _inputTypeStack.Push(itemType); - break; - } + break; + } case ObjectFieldSyntax node: - { - var objectType = GetInputType()?.GetNamedType(); - IGraphQLType? inputFieldType = null; - InputField? inputField = null; - if (objectType is InputObjectType inputObject) { - inputField = inputObject.FindField(node.Name.Value); - inputFieldType = inputField?.InputType; + var objectType = GetInputType()?.GetNamedType(); + IGraphQLType? inputFieldType = null; + InputField? inputField = null; + if (objectType is InputObjectType inputObject) + { + inputField = inputObject.FindField(node.Name.Value); + inputFieldType = inputField?.InputType; + } + + _defaultValueStack.Push(inputField != null && inputField.HasDefaultValue + ? Maybe.Some(inputField.DefaultValue!) + : Maybe.None()); + _inputTypeStack.Push(inputFieldType); + break; } - - _defaultValueStack.Push(inputField != null && inputField.HasDefaultValue - ? Maybe.Some(inputField.DefaultValue!) - : Maybe.None()); - _inputTypeStack.Push(inputFieldType); - break; - } case EnumValueSyntax node: - { - var type = GetInputType()?.GetNamedType(); - EnumValue = type is EnumType enumType ? enumType.FindValue(node.Value) : null; + { + var type = GetInputType()?.GetNamedType(); + EnumValue = type is EnumType enumType ? enumType.FindValue(node.Value) : null; - break; - } + break; + } } } @@ -215,4 +237,4 @@ public void Leave(SyntaxNode syntaxNode) break; } } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/AssemblyAttributes.cs b/src/GraphZen.TypeSystem/AssemblyAttributes.cs index db5ed72f4..8b60403d0 100644 --- a/src/GraphZen.TypeSystem/AssemblyAttributes.cs +++ b/src/GraphZen.TypeSystem/AssemblyAttributes.cs @@ -5,4 +5,4 @@ [assembly: InternalsVisibleTo("GraphZen.Tests")] [assembly: InternalsVisibleTo("GraphZen.TypeSystem.Tests")] -[assembly: InternalsVisibleTo("GraphZen.QueryEngine")] \ No newline at end of file +[assembly: InternalsVisibleTo("GraphZen.QueryEngine")] diff --git a/src/GraphZen.TypeSystem/GlobalUsings.cs b/src/GraphZen.TypeSystem/GlobalUsings.cs index 81a9c8043..b13017371 100644 --- a/src/GraphZen.TypeSystem/GlobalUsings.cs +++ b/src/GraphZen.TypeSystem/GlobalUsings.cs @@ -4,4 +4,4 @@ global using GraphZen.Infrastructure; global using GraphZen.LanguageModel; global using GraphZen.TypeSystem.Internal; -global using GraphZen.TypeSystem.Taxonomy; \ No newline at end of file +global using GraphZen.TypeSystem.Taxonomy; diff --git a/src/GraphZen.TypeSystem/GraphQLContext.cs b/src/GraphZen.TypeSystem/GraphQLContext.cs index 6084f1c88..74fe22e29 100644 --- a/src/GraphZen.TypeSystem/GraphQLContext.cs +++ b/src/GraphZen.TypeSystem/GraphQLContext.cs @@ -59,7 +59,10 @@ public Schema Schema { get { - if (_schema != null) return _schema; + if (_schema != null) + { + return _schema; + } var contextType = GetType(); @@ -81,23 +84,36 @@ public Schema Schema Type? DiscoverQueryType(Assembly? assembly, Func> getTypes) { - if (assembly == null) return null; + if (assembly == null) + { + return null; + } + var candidates = getTypes(assembly) .Where(_ => _.IsClass && _.Name == "Query" && !_.IsNested).ToArray(); if (candidates.Length > 1) + { throw new InvalidOperationException( $"Unable to determine query type by convention. More than one class named 'Query' in assembly '{assembly}'"); + } + return candidates.SingleOrDefault(); } if (contextType != typeof(GraphQLContext)) + { queryClrType = DiscoverQueryType(contextType.Assembly, a => a.GetExportedTypes()); + } if (queryClrType == null) + { queryClrType = DiscoverQueryType(Assembly.GetEntryAssembly(), a => a.GetTypes()); + } if (queryClrType != null) + { internalBuilder.QueryType(queryClrType, ConfigurationSource.Convention); + } } // Configure mutation type @@ -109,15 +125,21 @@ public Schema Schema { Type? mutationClrType = default; if (contextType != typeof(GraphQLContext)) + { mutationClrType = contextType.Assembly.GetExportedTypes() .SingleOrDefault(_ => _.IsClass && _.Name == "Mutation"); + } if (mutationClrType == null) + { mutationClrType = Assembly.GetEntryAssembly()?.GetTypes() .SingleOrDefault(_ => _.IsClass && _.Name == "Mutation"); + } if (mutationClrType != null) + { internalBuilder.MutationType(mutationClrType, ConfigurationSource.Convention); + } } @@ -139,4 +161,4 @@ protected internal virtual void OnConfiguring(GraphQLContextOptionsBuilder optio protected internal virtual void OnSchemaCreating(SchemaBuilder schemaBuilder) { } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/GraphQLContextOptions.cs b/src/GraphZen.TypeSystem/GraphQLContextOptions.cs index 7607a58fa..dafdbce6f 100644 --- a/src/GraphZen.TypeSystem/GraphQLContextOptions.cs +++ b/src/GraphZen.TypeSystem/GraphQLContextOptions.cs @@ -44,4 +44,4 @@ public override GraphQLContextOptions WithExtension([NotNull] TExten extensions[typeof(TExtension)] = extension; return new GraphQLContextOptions(extensions); } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/GraphQLContextOptionsBuilder.cs b/src/GraphZen.TypeSystem/GraphQLContextOptionsBuilder.cs index d7fc36123..f706f6cb1 100644 --- a/src/GraphZen.TypeSystem/GraphQLContextOptionsBuilder.cs +++ b/src/GraphZen.TypeSystem/GraphQLContextOptionsBuilder.cs @@ -51,7 +51,10 @@ public GraphQLContextOptionsBuilder UseQueryType() => private GraphQLContextOptionsBuilder WithOption(Func withFunc) { var extension = Options.FindExtension(); - if (extension == null) extension = new CoreOptionsExtension(); + if (extension == null) + { + extension = new CoreOptionsExtension(); + } var updated = withFunc(extension); @@ -59,4 +62,4 @@ private GraphQLContextOptionsBuilder WithOption(Func() where TExtension : class, IGraphQLContextOptionsExtension; -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/Infrastructure/IGraphQLContextOptionsBuilderInfrastructure.cs b/src/GraphZen.TypeSystem/Infrastructure/IGraphQLContextOptionsBuilderInfrastructure.cs index f9d2b4e93..5a927b46d 100644 --- a/src/GraphZen.TypeSystem/Infrastructure/IGraphQLContextOptionsBuilderInfrastructure.cs +++ b/src/GraphZen.TypeSystem/Infrastructure/IGraphQLContextOptionsBuilderInfrastructure.cs @@ -7,4 +7,4 @@ public interface IGraphQLContextOptionsBuilderInfrastructure { void AddOrUpdateExtension([NotNull] TExtension extension) where TExtension : class, IGraphQLContextOptionsExtension; -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/Infrastructure/IGraphQLContextOptionsExtension.cs b/src/GraphZen.TypeSystem/Infrastructure/IGraphQLContextOptionsExtension.cs index 2d6df307b..5a79fbbfb 100644 --- a/src/GraphZen.TypeSystem/Infrastructure/IGraphQLContextOptionsExtension.cs +++ b/src/GraphZen.TypeSystem/Infrastructure/IGraphQLContextOptionsExtension.cs @@ -9,4 +9,4 @@ public interface IGraphQLContextOptionsExtension { void ApplyServices(IServiceCollection services); void Validate(IGraphQLContextOptions options); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/Internal/InvalidTypeReferenceException.cs b/src/GraphZen.TypeSystem/Internal/InvalidTypeReferenceException.cs index 12128f9cb..8afd14f6c 100644 --- a/src/GraphZen.TypeSystem/Internal/InvalidTypeReferenceException.cs +++ b/src/GraphZen.TypeSystem/Internal/InvalidTypeReferenceException.cs @@ -8,4 +8,4 @@ public class InvalidTypeReferenceException : Exception public InvalidTypeReferenceException(string message, Exception innerException) : base(message, innerException) { } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/Internal/Maybe/Maybe.cs b/src/GraphZen.TypeSystem/Internal/Maybe/Maybe.cs index 1c6cd7945..8c08fc36d 100644 --- a/src/GraphZen.TypeSystem/Internal/Maybe/Maybe.cs +++ b/src/GraphZen.TypeSystem/Internal/Maybe/Maybe.cs @@ -61,20 +61,35 @@ protected Maybe(IReadOnlyList? values, IReadOnlyList other) { - if (this is Some thisSome && other is Some otherSome) return Equals(thisSome.Value, otherSome.Value); + if (this is Some thisSome && other is Some otherSome) + { + return Equals(thisSome.Value, otherSome.Value); + } - if (this is None && other is None) return true; + if (this is None && other is None) + { + return true; + } return false; } public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } - if (obj.GetType() != GetType()) return false; + if (obj.GetType() != GetType()) + { + return false; + } return Equals((Maybe)obj); } @@ -100,8 +115,11 @@ internal Maybe Select(Func selector) protected T ValueOrFailure() { - if (HasValue) return (T)_values.Single()!; + if (HasValue) + { + return (T)_values.Single()!; + } throw new InvalidOperationException("Maybe does not have a value"); } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/Internal/Maybe/MaybeJsonConverter.cs b/src/GraphZen.TypeSystem/Internal/Maybe/MaybeJsonConverter.cs index 4ce4a2598..2a3abe548 100644 --- a/src/GraphZen.TypeSystem/Internal/Maybe/MaybeJsonConverter.cs +++ b/src/GraphZen.TypeSystem/Internal/Maybe/MaybeJsonConverter.cs @@ -21,4 +21,4 @@ public override void Write(Utf8JsonWriter writer, object value, JsonSerializerOp { throw new NotImplementedException(); } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/Internal/Maybe/None.cs b/src/GraphZen.TypeSystem/Internal/Maybe/None.cs index 021ac85f6..0fd144964 100644 --- a/src/GraphZen.TypeSystem/Internal/Maybe/None.cs +++ b/src/GraphZen.TypeSystem/Internal/Maybe/None.cs @@ -24,4 +24,4 @@ public void ThrowFirstErrorOrDefault(string defaultError = "Unkown error") Errors.SingleOrDefault()?.Throw(); throw new GraphQLException(defaultError); } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/Internal/Maybe/Some.cs b/src/GraphZen.TypeSystem/Internal/Maybe/Some.cs index 60f4a6865..e5361cc54 100644 --- a/src/GraphZen.TypeSystem/Internal/Maybe/Some.cs +++ b/src/GraphZen.TypeSystem/Internal/Maybe/Some.cs @@ -12,4 +12,4 @@ protected Some(IReadOnlyList? values, IReadOnlyList public T Value => ValueOrFailure(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/AnnotatableMember.cs b/src/GraphZen.TypeSystem/TypeSystem/AnnotatableMember.cs index 16bb5d2a7..dd424514b 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/AnnotatableMember.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/AnnotatableMember.cs @@ -23,4 +23,4 @@ protected AnnotatableMember(IReadOnlyList? directives) => Check.NotNull(name, nameof(name)); return DirectiveAnnotations.SingleOrDefault(_ => _.Name == name); } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/AnnotatableMemberDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/AnnotatableMemberDefinition.cs index ee68d9bd3..53d4c1050 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/AnnotatableMemberDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/AnnotatableMemberDefinition.cs @@ -47,4 +47,4 @@ public void RemoveDirectiveAnnotation(string name) return _.Name == name; }); } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Argument.cs b/src/GraphZen.TypeSystem/TypeSystem/Argument.cs index 27aad33a3..2408ea76a 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Argument.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Argument.cs @@ -55,4 +55,4 @@ public static Argument From(IArgumentDefinition definition, IArguments declaring definition.GetDirectiveAnnotations().ToReadOnlyList(), typeResolver, declaringMember, definition.ClrInfo); } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/ArgumentDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/ArgumentDefinition.cs index e2cea76fa..9c6911151 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/ArgumentDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/ArgumentDefinition.cs @@ -28,9 +28,15 @@ public ArgumentDefinition(string name, public override bool SetName(string name, ConfigurationSource configurationSource) { Check.NotNull(name, nameof(name)); - if (!configurationSource.Overrides(GetNameConfigurationSource())) return false; + if (!configurationSource.Overrides(GetNameConfigurationSource())) + { + return false; + } - if (Name != name) DeclaringMember.RenameArgument(this, name, configurationSource); + if (Name != name) + { + DeclaringMember.RenameArgument(this, name, configurationSource); + } Name = name; NameConfigurationSource = configurationSource; @@ -44,4 +50,4 @@ public override bool SetName(string name, ConfigurationSource configurationSourc IArgumentsDefinition IArgumentDefinition.DeclaringMember => DeclaringMember; public override string ToString() => $"argument {Name}"; -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/DefaultIDirectiveAnnotationSyntaxConverter.cs b/src/GraphZen.TypeSystem/TypeSystem/DefaultIDirectiveAnnotationSyntaxConverter.cs index ca1e2aea7..6d6780d06 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/DefaultIDirectiveAnnotationSyntaxConverter.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/DefaultIDirectiveAnnotationSyntaxConverter.cs @@ -10,7 +10,10 @@ public class DefaultIDirectiveAnnotationSyntaxConverter : SyntaxConverter public override object? FromSyntax(SyntaxNode node) { - if (node is DirectiveSyntax directive) return new DirectiveAnnotation(directive.Name.Value, directive); + if (node is DirectiveSyntax directive) + { + return new DirectiveAnnotation(directive.Name.Value, directive); + } return null; } @@ -19,7 +22,10 @@ public class DefaultIDirectiveAnnotationSyntaxConverter : SyntaxConverter { if (value is IDirectiveAnnotation annotation) { - if (annotation.Value is DirectiveSyntax syntax) return syntax; + if (annotation.Value is DirectiveSyntax syntax) + { + return syntax; + } // TODO: lookup directive in schema based on name, get values from value, create syntax (AstFromValue) // Default: return simple directive annotation w/name only @@ -28,4 +34,4 @@ public class DefaultIDirectiveAnnotationSyntaxConverter : SyntaxConverter return null; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/DeprecatedBuilderExtensions.cs b/src/GraphZen.TypeSystem/TypeSystem/DeprecatedBuilderExtensions.cs index 2c189a80e..8c977610d 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/DeprecatedBuilderExtensions.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/DeprecatedBuilderExtensions.cs @@ -10,4 +10,4 @@ public static TBuilder Deprecated( string? reason = null) where TBuilder : IAnnotableBuilder => Check.NotNull(builder, nameof(builder)) .DirectiveAnnotation("deprecated", new GraphQLDeprecatedAttribute(reason)); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Directive.cs b/src/GraphZen.TypeSystem/TypeSystem/Directive.cs index bcdb1a614..60b6390df 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Directive.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Directive.cs @@ -65,4 +65,4 @@ public static Directive From(IDirectiveDefinition definition, TypeResolver typeR return new Directive(definition.Name, definition.Description, definition.Locations, definition.GetArguments(), typeResolver); } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/DirectiveAnnotation.cs b/src/GraphZen.TypeSystem/TypeSystem/DirectiveAnnotation.cs index 7520f79d1..5924e006a 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/DirectiveAnnotation.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/DirectiveAnnotation.cs @@ -16,4 +16,4 @@ public DirectiveAnnotation(string name, object? value) public string Name { get; } public object? Value { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/DirectiveBuilder.cs b/src/GraphZen.TypeSystem/TypeSystem/DirectiveBuilder.cs index 5f2307f26..f7b153a99 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/DirectiveBuilder.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/DirectiveBuilder.cs @@ -42,4 +42,4 @@ public IDirectiveBuilder Argument(string name, string type, public IDirectiveBuilder Argument(string name, Action? configurator = null) => throw new NotImplementedException(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/DirectiveDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/DirectiveDefinition.cs index 3a52797fb..4c4b5da6a 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/DirectiveDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/DirectiveDefinition.cs @@ -58,9 +58,15 @@ public DirectiveDefinition(string? name, Type? clrType, SchemaDefinition schema, public bool SetName(string name, ConfigurationSource configurationSource) { Check.NotNull(name, nameof(name)); - if (!configurationSource.Overrides(GetNameConfigurationSource())) return false; + if (!configurationSource.Overrides(GetNameConfigurationSource())) + { + return false; + } - if (Name != name) Builder.Schema.RenameDirective(this, name, configurationSource); + if (Name != name) + { + Builder.Schema.RenameDirective(this, name, configurationSource); + } Name = name; _nameConfigurationSource = configurationSource; @@ -71,11 +77,16 @@ public bool SetName(string name, ConfigurationSource configurationSource) public bool RenameArgument(ArgumentDefinition argument, string name, ConfigurationSource configurationSource) { - if (!configurationSource.Overrides(argument.GetNameConfigurationSource())) return false; + if (!configurationSource.Overrides(argument.GetNameConfigurationSource())) + { + return false; + } if (this.TryGetArgument(name, out var existing) && existing != argument) + { throw new InvalidOperationException( $"Cannot rename {argument} to '{name}'. {this} already contains a field named '{name}'."); + } _arguments.Remove(argument.Name); _arguments[name] = argument; @@ -156,4 +167,4 @@ public ArgumentDefinition GetOrAddArgument(string name, ConfigurationSource conf return argument; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/EnumType.cs b/src/GraphZen.TypeSystem/TypeSystem/EnumType.cs index fc6832915..123e1ff31 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/EnumType.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/EnumType.cs @@ -36,7 +36,9 @@ public Maybe Serialize(object value) // value may be null at runtime despite non-nullable annotation // ReSharper disable once NullCoalescingConditionIsAlwaysNotNullAccordingToAPIContract if (ValuesByValue.TryGetValue(value ?? DBNull.Value, out var enumValue)) + { return Maybe.Some(enumValue.Name); + } return Maybe.None( $"{Name} Enum: unable to find enum value that matches resolved value \"{value}\""); @@ -53,7 +55,10 @@ public Maybe ParseValue(object value) if (value is string str) { var enumValue = this.FindValue(str); - if (enumValue != null) return Maybe.Some(enumValue.Value); + if (enumValue != null) + { + return Maybe.Some(enumValue.Value); + } } return Maybe.None(); @@ -64,7 +69,10 @@ public Maybe ParseLiteral(ValueSyntax value) if (value is EnumValueSyntax enumNode) { var enumValue = this.FindValue(enumNode.Value); - if (enumValue != null) return Maybe.Some(enumValue.Value); + if (enumValue != null) + { + return Maybe.Some(enumValue.Value); + } } return Maybe.None(); @@ -95,4 +103,4 @@ public static EnumType From(IEnumTypeDefinition definition) definition.GetValues(), definition.GetDirectiveAnnotations().ToList()); } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/EnumTypeBuilder.cs b/src/GraphZen.TypeSystem/TypeSystem/EnumTypeBuilder.cs index d259f667b..3819427f3 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/EnumTypeBuilder.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/EnumTypeBuilder.cs @@ -74,4 +74,4 @@ public IEnumTypeBuilder DirectiveAnnotation(string name, object? value = InternalEnumTypeBuilder IInfrastructure.Instance => Builder; -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/EnumTypeDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/EnumTypeDefinition.cs index 93234dff9..6ffdcdb93 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/EnumTypeDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/EnumTypeDefinition.cs @@ -58,7 +58,11 @@ public bool IgnoreValue(string name, ConfigurationSource configurationSource) public bool UnignoreValue(string name, ConfigurationSource configurationSource) { var ignoredConfigurationSource = FindIgnoredValueConfigurationSource(name); - if (!configurationSource.Overrides(ignoredConfigurationSource)) return false; + if (!configurationSource.Overrides(ignoredConfigurationSource)) + { + return false; + } + _ignoredValues.Remove(name); return true; } @@ -77,4 +81,4 @@ public EnumValueDefinition AddValue(string name, ConfigurationSource configurati IEnumerable IEnumValuesDefinition.GetValues() => GetValues(); public override string ToString() => $"enum {Name}"; -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/EnumValue.cs b/src/GraphZen.TypeSystem/TypeSystem/EnumValue.cs index 8159e87cc..6f4fe1718 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/EnumValue.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/EnumValue.cs @@ -56,4 +56,4 @@ public static EnumValue From(IEnumValueDefinition definition, EnumType declaring } public override string ToString() => $"{Name} ({Value.Inspect()})"; -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/EnumValueBuilder.cs b/src/GraphZen.TypeSystem/TypeSystem/EnumValueBuilder.cs index 4548e8640..7aa65966b 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/EnumValueBuilder.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/EnumValueBuilder.cs @@ -48,4 +48,4 @@ public IEnumValueBuilder DirectiveAnnotation(string name, object? value = null) InternalEnumValueBuilder IInfrastructure.Instance => Builder; -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/EnumValueDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/EnumValueDefinition.cs index 395cdff0d..851b80d29 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/EnumValueDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/EnumValueDefinition.cs @@ -36,7 +36,10 @@ public EnumValueDefinition(string name, ConfigurationSource nameConfigurationSou public bool SetName(string name, ConfigurationSource configurationSource) { - if (!configurationSource.Overrides(_nameConfigurationSource)) return false; + if (!configurationSource.Overrides(_nameConfigurationSource)) + { + return false; + } _nameConfigurationSource = configurationSource; if (name != Name) @@ -60,4 +63,4 @@ public bool MarkAsDeprecated(string reason, ConfigurationSource configurationSou // ReSharper disable once UnassignedGetOnlyAutoProperty public string? DeprecationReason { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Field.cs b/src/GraphZen.TypeSystem/TypeSystem/Field.cs index c8826d621..b5191d473 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Field.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Field.cs @@ -113,4 +113,4 @@ public static Field From(IFieldDefinition definition, IFields declaringType, } public override string ToString() => $"{DeclaringType}.{Name}"; -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/FieldBuilder.cs b/src/GraphZen.TypeSystem/TypeSystem/FieldBuilder.cs index edeb859d4..01b6ed480 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/FieldBuilder.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/FieldBuilder.cs @@ -160,4 +160,4 @@ public IFieldBuilder FieldType(b Builder.FieldType(typeof(TFieldNew)); return new FieldBuilder(Builder); } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/FieldDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/FieldDefinition.cs index c137f48b2..59de70e4a 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/FieldDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/FieldDefinition.cs @@ -49,11 +49,16 @@ public FieldDefinition(string name, ConfigurationSource nameConfigurationSource, public bool RenameArgument(ArgumentDefinition argument, string name, ConfigurationSource configurationSource) { - if (!configurationSource.Overrides(argument.GetNameConfigurationSource())) return false; + if (!configurationSource.Overrides(argument.GetNameConfigurationSource())) + { + return false; + } if (this.TryGetArgument(name, out var existing) && existing != argument) + { throw new InvalidOperationException( $"Cannot rename {argument} to '{name}'. {this} already contains a field named '{name}'."); + } _arguments.Remove(argument.Name); _arguments[name] = argument; @@ -76,7 +81,10 @@ public bool IsDeprecated set { _isDeprecated = value; - if (!_isDeprecated) DeprecationReason = null; + if (!_isDeprecated) + { + DeprecationReason = null; + } } } @@ -86,7 +94,10 @@ public string? DeprecationReason set { _deprecationReason = value; - if (_deprecationReason != null) IsDeprecated = true; + if (_deprecationReason != null) + { + IsDeprecated = true; + } } } @@ -99,9 +110,15 @@ public string? DeprecationReason public bool SetName(string name, ConfigurationSource configurationSource) { Check.NotNull(name, nameof(name)); - if (!configurationSource.Overrides(_nameConfigurationSource)) return false; + if (!configurationSource.Overrides(_nameConfigurationSource)) + { + return false; + } - if (Name != name) DeclaringType.RenameField(this, name, configurationSource); + if (Name != name) + { + DeclaringType.RenameField(this, name, configurationSource); + } Name = name; _nameConfigurationSource = configurationSource; @@ -121,7 +138,10 @@ public bool MarkAsDeprecated(string reason, ConfigurationSource configurationSou public ConfigurationSource? FindIgnoredArgumentConfigurationSource(string name) { - if (_ignoredArguments.TryGetValue(name, out var cs)) return cs; + if (_ignoredArguments.TryGetValue(name, out var cs)) + { + return cs; + } return null; } @@ -130,15 +150,23 @@ public bool IgnoreArgument(string name, ConfigurationSource configurationSource) { var ignoredConfigurationSource = FindIgnoredArgumentConfigurationSource(name); if (ignoredConfigurationSource.HasValue && - ignoredConfigurationSource.Overrides(configurationSource)) return true; + ignoredConfigurationSource.Overrides(configurationSource)) + { + return true; + } if (ignoredConfigurationSource != null) + { configurationSource = configurationSource.Max(ignoredConfigurationSource); + } _ignoredArguments[name] = configurationSource; var existing = this.FindArgument(name); - if (existing != null) return IgnoreArgument(existing, configurationSource); + if (existing != null) + { + return IgnoreArgument(existing, configurationSource); + } return true; } @@ -158,7 +186,10 @@ private bool IgnoreArgument(ArgumentDefinition argument, ConfigurationSource con { // ReSharper disable once PossibleNullReferenceException var memberMatch = _arguments.Values.SingleOrDefault(_ => _.ClrInfo == member); - if (memberMatch != null) return memberMatch; + if (memberMatch != null) + { + return memberMatch; + } var (argumentName, _) = member.GetGraphQLArgumentName(); return this.FindArgument(argumentName); @@ -186,7 +217,9 @@ public ArgumentDefinition AddArgument(ParameterInfo parameter, argument.InputType = Schema.GetOrAddTypeReference(parameter, this); ab.DefaultValue(parameter, configurationSource); if (parameter.TryGetDescriptionFromDataAnnotation(out var description)) + { ab.Description(description, ConfigurationSource.DataAnnotation); + } return AddArgument(argument); } @@ -195,8 +228,10 @@ public ArgumentDefinition AddArgument(ParameterInfo parameter, private ArgumentDefinition AddArgument(ArgumentDefinition argument) { if (this.HasArgument(argument.Name)) + { throw new InvalidOperationException( $"Cannot add {argument} to {this}. An argument with that name already exists."); + } _arguments.Add(argument.Name, argument); return argument; @@ -216,4 +251,4 @@ public ArgumentDefinition GetOrAddArgument(string name, ConfigurationSource conf return argument; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/FieldsDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/FieldsDefinition.cs index a1aa10220..e1699eae4 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/FieldsDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/FieldsDefinition.cs @@ -26,7 +26,10 @@ protected FieldsDefinition(TypeIdentity identity, SchemaDefinition schema, public ConfigurationSource? FindIgnoredFieldConfigurationSource(string fieldName) { - if (_ignoredFields.TryGetValue(fieldName, out var cs)) return cs; + if (_ignoredFields.TryGetValue(fieldName, out var cs)) + { + return cs; + } return null; } @@ -44,15 +47,23 @@ public bool IgnoreField(string fieldName, ConfigurationSource configurationSourc { var ignoredConfigurationSource = FindIgnoredFieldConfigurationSource(fieldName); if (ignoredConfigurationSource.HasValue && - ignoredConfigurationSource.Overrides(configurationSource)) return true; + ignoredConfigurationSource.Overrides(configurationSource)) + { + return true; + } if (ignoredConfigurationSource != null) + { configurationSource = configurationSource.Max(ignoredConfigurationSource); + } _ignoredFields[fieldName] = configurationSource; var existing = this.FindField(fieldName); - if (existing != null) return IgnoreField(existing, configurationSource); + if (existing != null) + { + return IgnoreField(existing, configurationSource); + } return true; } @@ -61,7 +72,10 @@ public bool IgnoreField(string fieldName, ConfigurationSource configurationSourc { // ReSharper disable once PossibleNullReferenceException var memberMatch = _fields.Values.SingleOrDefault(_ => _.ClrInfo == member); - if (memberMatch != null) return memberMatch; + if (memberMatch != null) + { + return memberMatch; + } var (fieldName, _) = member.GetGraphQLFieldName(); return this.FindField(fieldName); @@ -71,8 +85,10 @@ public bool RenameField(FieldDefinition field, string name, ConfigurationSource configurationSource) { if (this.TryGetField(name, out var existing) && existing != field) + { throw new InvalidOperationException( $"Cannot rename {field} to '{name}'. {this} already contains a field named '{name}'."); + } _fields.Remove(field.Name); _fields[name] = field; @@ -95,13 +111,16 @@ private bool IgnoreField(FieldDefinition field, ConfigurationSource configuratio public FieldDefinition AddField(PropertyInfo propertyInfo, ConfigurationSource configurationSource) { if (ClrType == null) + { throw new InvalidOperationException( "Cannot add field from property on a type that does not have a CLR type mapped."); - + } if (!ClrType.IsSameOrSubclass(propertyInfo.DeclaringType!)) + { throw new InvalidOperationException( $"Cannot add field from property with a declaring type ({propertyInfo.DeclaringType}) that does not exist on the parent's {Kind.ToString().ToLower()} type's mapped CLR type ({ClrType})."); + } var (fieldName, nameConfigurationSource) = propertyInfo.GetGraphQLFieldName(); var field = new FieldDefinition(fieldName, nameConfigurationSource, @@ -131,7 +150,9 @@ public FieldDefinition AddField(PropertyInfo propertyInfo, ConfigurationSource c if (propertyInfo.TryGetDescriptionFromDataAnnotation(out var description)) + { fb.Description(description, ConfigurationSource.DataAnnotation); + } return AddField(field); } @@ -153,8 +174,10 @@ public FieldDefinition AddField(MethodInfo method, ConfigurationSource configura private FieldDefinition AddField(FieldDefinition field) { if (_fields.ContainsKey(field.Name)) + { throw new InvalidOperationException( $"Duplicate field names: Cannot add field '{field.Name}' to {Kind.ToString().ToLower()} '{Name}', a field with that name already exists."); + } _fields.Add(field.Name, field); return field; @@ -171,7 +194,10 @@ public void RemoveField(FieldDefinition field) var ignoredConfigurationSource = FindIgnoredFieldConfigurationSource(name); if (ignoredConfigurationSource.HasValue) { - if (!nameConfigurationSource.Overrides(ignoredConfigurationSource)) return null; + if (!nameConfigurationSource.Overrides(ignoredConfigurationSource)) + { + return null; + } _ignoredFields.Remove(name); } @@ -188,4 +214,4 @@ public void RemoveField(FieldDefinition field) _fields.Add(field.Name, field); return field; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/GraphQLTypeExtensions.cs b/src/GraphZen.TypeSystem/TypeSystem/GraphQLTypeExtensions.cs index 583ce607d..d506be082 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/GraphQLTypeExtensions.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/GraphQLTypeExtensions.cs @@ -71,4 +71,4 @@ public static bool IsOutputType(this IGraphQLTypeReference type) public static INullableType GetNullableType(this IGraphQLType type) => type is NonNullType nonNull ? nonNull.OfType : (INullableType)type; -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/GraphQLTypes.cs b/src/GraphZen.TypeSystem/TypeSystem/GraphQLTypes.cs index f9699bad1..6ab8a82c0 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/GraphQLTypes.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/GraphQLTypes.cs @@ -15,4 +15,4 @@ public static class GraphQLTypes SpecScalars.Float, SpecScalars.Int }.Concat(Introspection.Schema.GetTypes()).ToImmutableList(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/IAnnotableBuilder.cs b/src/GraphZen.TypeSystem/TypeSystem/IAnnotableBuilder.cs index c087d012a..6ee5d9624 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/IAnnotableBuilder.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/IAnnotableBuilder.cs @@ -7,4 +7,4 @@ public interface IAnnotableBuilder { TBuilder DirectiveAnnotation(string name, object? value = null); TBuilder IgnoreDirectiveAnnotation(string name); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/IArgumentsDefinitionBuilder.cs b/src/GraphZen.TypeSystem/TypeSystem/IArgumentsDefinitionBuilder.cs index d711c8855..ba4caa42b 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/IArgumentsDefinitionBuilder.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/IArgumentsDefinitionBuilder.cs @@ -18,4 +18,4 @@ public interface IArgumentsDefinitionBuilder TBuilder UnignoreArgument(string name); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/IDirectiveBuilder.cs b/src/GraphZen.TypeSystem/TypeSystem/IDirectiveBuilder.cs index 85ab0adc4..7102f0bed 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/IDirectiveBuilder.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/IDirectiveBuilder.cs @@ -18,4 +18,4 @@ IDirectiveBuilder Argument(string name, string type, IDirectiveBuilder Argument(string name, Action? configurator = null); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/IEnumTypeBuilder.cs b/src/GraphZen.TypeSystem/TypeSystem/IEnumTypeBuilder.cs index 5bed6fbec..f61c23031 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/IEnumTypeBuilder.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/IEnumTypeBuilder.cs @@ -12,4 +12,4 @@ public interface IEnumTypeBuilder : IAnnotableBuilder Name(string name); IEnumTypeBuilder ClrType(Type clrType); IEnumTypeBuilder ClrType(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/IEnumValueBuilder.cs b/src/GraphZen.TypeSystem/TypeSystem/IEnumValueBuilder.cs index 6717b5d3f..104cedbe0 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/IEnumValueBuilder.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/IEnumValueBuilder.cs @@ -13,4 +13,4 @@ public interface IEnumValueBuilder : IAnnotableBuilder IEnumValueBuilder Deprecated(bool deprecated = true); IEnumValueBuilder Deprecated(string? reason); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/IFieldBuilder.cs b/src/GraphZen.TypeSystem/TypeSystem/IFieldBuilder.cs index 324c5aa26..c902b661b 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/IFieldBuilder.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/IFieldBuilder.cs @@ -48,4 +48,4 @@ IFieldBuilder Resolve( IFieldBuilder Deprecated(bool deprecated = true); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/IFieldsDefinitionBuilder.cs b/src/GraphZen.TypeSystem/TypeSystem/IFieldsDefinitionBuilder.cs index 4cfc5c801..f238a5619 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/IFieldsDefinitionBuilder.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/IFieldsDefinitionBuilder.cs @@ -24,4 +24,4 @@ TBuilder Field(Expression> selector, TBuilder IgnoreField(string name); TBuilder UnignoreField(string name); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/IInputObjectTypeBuilder.cs b/src/GraphZen.TypeSystem/TypeSystem/IInputObjectTypeBuilder.cs index 29a02ca93..c2f8c2671 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/IInputObjectTypeBuilder.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/IInputObjectTypeBuilder.cs @@ -42,4 +42,4 @@ IInputObjectTypeBuilder Field(Expression Name(string name); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/IInterfaceTypeBuilder.cs b/src/GraphZen.TypeSystem/TypeSystem/IInterfaceTypeBuilder.cs index 3de578060..2196edbf8 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/IInterfaceTypeBuilder.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/IInterfaceTypeBuilder.cs @@ -22,4 +22,4 @@ public interface IInterfaceTypeBuilder Name(string newName); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/IObjectTypeBuilder.cs b/src/GraphZen.TypeSystem/TypeSystem/IObjectTypeBuilder.cs index 72cc55127..52bc837fb 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/IObjectTypeBuilder.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/IObjectTypeBuilder.cs @@ -45,4 +45,4 @@ public interface IObjectTypeBuilder : IObjectTypeBuilder UnignoreInterface(string name); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/IScalarTypeBuilder.cs b/src/GraphZen.TypeSystem/TypeSystem/IScalarTypeBuilder.cs index 9c1b6f78f..68c8417fe 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/IScalarTypeBuilder.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/IScalarTypeBuilder.cs @@ -26,4 +26,4 @@ public interface IScalarTypeBuilder Name(string name); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/ISchemaBuilder.cs b/src/GraphZen.TypeSystem/TypeSystem/ISchemaBuilder.cs index 4e8720aad..b83b59c22 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/ISchemaBuilder.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/ISchemaBuilder.cs @@ -118,4 +118,4 @@ IScalarTypeBuilder Scalar() ISchemaBuilder SubscriptionType(string type); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/ISyntaxConverter.cs b/src/GraphZen.TypeSystem/TypeSystem/ISyntaxConverter.cs index f6b4eab2b..0d1be5c05 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/ISyntaxConverter.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/ISyntaxConverter.cs @@ -9,4 +9,4 @@ public interface ISyntaxConverter bool CanWrite { get; } object? FromSyntax(SyntaxNode node); SyntaxNode? ToSyntax(object value); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/IUnionTypeBuilder.cs b/src/GraphZen.TypeSystem/TypeSystem/IUnionTypeBuilder.cs index d11074b45..2df4fc80e 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/IUnionTypeBuilder.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/IUnionTypeBuilder.cs @@ -53,4 +53,4 @@ public interface IUnionTypeBuilder Name(string name); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/InputField.cs b/src/GraphZen.TypeSystem/TypeSystem/InputField.cs index 12dc25a02..f44f77480 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/InputField.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/InputField.cs @@ -40,4 +40,4 @@ public static InputField From(IInputFieldDefinition definition, TypeResolver typ typeResolver, definition.ClrInfo, declaringType); } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/InputFieldDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/InputFieldDefinition.cs index c90036002..2983b339e 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/InputFieldDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/InputFieldDefinition.cs @@ -23,9 +23,15 @@ public InputFieldDefinition(string name, public override bool SetName(string name, ConfigurationSource configurationSource) { Check.NotNull(name, nameof(name)); - if (!configurationSource.Overrides(GetNameConfigurationSource())) return false; + if (!configurationSource.Overrides(GetNameConfigurationSource())) + { + return false; + } - if (Name != name) DeclaringMember.RenameField(this, name, configurationSource); + if (Name != name) + { + DeclaringMember.RenameField(this, name, configurationSource); + } Name = name; NameConfigurationSource = configurationSource; @@ -39,4 +45,4 @@ public override bool SetName(string name, ConfigurationSource configurationSourc public new InputObjectTypeDefinition DeclaringMember => (InputObjectTypeDefinition)base.DeclaringMember; public override string ToString() => $"input field {Name}"; -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/InputObjectType.cs b/src/GraphZen.TypeSystem/TypeSystem/InputObjectType.cs index 5a60bbfbd..74897c1b6 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/InputObjectType.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/InputObjectType.cs @@ -43,4 +43,4 @@ public static InputObjectType From(IInputObjectTypeDefinition definition, return new InputObjectType(definition.Name, definition.Description, definition.ClrType, definition.GetFields(), definition.GetDirectiveAnnotations().ToList(), schema); } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/InputObjectTypeBuilder.cs b/src/GraphZen.TypeSystem/TypeSystem/InputObjectTypeBuilder.cs index f344e81aa..dd64b1ff6 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/InputObjectTypeBuilder.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/InputObjectTypeBuilder.cs @@ -112,4 +112,4 @@ public IInputObjectTypeBuilder DirectiveAnnotation(string name, ob public IInputObjectTypeBuilder IgnoreDirectiveAnnotation(string name) => throw new NotImplementedException(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/InputObjectTypeDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/InputObjectTypeDefinition.cs index fb5451cd4..ffd062f14 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/InputObjectTypeDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/InputObjectTypeDefinition.cs @@ -40,7 +40,10 @@ public InputObjectTypeDefinition(TypeIdentity identity, SchemaDefinition schema, public ConfigurationSource? FindIgnoredFieldConfigurationSource(string fieldName) { - if (_ignoredFields.TryGetValue(fieldName, out var cs)) return cs; + if (_ignoredFields.TryGetValue(fieldName, out var cs)) + { + return cs; + } return null; } @@ -51,12 +54,16 @@ public InputObjectTypeDefinition(TypeIdentity identity, SchemaDefinition schema, public bool RenameField(InputFieldDefinition field, string name, ConfigurationSource configurationSource) { - if (!configurationSource.Overrides(field.GetNameConfigurationSource())) return false; - + if (!configurationSource.Overrides(field.GetNameConfigurationSource())) + { + return false; + } if (this.TryGetField(name, out var existing) && existing != field) + { throw new InvalidOperationException( $"Cannot rename {field} to '{name}'. {this} already contains a field named '{name}'."); + } _fields.Remove(field.Name); _fields[name] = field; @@ -67,7 +74,10 @@ public bool RenameField(InputFieldDefinition field, string name, { // ReSharper disable once PossibleNullReferenceException var memberMatch = _fields.Values.SingleOrDefault(_ => _.ClrInfo == member); - if (memberMatch != null) return memberMatch; + if (memberMatch != null) + { + return memberMatch; + } var (fieldName, _) = member.GetGraphQLFieldName(); return this.FindField(fieldName); @@ -92,8 +102,10 @@ private bool IgnoreField(InputFieldDefinition field, ConfigurationSource configu private InputFieldDefinition AddField(InputFieldDefinition field) { if (_fields.ContainsKey(field.Name)) + { throw new InvalidOperationException( $"Duplicate field names: Cannot add field '{field.Name}' to {Kind.ToString().ToLower()} '{Name}', a field with that name already exists."); + } _fields.Add(field.Name, field); return field; @@ -103,12 +115,16 @@ public InputFieldDefinition AddField(PropertyInfo property, ConfigurationSource configurationSource) { if (ClrType == null) + { throw new InvalidOperationException( "Cannot add field from property on a type that does not have a CLR type mapped."); + } if (!ClrType.IsSameOrSubclass(property.DeclaringType!)) + { throw new InvalidOperationException( $"Cannot add field from property with a declaring type ({property.DeclaringType}) that does not exist on the parent's {Kind.ToString().ToLower()} type's mapped CLR type ({ClrType})."); + } var (fieldName, nameConfigurationSource) = property.GetGraphQLFieldName(); var field = new InputFieldDefinition(fieldName, nameConfigurationSource, Schema, configurationSource, @@ -120,7 +136,9 @@ public InputFieldDefinition AddField(PropertyInfo property, fb.FieldType(property); fb.DefaultValue(property, configurationSource); if (property.TryGetDescriptionFromDataAnnotation(out var description)) + { fb.Description(description, ConfigurationSource.DataAnnotation); + } return AddField(field); } @@ -134,15 +152,23 @@ public bool IgnoreField(string fieldName, ConfigurationSource configurationSourc { var ignoredConfigurationSource = FindIgnoredFieldConfigurationSource(fieldName); if (ignoredConfigurationSource.HasValue && - ignoredConfigurationSource.Overrides(configurationSource)) return true; + ignoredConfigurationSource.Overrides(configurationSource)) + { + return true; + } if (ignoredConfigurationSource != null) + { configurationSource = configurationSource.Max(ignoredConfigurationSource); + } _ignoredFields[fieldName] = configurationSource; var existing = this.FindField(fieldName); - if (existing != null) return IgnoreField(existing, configurationSource); + if (existing != null) + { + return IgnoreField(existing, configurationSource); + } return true; } @@ -152,7 +178,10 @@ public bool IgnoreField(string fieldName, ConfigurationSource configurationSourc var ignoredConfigurationSource = FindIgnoredFieldConfigurationSource(name); if (ignoredConfigurationSource.HasValue) { - if (!configurationSource.Overrides(ignoredConfigurationSource)) return null; + if (!configurationSource.Overrides(ignoredConfigurationSource)) + { + return null; + } _ignoredFields.Remove(name); } @@ -170,4 +199,4 @@ public bool IgnoreField(string fieldName, ConfigurationSource configurationSourc _fields[name] = field; return field; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/InputValue.cs b/src/GraphZen.TypeSystem/TypeSystem/InputValue.cs index 8a99b96bf..0ff98d264 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/InputValue.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/InputValue.cs @@ -64,4 +64,4 @@ IGraphQLType DefaultTypeResolver(IGraphQLTypeReference typeReference) => public override SyntaxNode ToSyntaxNode() => _syntax.Value; [GraphQLIgnore] public object? ClrInfo { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/InputValueBuilder.cs b/src/GraphZen.TypeSystem/TypeSystem/InputValueBuilder.cs index 60e116954..fa2996e38 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/InputValueBuilder.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/InputValueBuilder.cs @@ -44,4 +44,4 @@ public InputValueBuilder Description(string? description) Builder.Description(description, ConfigurationSource.Explicit); return this; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/InputValueDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/InputValueDefinition.cs index a52238c6a..6fddc706b 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/InputValueDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/InputValueDefinition.cs @@ -29,7 +29,10 @@ public InputValueDefinition( public bool SetDefaultValue(object value, ConfigurationSource configurationSource) { - if (!configurationSource.Overrides(_defaultValueConfigurationSource)) return false; + if (!configurationSource.Overrides(_defaultValueConfigurationSource)) + { + return false; + } DefaultValue = value; HasDefaultValue = true; @@ -41,7 +44,10 @@ public bool SetDefaultValue(object value, ConfigurationSource configurationSourc public bool RemoveDefaultValue(ConfigurationSource configurationSource) { - if (!configurationSource.Overrides(_defaultValueConfigurationSource)) return false; + if (!configurationSource.Overrides(_defaultValueConfigurationSource)) + { + return false; + } DefaultValue = null; HasDefaultValue = false; @@ -65,4 +71,4 @@ public bool RemoveDefaultValue(ConfigurationSource configurationSource) public ConfigurationSource GetNameConfigurationSource() => NameConfigurationSource; public object? ClrInfo { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/InterfaceType.cs b/src/GraphZen.TypeSystem/TypeSystem/InterfaceType.cs index ea3493377..a303e122a 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/InterfaceType.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/InterfaceType.cs @@ -52,4 +52,4 @@ public static InterfaceType From(IInterfaceTypeDefinition definition, Schema sch return new InterfaceType(definition.Name, definition.Description, definition.ClrType, definition.GetFields(), definition.ResolveType, definition.GetDirectiveAnnotations().ToList(), schema); } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/InterfaceTypeBuilder.cs b/src/GraphZen.TypeSystem/TypeSystem/InterfaceTypeBuilder.cs index 933d62636..e68985bec 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/InterfaceTypeBuilder.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/InterfaceTypeBuilder.cs @@ -134,4 +134,4 @@ public IInterfaceTypeBuilder DirectiveAnnotation(string na public IInterfaceTypeBuilder IgnoreDirectiveAnnotation(string name) => throw new NotImplementedException(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/InterfaceTypeDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/InterfaceTypeDefinition.cs index f08a0868d..02a11a79a 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/InterfaceTypeDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/InterfaceTypeDefinition.cs @@ -14,8 +14,11 @@ public InterfaceTypeDefinition(TypeIdentity identity, SchemaDefinition schema, { Builder = new InternalInterfaceTypeBuilder(this, schema.Builder); if (identity.ClrType != null && !identity.ClrType.IsInterface) + { throw new InvalidOperationException( $"Cannot create GraphQL interface '{identity.Name}' from CLR type. '{identity.ClrType}' is not an interface type."); + } + identity.Definition = this; } @@ -27,8 +30,11 @@ public InterfaceTypeDefinition(TypeIdentity identity, SchemaDefinition schema, public override bool SetClrType(Type clrType, ConfigurationSource configurationSource) { if (!clrType.IsInterface) + { throw new InvalidOperationException( $"Cannot set CLR type for GraphQL interface '{Name}'. '{clrType}' is not an interface type."); + } + return base.SetClrType(clrType, configurationSource); } @@ -37,4 +43,4 @@ public override bool SetClrType(Type clrType, ConfigurationSource configurationS public override DirectiveLocation DirectiveLocation { get; } = DirectiveLocation.Interface; public override TypeKind Kind { get; } = TypeKind.Interface; -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Internal/AnnotatableMemberDefinitionBuilder.cs b/src/GraphZen.TypeSystem/TypeSystem/Internal/AnnotatableMemberDefinitionBuilder.cs index ce358cf32..5c1ed33a5 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Internal/AnnotatableMemberDefinitionBuilder.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Internal/AnnotatableMemberDefinitionBuilder.cs @@ -69,8 +69,10 @@ public void DirectiveAnnotation(string name, object? value, ConfigurationSource var directiveDescription = Definition is INamed namedDef ? $"{displayVal} '{namedDef}'" : displayVal; if (directive == null) + { throw new InvalidOperationException( $"Unknown directive: cannot add '{name}' directive to the {directiveDescription}. Ensure the '{name}' directive is defined in the schema before it is used."); + } if (!directive.Locations.Contains(Definition.DirectiveLocation)) { @@ -94,4 +96,4 @@ public void RemoveDirectiveAnnotation(string name) { Definition.RemoveDirectiveAnnotation(name); } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Internal/AstFromValue.cs b/src/GraphZen.TypeSystem/TypeSystem/Internal/AstFromValue.cs index 1c6617f65..a4cd9f071 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Internal/AstFromValue.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Internal/AstFromValue.cs @@ -10,7 +10,10 @@ public static class AstFromValue { public static ValueSyntax? Get(Maybe maybeValue, IGraphQLType type) { - if (!(maybeValue is Some someValue)) return null; + if (!(maybeValue is Some someValue)) + { + return null; + } var value = someValue.Value; @@ -22,7 +25,10 @@ public static class AstFromValue // value can be null at runtime (Some wraps object? internally) // ReSharper disable once ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract - if (value == null) return SyntaxFactory.NullValue(); + if (value == null) + { + return SyntaxFactory.NullValue(); + } if (type is ListType list) { @@ -33,7 +39,10 @@ public static class AstFromValue foreach (var item in collection) { var itemNode = Get(Maybe.Some(item!), itemType); - if (itemNode != null) valueNodes.Add(itemNode); + if (itemNode != null) + { + valueNodes.Add(itemNode); + } } return SyntaxFactory.ListValue(valueNodes); @@ -52,7 +61,9 @@ public static class AstFromValue { var fieldValue = Get(Maybe.Some(fv), field.InputType); if (fieldValue != null) + { fieldsNodes.Add(SyntaxFactory.ObjectField(SyntaxFactory.Name(field.Name), fieldValue)); + } } } @@ -64,29 +75,47 @@ public static class AstFromValue var serialized = leafType.Serialize(value); - if (!(serialized is Some someSerialized)) return null; + if (!(serialized is Some someSerialized)) + { + return null; + } - if (someSerialized.Value is bool boolean) return SyntaxFactory.BooleanValue(boolean); + if (someSerialized.Value is bool boolean) + { + return SyntaxFactory.BooleanValue(boolean); + } if (InternalNumerics.IsNumber(someSerialized.Value)) { if (InternalNumerics.TryGetWholeDouble(someSerialized.Value, out var wholeResult)) + { if (InternalNumerics.TryConvertToInt32(wholeResult, out var intValue)) + { return SyntaxFactory.IntValue(intValue); + } + } return SyntaxFactory.FloatValue(value.ToString()!.ToLower()); } if (someSerialized.Value is string strVal) { - if (type is EnumType) return SyntaxFactory.EnumValue(SyntaxFactory.Name(strVal)); - + if (type is EnumType) + { + return SyntaxFactory.EnumValue(SyntaxFactory.Name(strVal)); + } if (type.Equals(SpecScalars.ID)) + { if (!strVal.TrimStart('-', '+').StartsWith("0") && double.TryParse(strVal, out var numeric)) + { if (InternalNumerics.TryGetWholeDouble(numeric, out var whole) && InternalNumerics.TryConvertToInt32(whole, out var intVal)) + { return SyntaxFactory.IntValue(intVal); + } + } + } return SyntaxFactory.StringValue(strVal); } @@ -96,4 +125,4 @@ public static class AstFromValue throw new Exception($"Unknown type: {type}"); } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Internal/ClrTypeExtensions.cs b/src/GraphZen.TypeSystem/TypeSystem/Internal/ClrTypeExtensions.cs index 041c6aad9..127b7c9a7 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Internal/ClrTypeExtensions.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Internal/ClrTypeExtensions.cs @@ -44,7 +44,10 @@ internal static bool TryGetListItemType(this Type clrType, [NotNullWhen(true)] o if (clrType.IsGenericType) { var args = clrType.GetGenericArguments(); - if (args.Length == 1) itemType = args[0]; + if (args.Length == 1) + { + itemType = args[0]; + } } else { @@ -95,11 +98,15 @@ private static bool TryGetGraphQLTypeInfoRecursive(this Type clrType, bool itemCanBeNull = false) { if (clrType.TryGetTaskResultType(out var resultType)) + { return resultType.TryGetGraphQLTypeInfoRecursive(out typeNode, out innerClrType, canBeNull, itemCanBeNull); + } if (clrType.TryGetNullableType(out var nullable)) + { return nullable.TryGetGraphQLTypeInfoRecursive(out typeNode, out innerClrType, true); + } if (clrType.TryGetListItemType(out var itemType) && itemType.TryGetGraphQLTypeInfoRecursive(out typeNode, out innerClrType, itemCanBeNull)) @@ -166,7 +173,10 @@ public static bool IsSameOrSubclass(this Type potentialSubClass, Type potentialB public static bool TryGetOutputTypeKind(this Type clrType, [NotNullWhen(true)] out TypeKind? kind) { kind = null; - if (!clrType.IsValidClrType()) return false; + if (!clrType.IsValidClrType()) + { + return false; + } if (clrType.IsEnum) { @@ -193,7 +203,10 @@ public static bool TryGetOutputTypeKind(this Type clrType, [NotNullWhen(true)] o public static bool TryGetInputTypeKind(this Type clrType, out TypeKind? kind) { kind = null; - if (!clrType.IsValidClrType()) return false; + if (!clrType.IsValidClrType()) + { + return false; + } if (clrType.IsEnum) { @@ -214,7 +227,10 @@ public static bool TryGetInputTypeKind(this Type clrType, out TypeKind? kind) public static bool IsValidClrType(this Type clrType) { - if (clrType.IsGenericType) return false; + if (clrType.IsGenericType) + { + return false; + } return clrType.HasValidGraphQLName(); } @@ -233,7 +249,10 @@ public static IEnumerable GetTargetingInterfaceProperties(this Prope var interfaceMethod = mapping.InterfaceMethods[i]; Debug.Assert(interfaceMethod.DeclaringType != null); var value = interfaceMethod.DeclaringType.GetProperty(property.Name); - if (value != null) yield return value; + if (value != null) + { + yield return value; + } } } } @@ -266,14 +285,21 @@ public static IEnumerable GetImplementingTypes(this Type clrType) var assemblies = AppDomain.CurrentDomain.GetAssemblies() .Where(_ => referencedAssemblies.Contains(_.GetName())).Concat(new List { clrType.Assembly }); foreach (var assembly in assemblies) - foreach (var type in assembly.DefinedTypes) { - if (type != clrType) + foreach (var type in assembly.DefinedTypes) { - if (clrType.IsInterface && clrType.IsAssignableFrom(type)) - yield return type; - else if (clrType.IsClass && type.IsSubclassOf(clrType)) yield return type; + if (type != clrType) + { + if (clrType.IsInterface && clrType.IsAssignableFrom(type)) + { + yield return type; + } + else if (clrType.IsClass && type.IsSubclassOf(clrType)) + { + yield return type; + } + } } } } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Internal/ConfigurationSource.cs b/src/GraphZen.TypeSystem/TypeSystem/Internal/ConfigurationSource.cs index 11fd0d718..f089b6a0b 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Internal/ConfigurationSource.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Internal/ConfigurationSource.cs @@ -8,4 +8,4 @@ public enum ConfigurationSource Explicit, DataAnnotation, Convention -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Internal/ConfigurationSourceExtensions.cs b/src/GraphZen.TypeSystem/TypeSystem/Internal/ConfigurationSourceExtensions.cs index 9ad5b239f..fae8d85ff 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Internal/ConfigurationSourceExtensions.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Internal/ConfigurationSourceExtensions.cs @@ -8,13 +8,25 @@ public static class ConfigurationSourceExtensions public static bool Overrides(this ConfigurationSource newConfigurationSource, ConfigurationSource? oldConfigurationSource) { - if (oldConfigurationSource == null) return true; - - if (newConfigurationSource == ConfigurationSource.Explicit) return true; - - if (oldConfigurationSource == ConfigurationSource.Explicit) return false; - - if (newConfigurationSource == ConfigurationSource.DataAnnotation) return true; + if (oldConfigurationSource == null) + { + return true; + } + + if (newConfigurationSource == ConfigurationSource.Explicit) + { + return true; + } + + if (oldConfigurationSource == ConfigurationSource.Explicit) + { + return false; + } + + if (newConfigurationSource == ConfigurationSource.DataAnnotation) + { + return true; + } return oldConfigurationSource != ConfigurationSource.DataAnnotation; } @@ -41,4 +53,4 @@ public static bool OverridesStrictly(this ConfigurationSource newConfigurationSo public static ConfigurationSource Max(this ConfigurationSource left, ConfigurationSource? right) => ((ConfigurationSource?)left).Max(right)!.Value; -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalBuilderExtensions.cs b/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalBuilderExtensions.cs index 2f15af71c..0b25ba3ba 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalBuilderExtensions.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalBuilderExtensions.cs @@ -18,4 +18,4 @@ public static void Description(this MemberDefinitionBuilder private static string GetName(object value) { - if (value is string strValue) return strValue; + if (value is string strValue) + { + return strValue; + } var enumMember = GetMemberInfo(value.GetType(), value.ToString()!); var (name, _) = enumMember.GetGraphQLNameForEnumValue(); @@ -109,4 +129,4 @@ public InternalEnumTypeBuilder UnignoreValue(object value, ConfigurationSource c Definition.UnignoreValue(name, configurationSource); return this; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalEnumValueBuilder.cs b/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalEnumValueBuilder.cs index 06aa7c694..2fd95d935 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalEnumValueBuilder.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalEnumValueBuilder.cs @@ -30,4 +30,4 @@ public InternalEnumValueBuilder Name(string name, ConfigurationSource configurat return this; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalFieldBuilder.cs b/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalFieldBuilder.cs index 2629a2887..1074baf19 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalFieldBuilder.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalFieldBuilder.cs @@ -80,21 +80,33 @@ public InternalInputValueBuilder Argument(string name, ConfigurationSource confi { var (argName, _) = parameter.GetGraphQLArgumentName(); - if (parameter.IsIgnoredByDataAnnotation()) IgnoreArgument(parameter, ConfigurationSource.DataAnnotation); + if (parameter.IsIgnoredByDataAnnotation()) + { + IgnoreArgument(parameter, ConfigurationSource.DataAnnotation); + } - if (IsArgumentIgnored(argName, configurationSource)) return null; + if (IsArgumentIgnored(argName, configurationSource)) + { + return null; + } if (parameter.TryGetGraphQLTypeInfo(out _, out var innerClrType)) { var argumentInnerType = Schema.Builder.InputType(innerClrType, configurationSource); - if (argumentInnerType == null) IgnoreArgument(parameter, ConfigurationSource.Convention); + if (argumentInnerType == null) + { + IgnoreArgument(parameter, ConfigurationSource.Convention); + } } else { IgnoreArgument(parameter, ConfigurationSource.Convention); } - if (IsArgumentIgnored(argName, configurationSource)) return null; + if (IsArgumentIgnored(argName, configurationSource)) + { + return null; + } var argument = Definition.FindArgument(parameter); if (argument == null) @@ -108,14 +120,19 @@ public InternalInputValueBuilder Argument(string name, ConfigurationSource confi } if (parameter.TryGetDescriptionFromDataAnnotation(out var desc)) + { argument.Builder.Description(desc, ConfigurationSource.DataAnnotation); + } return argument.Builder; } public bool IsArgumentIgnored(string name, ConfigurationSource configurationSource) { - if (configurationSource == ConfigurationSource.Explicit) return false; + if (configurationSource == ConfigurationSource.Explicit) + { + return false; + } var ignoredMemberConfigurationSource = Definition.FindIgnoredArgumentConfigurationSource(name); return ignoredMemberConfigurationSource.HasValue && @@ -125,7 +142,10 @@ public bool IsArgumentIgnored(string name, ConfigurationSource configurationSour public bool UnignoreArgument(string name, ConfigurationSource configurationSource) { var ignoredConfigurationSource = Definition.FindIgnoredArgumentConfigurationSource(name); - if (!configurationSource.Overrides(ignoredConfigurationSource)) return false; + if (!configurationSource.Overrides(ignoredConfigurationSource)) + { + return false; + } Definition.UnignoreArgument(name); return true; @@ -136,15 +156,20 @@ public bool IgnoreArgument(string name, ConfigurationSource configurationSource) { var ignoredConfigurationSource = Definition.FindIgnoredArgumentConfigurationSource(name); if (ignoredConfigurationSource.HasValue) + { if (configurationSource.Overrides(ignoredConfigurationSource) && configurationSource != ignoredConfigurationSource) { Definition.IgnoreArgument(name, configurationSource); return true; } + } var argument = Definition.FindArgument(name); - if (argument != null) return IgnoreArgument(argument, configurationSource); + if (argument != null) + { + return IgnoreArgument(argument, configurationSource); + } Definition.IgnoreArgument(name, configurationSource); return true; @@ -156,15 +181,20 @@ public bool IgnoreArgument(ParameterInfo parameter, ConfigurationSource configur var (argName, _) = parameter.GetGraphQLArgumentName(); var ignoredConfigurationSource = Definition.FindIgnoredArgumentConfigurationSource(argName); if (ignoredConfigurationSource.HasValue) + { if (configurationSource.Overrides(ignoredConfigurationSource) && configurationSource != ignoredConfigurationSource) { Definition.IgnoreArgument(argName, configurationSource); return true; } + } var argument = Definition.FindArgument(parameter); - if (argument != null) return IgnoreArgument(argument, configurationSource); + if (argument != null) + { + return IgnoreArgument(argument, configurationSource); + } Definition.IgnoreArgument(argName, configurationSource); return true; @@ -172,7 +202,10 @@ public bool IgnoreArgument(ParameterInfo parameter, ConfigurationSource configur public bool IgnoreArgument(ArgumentDefinition argument, ConfigurationSource configurationSource) { - if (!configurationSource.Overrides(argument.GetConfigurationSource())) return false; + if (!configurationSource.Overrides(argument.GetConfigurationSource())) + { + return false; + } Definition.IgnoreArgument(argument.Name, configurationSource); @@ -181,7 +214,10 @@ public bool IgnoreArgument(ArgumentDefinition argument, ConfigurationSource conf public bool RemoveArgument(ArgumentDefinition argument, ConfigurationSource configurationSource) { - if (!configurationSource.Overrides(argument.GetConfigurationSource())) return false; + if (!configurationSource.Overrides(argument.GetConfigurationSource())) + { + return false; + } Definition.IgnoreArgument(argument.Name, configurationSource); @@ -189,4 +225,4 @@ public bool RemoveArgument(ArgumentDefinition argument, ConfigurationSource conf return true; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalFieldsBuilder.cs b/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalFieldsBuilder.cs index 2f4c53fdb..a4057a59c 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalFieldsBuilder.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalFieldsBuilder.cs @@ -30,7 +30,11 @@ protected InternalFieldsBuilder(TDefinition definition, protected void ConfigureOutputFields() { - if (Definition.ClrType == null) return; + if (Definition.ClrType == null) + { + return; + } + var flags = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static; // ReSharper disable once PossibleNullReferenceException @@ -46,14 +50,14 @@ protected void ConfigureOutputFields() switch (fieldMember) { case MethodInfo method: - { - Field(method, ConfigurationSource.Convention); - } + { + Field(method, ConfigurationSource.Convention); + } break; case PropertyInfo property: - { - Field(property, ConfigurationSource.Convention); - } + { + Field(property, ConfigurationSource.Convention); + } break; } } @@ -66,14 +70,18 @@ public bool IgnoreField(string fieldName, ConfigurationSource configurationSourc { if (configurationSource.Overrides(ignoredConfigurationSource) && configurationSource != ignoredConfigurationSource) + { Definition.IgnoreField(fieldName, configurationSource); + } return true; } var field = Definition.FindField(fieldName); - if (field != null) return Ignore(field, configurationSource); - + if (field != null) + { + return Ignore(field, configurationSource); + } Definition.IgnoreField(fieldName, configurationSource); return true; @@ -84,15 +92,20 @@ public bool IgnoreField(MemberInfo member, ConfigurationSource configurationSour var (fieldName, _) = member.GetGraphQLFieldName(); var ignoredConfigurationSource = Definition.FindIgnoredFieldConfigurationSource(fieldName); if (ignoredConfigurationSource.HasValue) + { if (configurationSource.Overrides(ignoredConfigurationSource) && configurationSource != ignoredConfigurationSource) { Definition.IgnoreField(fieldName, configurationSource); return true; } + } var field = Definition.FindField(member); - if (field != null) return IgnoreField(field, configurationSource); + if (field != null) + { + return IgnoreField(field, configurationSource); + } Definition.IgnoreField(fieldName, configurationSource); return true; @@ -100,7 +113,10 @@ public bool IgnoreField(MemberInfo member, ConfigurationSource configurationSour public bool IgnoreField(FieldDefinition field, ConfigurationSource configurationSource) { - if (!configurationSource.Overrides(field.GetConfigurationSource())) return false; + if (!configurationSource.Overrides(field.GetConfigurationSource())) + { + return false; + } Definition.IgnoreField(field.Name, configurationSource); @@ -110,7 +126,10 @@ public bool IgnoreField(FieldDefinition field, ConfigurationSource configuration public bool UnignoreField(string name, ConfigurationSource configurationSource) { var ignoredConfigurationSource = Definition.FindIgnoredFieldConfigurationSource(name); - if (!configurationSource.Overrides(ignoredConfigurationSource)) return false; + if (!configurationSource.Overrides(ignoredConfigurationSource)) + { + return false; + } Definition.UnignoreField(name); return true; @@ -119,7 +138,10 @@ public bool UnignoreField(string name, ConfigurationSource configurationSource) public bool IsFieldIgnored(string member, ConfigurationSource configurationSource) { - if (configurationSource == ConfigurationSource.Explicit) return false; + if (configurationSource == ConfigurationSource.Explicit) + { + return false; + } var ignoredMemberConfigurationSource = Definition.FindIgnoredFieldConfigurationSource(member); return ignoredMemberConfigurationSource.HasValue && @@ -130,15 +152,23 @@ public bool IsFieldIgnored(string member, ConfigurationSource configurationSourc public InternalFieldBuilder? Field(PropertyInfo property, ConfigurationSource configurationSource) { var (fieldName, _) = property.GetGraphQLFieldName(); - if (property.IsIgnoredByDataAnnotation()) IgnoreField(property, ConfigurationSource.DataAnnotation); - - if (IsFieldIgnored(fieldName, configurationSource)) return null; + if (property.IsIgnoredByDataAnnotation()) + { + IgnoreField(property, ConfigurationSource.DataAnnotation); + } + if (IsFieldIgnored(fieldName, configurationSource)) + { + return null; + } if (property.TryGetGraphQLTypeInfo(out _, out var innerClrType)) { var fieldInnerType = Schema.Builder.OutputType(innerClrType, configurationSource); - if (fieldInnerType == null) IgnoreField(property, ConfigurationSource.Convention); + if (fieldInnerType == null) + { + IgnoreField(property, ConfigurationSource.Convention); + } } else { @@ -146,7 +176,10 @@ public bool IsFieldIgnored(string member, ConfigurationSource configurationSourc } - if (IsFieldIgnored(fieldName, configurationSource)) return null; + if (IsFieldIgnored(fieldName, configurationSource)) + { + return null; + } var field = Definition.FindField(property); if (field == null) @@ -160,7 +193,9 @@ public bool IsFieldIgnored(string member, ConfigurationSource configurationSourc } if (property.TryGetDescriptionFromDataAnnotation(out var desc)) + { field.Builder.Description(desc, ConfigurationSource.DataAnnotation); + } return field.Builder; } @@ -169,29 +204,45 @@ public bool IsFieldIgnored(string member, ConfigurationSource configurationSourc public InternalFieldBuilder? Field(MethodInfo method, ConfigurationSource configurationSource) { var (fieldName, _) = method.GetGraphQLFieldName(); - if (method.IsIgnoredByDataAnnotation()) IgnoreField(method, ConfigurationSource.DataAnnotation); - + if (method.IsIgnoredByDataAnnotation()) + { + IgnoreField(method, ConfigurationSource.DataAnnotation); + } var parameters = method.GetParameters(); var hasOutParam = parameters.Any(_ => _.IsOut); - if (hasOutParam) IgnoreField(method, ConfigurationSource.Convention); - - if (method.GetGenericArguments().Any()) IgnoreField(method, ConfigurationSource.Convention); + if (hasOutParam) + { + IgnoreField(method, ConfigurationSource.Convention); + } + if (method.GetGenericArguments().Any()) + { + IgnoreField(method, ConfigurationSource.Convention); + } - if (IsFieldIgnored(fieldName, configurationSource)) return null; + if (IsFieldIgnored(fieldName, configurationSource)) + { + return null; + } if (method.TryGetGraphQLTypeInfo(out _, out var innerClrType)) { var fieldInnerType = Schema.Builder.OutputType(innerClrType, configurationSource); - if (fieldInnerType == null) IgnoreField(method, ConfigurationSource.Convention); + if (fieldInnerType == null) + { + IgnoreField(method, ConfigurationSource.Convention); + } } else { IgnoreField(method, ConfigurationSource.Convention); } - if (IsFieldIgnored(fieldName, configurationSource)) return null; + if (IsFieldIgnored(fieldName, configurationSource)) + { + return null; + } var field = Definition.FindField(method); if (field == null) @@ -206,7 +257,10 @@ public bool IsFieldIgnored(string member, ConfigurationSource configurationSourc if (method.TryGetDescriptionFromDataAnnotation(out var desc)) + { field.Builder.Description(desc, ConfigurationSource.DataAnnotation); + } + foreach (var parameter in method.GetParameters()) { field.Builder.Argument(parameter, ConfigurationSource.Convention); @@ -217,14 +271,20 @@ public bool IsFieldIgnored(string member, ConfigurationSource configurationSourc private bool Ignore(FieldDefinition field, ConfigurationSource configurationSource) { - if (!configurationSource.Overrides(field.GetConfigurationSource())) return false; + if (!configurationSource.Overrides(field.GetConfigurationSource())) + { + return false; + } return RemoveField(field, configurationSource); } public bool RemoveField(FieldDefinition field, ConfigurationSource configurationSource) { - if (!configurationSource.Overrides(field.GetConfigurationSource())) return false; + if (!configurationSource.Overrides(field.GetConfigurationSource())) + { + return false; + } Definition.IgnoreField(field.Name, configurationSource); @@ -232,4 +292,4 @@ public bool RemoveField(FieldDefinition field, ConfigurationSource configuration return true; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalInputObjectTypeBuilder.cs b/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalInputObjectTypeBuilder.cs index bcefbccf2..cbe560a4f 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalInputObjectTypeBuilder.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalInputObjectTypeBuilder.cs @@ -24,14 +24,18 @@ public bool IgnoreField(string fieldName, ConfigurationSource configurationSourc { if (configurationSource.Overrides(ignoredConfigurationSource) && configurationSource != ignoredConfigurationSource) + { Definition.IgnoreField(fieldName, configurationSource); + } return true; } var field = Definition.FindField(fieldName); - if (field != null) return Ignore(field, configurationSource); - + if (field != null) + { + return Ignore(field, configurationSource); + } Definition.IgnoreField(fieldName, configurationSource); return true; @@ -40,7 +44,10 @@ public bool IgnoreField(string fieldName, ConfigurationSource configurationSourc public bool UnignoreField(string name, ConfigurationSource configurationSource) { var ignoredConfigurationSource = Definition.FindIgnoredFieldConfigurationSource(name); - if (!configurationSource.Overrides(ignoredConfigurationSource)) return false; + if (!configurationSource.Overrides(ignoredConfigurationSource)) + { + return false; + } Definition.UnignoreField(name); return true; @@ -49,7 +56,10 @@ public bool UnignoreField(string name, ConfigurationSource configurationSource) public InternalInputObjectTypeBuilder ClrType(Type clrType, ConfigurationSource configurationSource) { - if (Definition.SetClrType(clrType, configurationSource)) ConfigureFromClrType(); + if (Definition.SetClrType(clrType, configurationSource)) + { + ConfigureFromClrType(); + } return this; } @@ -57,9 +67,15 @@ public InternalInputObjectTypeBuilder ClrType(Type clrType, ConfigurationSource public bool ConfigureFromClrType() { var clrType = Definition.ClrType; - if (clrType == null) return false; + if (clrType == null) + { + return false; + } + if (clrType.TryGetDescriptionFromDataAnnotation(out var description)) + { Definition.SetDescription(description, ConfigurationSource.DataAnnotation); + } var flags = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static; // ReSharper disable once PossibleNullReferenceException @@ -77,7 +93,10 @@ public bool ConfigureFromClrType() public bool IsFieldIgnored(string member, ConfigurationSource configurationSource) { - if (configurationSource == ConfigurationSource.Explicit) return false; + if (configurationSource == ConfigurationSource.Explicit) + { + return false; + } var ignoredMemberConfigurationSource = Definition.FindIgnoredFieldConfigurationSource(member); return ignoredMemberConfigurationSource.HasValue && @@ -86,7 +105,10 @@ public bool IsFieldIgnored(string member, ConfigurationSource configurationSourc public bool IgnoreField(InputFieldDefinition field, ConfigurationSource configurationSource) { - if (!configurationSource.Overrides(field.GetConfigurationSource())) return false; + if (!configurationSource.Overrides(field.GetConfigurationSource())) + { + return false; + } Definition.IgnoreField(field.Name, configurationSource); @@ -95,14 +117,20 @@ public bool IgnoreField(InputFieldDefinition field, ConfigurationSource configur private bool Ignore(InputFieldDefinition field, ConfigurationSource configurationSource) { - if (!configurationSource.Overrides(field.GetConfigurationSource())) return false; + if (!configurationSource.Overrides(field.GetConfigurationSource())) + { + return false; + } return RemoveField(field, configurationSource); } public bool RemoveField(InputFieldDefinition field, ConfigurationSource configurationSource) { - if (!configurationSource.Overrides(field.GetConfigurationSource())) return false; + if (!configurationSource.Overrides(field.GetConfigurationSource())) + { + return false; + } Definition.IgnoreField(field.Name, configurationSource); @@ -115,15 +143,23 @@ public bool RemoveField(InputFieldDefinition field, ConfigurationSource configur public InternalInputValueBuilder? Field(PropertyInfo property, ConfigurationSource configurationSource) { var (fieldName, _) = property.GetGraphQLFieldName(); - if (property.IsIgnoredByDataAnnotation()) IgnoreField(property, ConfigurationSource.DataAnnotation); - - if (IsFieldIgnored(fieldName, configurationSource)) return null; + if (property.IsIgnoredByDataAnnotation()) + { + IgnoreField(property, ConfigurationSource.DataAnnotation); + } + if (IsFieldIgnored(fieldName, configurationSource)) + { + return null; + } if (property.TryGetGraphQLTypeInfo(out _, out var innerClrType)) { var fieldInnerType = Schema.Builder.InputType(innerClrType, configurationSource); - if (fieldInnerType == null) IgnoreField(property, ConfigurationSource.Convention); + if (fieldInnerType == null) + { + IgnoreField(property, ConfigurationSource.Convention); + } } else { @@ -131,7 +167,10 @@ public bool RemoveField(InputFieldDefinition field, ConfigurationSource configur } - if (IsFieldIgnored(fieldName, configurationSource)) return null; + if (IsFieldIgnored(fieldName, configurationSource)) + { + return null; + } var field = Definition.FindField(property); if (field == null) @@ -145,7 +184,9 @@ public bool RemoveField(InputFieldDefinition field, ConfigurationSource configur } if (property.TryGetDescriptionFromDataAnnotation(out var desc)) + { field.Builder.Description(desc, ConfigurationSource.DataAnnotation); + } return field.Builder; } @@ -155,15 +196,20 @@ public bool IgnoreField(MemberInfo member, ConfigurationSource configurationSour var (fieldName, _) = member.GetGraphQLFieldName(); var ignoredConfigurationSource = Definition.FindIgnoredFieldConfigurationSource(fieldName); if (ignoredConfigurationSource.HasValue) + { if (configurationSource.Overrides(ignoredConfigurationSource) && configurationSource != ignoredConfigurationSource) { Definition.IgnoreField(fieldName, configurationSource); return true; } + } var field = Definition.FindField(member); - if (field != null) return IgnoreField(field, configurationSource); + if (field != null) + { + return IgnoreField(field, configurationSource); + } Definition.IgnoreField(fieldName, configurationSource); return true; @@ -175,4 +221,4 @@ public InternalInputObjectTypeBuilder Name(string name, ConfigurationSource conf Definition.SetName(name, configurationSource); return this; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalInputValueBuilder.cs b/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalInputValueBuilder.cs index 95e8c333a..8866cf4fc 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalInputValueBuilder.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalInputValueBuilder.cs @@ -41,11 +41,17 @@ public InternalInputValueBuilder DefaultValue(ParameterInfo parameter, { var defaultValueAttribute = parameter.GetCustomAttribute(); if (defaultValueAttribute != null && defaultValueAttribute.Value != null) + { Definition.SetDefaultValue(defaultValueAttribute.Value, ConfigurationSource.DataAnnotation); + } else if (parameter.HasDefaultValue && parameter.RawDefaultValue != null) + { Definition.SetDefaultValue(parameter.RawDefaultValue, configurationSource); + } else + { RemoveDefaultValue(configurationSource); + } return this; } @@ -56,9 +62,13 @@ public InternalInputValueBuilder DefaultValue(PropertyInfo property, { var defaultValueAttribute = property.GetCustomAttribute(); if (defaultValueAttribute?.Value != null) + { Definition.SetDefaultValue(defaultValueAttribute.Value, ConfigurationSource.DataAnnotation); + } else + { RemoveDefaultValue(configurationSource); + } return this; } @@ -76,4 +86,4 @@ public InternalInputValueBuilder RemoveDefaultValue(ConfigurationSource configur Definition.RemoveDefaultValue(configurationSource); return this; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalInterfaceTypeBuilder.cs b/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalInterfaceTypeBuilder.cs index 4c0adec2d..51d5c5322 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalInterfaceTypeBuilder.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalInterfaceTypeBuilder.cs @@ -29,7 +29,10 @@ public InternalInterfaceTypeBuilder Name(string name, ConfigurationSource config public InternalInterfaceTypeBuilder ClrType(Type clrType, ConfigurationSource configurationSource) { - if (Definition.SetClrType(clrType, configurationSource)) ConfigureInterfaceFromClrType(); + if (Definition.SetClrType(clrType, configurationSource)) + { + ConfigureInterfaceFromClrType(); + } return this; } @@ -37,13 +40,18 @@ public InternalInterfaceTypeBuilder ClrType(Type clrType, ConfigurationSource co public bool ConfigureInterfaceFromClrType() { var clrType = Definition.ClrType; - if (clrType == null) return false; + if (clrType == null) + { + return false; + } ConfigureOutputFields(); if (clrType.TryGetDescriptionFromDataAnnotation(out var desc)) + { Definition.SetDescription(desc, ConfigurationSource.DataAnnotation); + } return true; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalObjectTypeBuilder.cs b/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalObjectTypeBuilder.cs index 51bdb2eee..d42258a10 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalObjectTypeBuilder.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalObjectTypeBuilder.cs @@ -25,9 +25,14 @@ public void IsTypeOf(IsTypeOf isTypeOfFn) public bool ImplementsInterface(Type clrType, ConfigurationSource configurationSource) { if (clrType.IsIgnoredByDataAnnotation()) + { IgnoreInterface(clrType.GetGraphQLName(), ConfigurationSource.DataAnnotation); + } - if (IsInterfaceIgnored(clrType.GetGraphQLName(), configurationSource)) return false; + if (IsInterfaceIgnored(clrType.GetGraphQLName(), configurationSource)) + { + return false; + } var existing = Schema.FindOutputType(clrType); @@ -56,7 +61,10 @@ public bool ImplementsInterface(Type clrType, ConfigurationSource configurationS public InternalObjectTypeBuilder ClrType(Type clrType, ConfigurationSource configurationSource) { - if (Definition.SetClrType(clrType, configurationSource)) ConfigureObjectFromClrType(); + if (Definition.SetClrType(clrType, configurationSource)) + { + ConfigureObjectFromClrType(); + } return this; } @@ -65,15 +73,22 @@ public bool ConfigureObjectFromClrType() { var clrType = Definition.ClrType; - if (clrType == null) return false; + if (clrType == null) + { + return false; + } if (clrType.BaseType != null && clrType.BaseType.IsAbstract) + { SchemaBuilder.Union(clrType.BaseType, ConfigurationSource.Convention); + } ConfigureOutputFields(); if (clrType.TryGetDescriptionFromDataAnnotation(out var desc)) + { Definition.SetDescription(desc, ConfigurationSource.DataAnnotation); + } var interfaces = clrType.GetInterfaces() .Where(_ => !_.IsGenericType) @@ -82,9 +97,13 @@ public bool ConfigureObjectFromClrType() foreach (var @interface in interfaces) { if (@interface.GetCustomAttribute() != null) + { Schema.Builder.Union(@interface, ConfigurationSource.DataAnnotation); + } else + { Definition.Builder.ImplementsInterface(@interface, ConfigurationSource.Convention); + } } return true; @@ -95,7 +114,10 @@ public InternalObjectTypeBuilder ImplementsInterface(string interfaceType, ConfigurationSource configurationSource) { var interfaceRef = SchemaBuilder.Interface(interfaceType, configurationSource)?.Definition; - if (interfaceRef != null) Definition.AddInterface(interfaceRef, configurationSource); + if (interfaceRef != null) + { + Definition.AddInterface(interfaceRef, configurationSource); + } return this; } @@ -110,7 +132,10 @@ public InternalObjectTypeBuilder IgnoreInterface(string interfaceName, Configura public bool UnignoreInterface(string name, ConfigurationSource configurationSource) { var ignoredConfigurationSource = Definition.FindIgnoredInterfaceConfigurationSource(name); - if (!configurationSource.Overrides(ignoredConfigurationSource)) return false; + if (!configurationSource.Overrides(ignoredConfigurationSource)) + { + return false; + } Definition.UnignoreInterface(name); return true; @@ -118,10 +143,13 @@ public bool UnignoreInterface(string name, ConfigurationSource configurationSour public bool IsInterfaceIgnored(string interfaceName, ConfigurationSource configurationSource) { - if (configurationSource == ConfigurationSource.Explicit) return false; + if (configurationSource == ConfigurationSource.Explicit) + { + return false; + } var ignoredMemberConfigurationSource = Definition.FindIgnoredInterfaceConfigurationSource(interfaceName); return ignoredMemberConfigurationSource.HasValue && ignoredMemberConfigurationSource.Overrides(configurationSource); } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalObjectTypeExtensions.cs b/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalObjectTypeExtensions.cs index 53fd3fb03..2c32f7d2e 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalObjectTypeExtensions.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalObjectTypeExtensions.cs @@ -17,4 +17,4 @@ public static async Task IsTypeOfAsync(this ObjectType objectType, object return src != null && objectType.IsTypeOf != null && objectType.IsTypeOf(src, context, info); } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalScalarTypeBuilder.cs b/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalScalarTypeBuilder.cs index 45a959ab8..964414d70 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalScalarTypeBuilder.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalScalarTypeBuilder.cs @@ -33,7 +33,10 @@ public InternalScalarTypeBuilder LiteralParser(LeafLiteralParser() != null) + { return Union(clrType, configurationSource.Max(ConfigurationSource.DataAnnotation))?.Definition; + } return Interface(clrType, configurationSource)?.Definition; } if (clrType.GetCustomAttribute() != null) + { return Object(id, configurationSource)?.Definition; + } - if (clrType.IsClass && clrType.IsAbstract) return Union(clrType, configurationSource)?.Definition; + if (clrType.IsClass && clrType.IsAbstract) + { + return Union(clrType, configurationSource)?.Definition; + } return Object(id, configurationSource)?.Definition; } @@ -78,18 +105,33 @@ public InternalSchemaBuilder(SchemaDefinition schemaDefinition) public NamedTypeDefinition? InputType(TypeIdentity id, ConfigurationSource configurationSource) { var clrType = id.ClrType; - if (clrType == null) return null; + if (clrType == null) + { + return null; + } - if (IsTypeIgnored(id, configurationSource)) return null; + if (IsTypeIgnored(id, configurationSource)) + { + return null; + } var def = Schema.FindInputType(clrType); if (def == null) { - if (clrType.IsEnum) return Enum(clrType, configurationSource)?.Definition; + if (clrType.IsEnum) + { + return Enum(clrType, configurationSource)?.Definition; + } - if (clrType.IsValueType) return Scalar(clrType, configurationSource)?.Definition; + if (clrType.IsValueType) + { + return Scalar(clrType, configurationSource)?.Definition; + } - if (clrType.IsClass) return InputObject(id, configurationSource)?.Definition; + if (clrType.IsClass) + { + return InputObject(id, configurationSource)?.Definition; + } } return def; @@ -140,9 +182,14 @@ private static string InvalidTypeAddition(TypeKind kind, TypeIdentity identity, private InternalUnionTypeBuilder? Union(in TypeIdentity id, ConfigurationSource configurationSource) { if (id.ClrType != null && id.ClrType.IsIgnoredByDataAnnotation()) + { IgnoreType(id.ClrType, ConfigurationSource.DataAnnotation); + } - if (IsTypeIgnored(id, configurationSource)) return null; + if (IsTypeIgnored(id, configurationSource)) + { + return null; + } var type = id.ClrType == null ? Definition.FindType(id.Name) @@ -152,7 +199,10 @@ private static string InvalidTypeAddition(TypeKind kind, TypeIdentity identity, { unionType.UpdateConfigurationSource(configurationSource); if (id.ClrType != null && id.ClrType != unionType.ClrType) + { unionType.Builder.ClrType(id.ClrType, ConfigurationSource.Explicit); + } + return unionType.Builder; } @@ -175,7 +225,10 @@ private static string InvalidTypeAddition(TypeKind kind, TypeIdentity identity, private void OnUnionAdded(UnionTypeDefinition unionType) { var clrType = unionType.ClrType; - if (clrType != null) unionType.Builder.ConfigureFromClrType(); + if (clrType != null) + { + unionType.Builder.ConfigureFromClrType(); + } } @@ -188,9 +241,14 @@ private void OnUnionAdded(UnionTypeDefinition unionType) private InternalScalarTypeBuilder? Scalar(in TypeIdentity id, ConfigurationSource configurationSource) { if (id.ClrType != null && id.ClrType.IsIgnoredByDataAnnotation()) + { IgnoreType(id.ClrType, ConfigurationSource.DataAnnotation); + } - if (IsTypeIgnored(id, configurationSource)) return null; + if (IsTypeIgnored(id, configurationSource)) + { + return null; + } var type = id.ClrType == null ? Definition.FindType(id.Name) @@ -200,7 +258,10 @@ private void OnUnionAdded(UnionTypeDefinition unionType) { scalarType.UpdateConfigurationSource(configurationSource); if (id.ClrType != null && id.ClrType != type.ClrType) + { scalarType.Builder.ClrType(id.ClrType, configurationSource); + } + return scalarType.Builder; } @@ -223,7 +284,10 @@ private void OnUnionAdded(UnionTypeDefinition unionType) private void OnScalarAdded(ScalarTypeDefinition scalarType) { var clrType = scalarType.ClrType; - if (clrType != null) scalarType.Builder.ConfigureFromClrType(); + if (clrType != null) + { + scalarType.Builder.ConfigureFromClrType(); + } } @@ -238,9 +302,14 @@ public InternalInterfaceTypeBuilder? ConfigurationSource configurationSource) { if (id.ClrType != null && id.ClrType.IsIgnoredByDataAnnotation()) + { IgnoreType(id.ClrType, ConfigurationSource.DataAnnotation); + } - if (IsTypeIgnored(id, configurationSource)) return null; + if (IsTypeIgnored(id, configurationSource)) + { + return null; + } var type = id.ClrType == null ? Definition.FindType(id.Name) @@ -250,7 +319,10 @@ public InternalInterfaceTypeBuilder? { interfaceType.UpdateConfigurationSource(configurationSource); if (type.ClrType != id.ClrType && id.ClrType != null) + { interfaceType.Builder.ClrType(id.ClrType, configurationSource); + } + return interfaceType.Builder; } @@ -276,7 +348,10 @@ public InternalInterfaceTypeBuilder? private void OnInterfaceAdded(InterfaceTypeDefinition interfaceType) { var clrType = interfaceType.ClrType; - if (clrType != null) interfaceType.Builder.ConfigureInterfaceFromClrType(); + if (clrType != null) + { + interfaceType.Builder.ConfigureInterfaceFromClrType(); + } } public InternalEnumTypeBuilder? Enum(Type clrType, ConfigurationSource configurationSource) => @@ -289,9 +364,14 @@ private void OnInterfaceAdded(InterfaceTypeDefinition interfaceType) private InternalEnumTypeBuilder? Enum(in TypeIdentity id, ConfigurationSource configurationSource) { if (id.ClrType != null && id.ClrType.IsIgnoredByDataAnnotation()) + { IgnoreType(id.ClrType, ConfigurationSource.DataAnnotation); + } - if (IsTypeIgnored(id, configurationSource)) return null; + if (IsTypeIgnored(id, configurationSource)) + { + return null; + } var type = id.ClrType == null ? Definition.FindType(id.Name) @@ -301,7 +381,10 @@ private void OnInterfaceAdded(InterfaceTypeDefinition interfaceType) { enumType.UpdateConfigurationSource(configurationSource); if (id.ClrType != null && id.ClrType != type.ClrType) + { enumType.Builder.ClrType(id.ClrType, ConfigurationSource.Explicit); + } + return enumType.Builder; } @@ -324,7 +407,10 @@ private void OnInterfaceAdded(InterfaceTypeDefinition interfaceType) private void OnEnumAdded(EnumTypeDefinition enumType) { var clrType = enumType.ClrType; - if (clrType != null) enumType.Builder.ConfigureEnumFromClrType(); + if (clrType != null) + { + enumType.Builder.ConfigureEnumFromClrType(); + } } @@ -340,11 +426,19 @@ private void OnEnumAdded(EnumTypeDefinition enumType) ConfigurationSource configurationSource) { if (id.ClrType != null && id.ClrType.IsIgnoredByDataAnnotation()) + { IgnoreType(id.ClrType, ConfigurationSource.DataAnnotation); + } - if (IsTypeIgnored(id, configurationSource)) return null; + if (IsTypeIgnored(id, configurationSource)) + { + return null; + } - if (IsTypeIgnored(id, configurationSource)) return null; + if (IsTypeIgnored(id, configurationSource)) + { + return null; + } var type = id.ClrType == null ? Definition.FindType(id.Name) @@ -354,7 +448,10 @@ private void OnEnumAdded(EnumTypeDefinition enumType) { inputType.UpdateConfigurationSource(configurationSource); if (id.ClrType != null && id.ClrType != type.ClrType) + { inputType.Builder.ClrType(id.ClrType, configurationSource); + } + return inputType.Builder; } @@ -377,7 +474,10 @@ private void OnEnumAdded(EnumTypeDefinition enumType) private void OnInputObjectAdded(InputObjectTypeDefinition inputType) { var clrType = inputType.ClrType; - if (clrType != null) inputType.Builder.ConfigureFromClrType(); + if (clrType != null) + { + inputType.Builder.ConfigureFromClrType(); + } } public InternalObjectTypeBuilder? Object(Type clrType, ConfigurationSource configurationSource) => @@ -389,10 +489,14 @@ private void OnInputObjectAdded(InputObjectTypeDefinition inputType) private InternalObjectTypeBuilder? Object(in TypeIdentity id, ConfigurationSource configurationSource) { if (id.ClrType != null && id.ClrType.IsIgnoredByDataAnnotation()) + { IgnoreType(id.ClrType, ConfigurationSource.DataAnnotation); + } - - if (IsTypeIgnored(id, configurationSource)) return null; + if (IsTypeIgnored(id, configurationSource)) + { + return null; + } var type = id.ClrType == null ? Definition.FindType(id.Name) @@ -402,7 +506,10 @@ private void OnInputObjectAdded(InputObjectTypeDefinition inputType) { objectType.UpdateConfigurationSource(configurationSource); if (objectType.ClrType != id.ClrType && id.ClrType != null) + { objectType.Builder.ClrType(id.ClrType, configurationSource); + } + return objectType.Builder; } @@ -424,7 +531,10 @@ private void OnInputObjectAdded(InputObjectTypeDefinition inputType) public InternalDirectiveBuilder? Directive(string name, ConfigurationSource configurationSource) { - if (IsDirectiveIgnored(name, configurationSource)) return null; + if (IsDirectiveIgnored(name, configurationSource)) + { + return null; + } var directive = Definition.FindDirective(name); @@ -448,13 +558,19 @@ private void OnDirectiveAdded(DirectiveDefinition directive) private void OnObjectAdded(ObjectTypeDefinition objectType) { var clrType = objectType.ClrType; - if (clrType != null) objectType.Builder.ConfigureObjectFromClrType(); + if (clrType != null) + { + objectType.Builder.ConfigureObjectFromClrType(); + } } public bool UnignoreType(string name, ConfigurationSource configurationSource) { var ignoredConfigurationSource = Definition.FindIgnoredTypeConfigurationSource(name); - if (!configurationSource.Overrides(ignoredConfigurationSource)) return false; + if (!configurationSource.Overrides(ignoredConfigurationSource)) + { + return false; + } Definition.UnignoreType(name); return true; @@ -463,7 +579,10 @@ public bool UnignoreType(string name, ConfigurationSource configurationSource) public bool UnignoreType(Type clrType, ConfigurationSource configurationSource) { var ignoredConfigurationSource = Definition.FindIgnoredTypeConfigurationSource(clrType); - if (!configurationSource.Overrides(ignoredConfigurationSource)) return false; + if (!configurationSource.Overrides(ignoredConfigurationSource)) + { + return false; + } Definition.UnignoreType(clrType); return true; @@ -480,13 +599,18 @@ public bool IgnoreType(string name, ConfigurationSource configurationSource) { if (configurationSource.Overrides(ignoredConfigurationSource) && configurationSource != ignoredConfigurationSource) + { Definition.IgnoreType(name, configurationSource); + } return true; } var type = Definition.FindType(name); - if (type != null) return IgnoreType(type, configurationSource); + if (type != null) + { + return IgnoreType(type, configurationSource); + } Definition.IgnoreType(name, configurationSource); return true; @@ -494,12 +618,19 @@ public bool IgnoreType(string name, ConfigurationSource configurationSource) public bool IgnoreType(NamedTypeDefinition type, ConfigurationSource configurationSource) { - if (!configurationSource.Overrides(type.GetConfigurationSource())) return false; + if (!configurationSource.Overrides(type.GetConfigurationSource())) + { + return false; + } if (type.ClrType != null) + { Definition.IgnoreType(type.ClrType, configurationSource); + } else + { Definition.IgnoreType(type.Name, configurationSource); + } return RemoveType(type, configurationSource); } @@ -509,14 +640,21 @@ private bool IsDirectiveIgnored(Type clrType, ConfigurationSource configurationS private bool IsDirectiveIgnored(string name, ConfigurationSource configurationSource) { - if (configurationSource == ConfigurationSource.Explicit) return false; + if (configurationSource == ConfigurationSource.Explicit) + { + return false; + } + var ignoredConfigurationSource = Definition.FindIgnoredDirectiveConfigurationSource(name); return !configurationSource.Overrides(ignoredConfigurationSource); } private bool IsTypeIgnored(in TypeIdentity identity, ConfigurationSource configurationSource) { - if (configurationSource == ConfigurationSource.Explicit) return false; + if (configurationSource == ConfigurationSource.Explicit) + { + return false; + } var ignoredConfigurationSource = Definition.FindIgnoredTypeConfigurationSource(identity.Name); return ignoredConfigurationSource.HasValue && ignoredConfigurationSource.Overrides(configurationSource); @@ -563,7 +701,10 @@ public InternalSchemaBuilder MutationType(Type clrType, ConfigurationSource conf public bool RemoveType(NamedTypeDefinition type, ConfigurationSource configurationSource) { - if (!configurationSource.Overrides(type.GetConfigurationSource())) return false; + if (!configurationSource.Overrides(type.GetConfigurationSource())) + { + return false; + } Schema.RemoveType(type); @@ -589,4 +730,4 @@ public void UnignoreDirective(string name, ConfigurationSource configurationSour { Definition.UnignoreDirective(name, configurationSource); } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalUnionTypeBuilder.cs b/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalUnionTypeBuilder.cs index 5e7731ddf..e840f14c0 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalUnionTypeBuilder.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Internal/InternalUnionTypeBuilder.cs @@ -22,7 +22,10 @@ public InternalUnionTypeBuilder IncludesType(string objectType, ConfigurationSource configurationSource) { var obj = Schema.Builder.Object(objectType, configurationSource)?.Definition; - if (obj != null) Definition.AddType(obj); + if (obj != null) + { + Definition.AddType(obj); + } return this; } @@ -32,14 +35,20 @@ public InternalUnionTypeBuilder IncludesType(Type clrType, ConfigurationSource configurationSource) { var objectType = Schema.Builder.Object(clrType, configurationSource)?.Definition; - if (objectType != null) Definition.AddType(objectType); + if (objectType != null) + { + Definition.AddType(objectType); + } return this; } public InternalUnionTypeBuilder ClrType(Type clrType, ConfigurationSource configurationSource) { - if (Definition.SetClrType(clrType, configurationSource)) ConfigureFromClrType(); + if (Definition.SetClrType(clrType, configurationSource)) + { + ConfigureFromClrType(); + } return this; } @@ -47,18 +56,26 @@ public InternalUnionTypeBuilder ClrType(Type clrType, ConfigurationSource config public bool ConfigureFromClrType() { var clrType = Definition.ClrType; - if (clrType == null) return false; + if (clrType == null) + { + return false; + } if (clrType.TryGetDescriptionFromDataAnnotation(out var description)) + { this.Description(description, ConfigurationSource.DataAnnotation); + } var implementingTypes = clrType.GetImplementingTypes().Where(_ => !_.IsAbstract); foreach (var implementingType in implementingTypes) { var memberType = SchemaBuilder.Object(implementingType, ConfigurationSource.Convention)?.Definition; - if (memberType != null) Definition.AddType(memberType); + if (memberType != null) + { + Definition.AddType(memberType); + } } return true; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Internal/MemberDefinitionBuilder.cs b/src/GraphZen.TypeSystem/TypeSystem/Internal/MemberDefinitionBuilder.cs index 29d3b7f1e..5144a8f29 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Internal/MemberDefinitionBuilder.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Internal/MemberDefinitionBuilder.cs @@ -33,4 +33,4 @@ protected MemberDefinitionBuilder(MemberDefinition definition, public SchemaDefinition Schema => SchemaBuilder.Definition; -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Internal/MemberInfoExtensions.cs b/src/GraphZen.TypeSystem/TypeSystem/Internal/MemberInfoExtensions.cs index 2c29f64a1..1d04ff435 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Internal/MemberInfoExtensions.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Internal/MemberInfoExtensions.cs @@ -108,10 +108,15 @@ private static (string name, ConfigurationSource nameConfigurationSource) GetGra this MemberInfo member, Type fieldClrType) { var customName = member.GetCustomAttribute()?.Name; - if (customName != null) return (customName, ConfigurationSource.DataAnnotation); + if (customName != null) + { + return (customName, ConfigurationSource.DataAnnotation); + } if (fieldClrType.IsGenericType && fieldClrType.GetGenericTypeDefinition() == typeof(Task<>)) + { return (member.Name.TrimAsyncSuffix().FirstCharToLower(), ConfigurationSource.Convention); + } return (member.Name.FirstCharToLower(), ConfigurationSource.Convention); } @@ -122,8 +127,11 @@ public static (string name, ConfigurationSource configurationSource) GetGraphQLN Check.NotNull(member, nameof(member)); var customName = member.GetCustomAttribute()?.Name; - if (customName != null) return (customName, ConfigurationSource.DataAnnotation); + if (customName != null) + { + return (customName, ConfigurationSource.DataAnnotation); + } return (member.Name, ConfigurationSource.Convention); } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Internal/ParseResult.cs b/src/GraphZen.TypeSystem/TypeSystem/Internal/ParseResult.cs index c8eb25e98..793a54ae1 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Internal/ParseResult.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Internal/ParseResult.cs @@ -25,4 +25,4 @@ public static class ParseResult public static ParseResult FromValue(TInner value) => new(value, true); public static ParseResult Empty() => new(default(TInner), false); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Internal/PropertyInfoExtensions.cs b/src/GraphZen.TypeSystem/TypeSystem/Internal/PropertyInfoExtensions.cs index ec994d1c2..03cf46643 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Internal/PropertyInfoExtensions.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Internal/PropertyInfoExtensions.cs @@ -42,4 +42,4 @@ public static bool CanBeNull(this MethodInfo property) => public static bool ItemCanBeNull(this MethodInfo property) => property.GetCustomAttribute(true) != null; -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Internal/ResolveInfo.cs b/src/GraphZen.TypeSystem/TypeSystem/Internal/ResolveInfo.cs index a4b7125ab..b01f09eaf 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Internal/ResolveInfo.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Internal/ResolveInfo.cs @@ -47,4 +47,4 @@ internal ResolveInfo(string fieldName, IReadOnlyList fieldNodes, IG public OperationDefinitionSyntax Operation { get; } public IReadOnlyDictionary VariableValues { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Internal/ResponsePathHelpers.cs b/src/GraphZen.TypeSystem/TypeSystem/Internal/ResponsePathHelpers.cs index 2624c759c..95c01c3f0 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Internal/ResponsePathHelpers.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Internal/ResponsePathHelpers.cs @@ -9,4 +9,4 @@ public static class ResponsePathHelpers { [DebuggerStepThrough] public static ResponsePath AddPath(this ResponsePath path, object key) => new(path, key); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Internal/SdlSchemaConfigurator.cs b/src/GraphZen.TypeSystem/TypeSystem/Internal/SdlSchemaConfigurator.cs index c5ec0c803..30cced462 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Internal/SdlSchemaConfigurator.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Internal/SdlSchemaConfigurator.cs @@ -23,7 +23,9 @@ public void Configure(SchemaBuilder schemaBuilder) Debug.Assert(_ != null, nameof(_) + " != null"); return _.Name.Value; }, out var duplicateType)) + { throw new GraphQLException($"Type \"{duplicateType.Name.Value}\" was defined more than once"); + } var operationTypes = schemaDef != null ? GetOperationTypes(schemaDef) @@ -79,13 +81,17 @@ IReadOnlyDictionary GetOperationTypes( return _.OperationType; }, out var duplicateOpType)) + { throw new Exception($"Must provide only one {duplicateOpType} type in schema."); + } return schemaDefinition.RootOperationTypes.ToDictionary(_ => _.OperationType, _ => { var typeName = _.Type.Name.Value; if (!types.TryFindByName(typeName, out var type)) + { throw new Exception($"Specified {_.OperationType} type \"{typeName}\" not found in document."); + } return type!; }); @@ -96,7 +102,10 @@ private static void ConfigureDirective(SchemaBuilder schemaBuilder, DirectiveDefinitionSyntax def) { var directive = schemaBuilder.Directive(def.Name.Value); - if (def.Description != null) directive.Description(def.Description.Value); + if (def.Description != null) + { + directive.Description(def.Description.Value); + } foreach (var arg in def.Arguments) { @@ -104,7 +113,10 @@ private static void ConfigureDirective(SchemaBuilder schemaBuilder, { Debug.Assert(_ != null, nameof(_) + " != null"); // TODO - how to get default value? - if (arg.Description != null) _.Description(arg.Description.Value); + if (arg.Description != null) + { + _.Description(arg.Description.Value); + } }); } @@ -121,124 +133,157 @@ private static void ConfigureType(SchemaBuilder schemaBuilder, TypeDefinitionSyn switch (def) { case EnumTypeDefinitionSyntax node: - { - var type = schemaBuilder.Enum(node.Name.Value); - if (node.Description != null) type.Description(node.Description.Value); - - foreach (var valueNode in node.Values) - { - var enumValue = type.Value(valueNode.Value.Value); - if (valueNode.Description != null) enumValue.Description(valueNode.Description.Value); - } - - break; - } - - case InputObjectTypeDefinitionSyntax node: - { - var type = schemaBuilder.InputObject(node.Name.Value); - if (node.Description != null) type.Description(node.Description.Value); - - foreach (var fieldNode in node.Fields) { - var field = type.Field(fieldNode.Name.Value, fieldNode.Type.ToSyntaxString()); - if (fieldNode.Description != null) field.Description(fieldNode.Description.Value); - - if (fieldNode.DefaultValue != null) + var type = schemaBuilder.Enum(node.Name.Value); + if (node.Description != null) { + type.Description(node.Description.Value); } - } - break; - } + foreach (var valueNode in node.Values) + { + var enumValue = type.Value(valueNode.Value.Value); + if (valueNode.Description != null) + { + enumValue.Description(valueNode.Description.Value); + } + } - case InterfaceTypeDefinitionSyntax node: - { - var type = schemaBuilder.Interface(node.Name.Value); - if (node.Description != null) type.Description(node.Description.Value); + break; + } - foreach (var fieldNode in node.Fields) + case InputObjectTypeDefinitionSyntax node: { - type.Field(fieldNode.Name.Value, fieldNode.FieldType.ToSyntaxString(), field => + var type = schemaBuilder.InputObject(node.Name.Value); + if (node.Description != null) { - Debug.Assert(field != null, nameof(field) + " != null"); - if (fieldNode.Description != null) field.Description(fieldNode.Description.Value); + type.Description(node.Description.Value); + } + foreach (var fieldNode in node.Fields) + { + var field = type.Field(fieldNode.Name.Value, fieldNode.Type.ToSyntaxString()); + if (fieldNode.Description != null) + { + field.Description(fieldNode.Description.Value); + } - foreach (var argumentNode in fieldNode.Arguments) + if (fieldNode.DefaultValue != null) { - var argument = field.Argument(argumentNode.Name.Value, - argumentNode.Type.ToSyntaxString()); - if (argumentNode.Description != null) - argument.Description(argumentNode.Description.Value); } - }); + } + + break; } - break; - } + case InterfaceTypeDefinitionSyntax node: + { + var type = schemaBuilder.Interface(node.Name.Value); + if (node.Description != null) + { + type.Description(node.Description.Value); + } - case ObjectTypeDefinitionSyntax node: - { - var type = schemaBuilder.Object(node.Name.Value); - if (node.Description != null) type.Description(node.Description.Value); + foreach (var fieldNode in node.Fields) + { + type.Field(fieldNode.Name.Value, fieldNode.FieldType.ToSyntaxString(), field => + { + Debug.Assert(field != null, nameof(field) + " != null"); + if (fieldNode.Description != null) + { + field.Description(fieldNode.Description.Value); + } + + foreach (var argumentNode in fieldNode.Arguments) + { + var argument = field.Argument(argumentNode.Name.Value, + argumentNode.Type.ToSyntaxString()); + if (argumentNode.Description != null) + { + argument.Description(argumentNode.Description.Value); + } + } + }); + } - foreach (var directive in node.Directives) - { - type.DirectiveAnnotation(directive.Name.Value, directive); + break; } - foreach (var iface in node.Interfaces) + case ObjectTypeDefinitionSyntax node: { - type.ImplementsInterface(iface.Name.Value); - } + var type = schemaBuilder.Object(node.Name.Value); + if (node.Description != null) + { + type.Description(node.Description.Value); + } - foreach (var fieldNode in node.Fields) - { - type.Field(fieldNode.Name.Value, fieldNode.FieldType.ToSyntaxString(), field => + foreach (var directive in node.Directives) { - if (fieldNode.Description != null) field.Description(fieldNode.Description.Value); + type.DirectiveAnnotation(directive.Name.Value, directive); + } - foreach (var directiveNode in fieldNode.Directives) - { - field.DirectiveAnnotation(directiveNode.Name.Value, directiveNode); - } + foreach (var iface in node.Interfaces) + { + type.ImplementsInterface(iface.Name.Value); + } - foreach (var argumentNode in fieldNode.Arguments) + foreach (var fieldNode in node.Fields) + { + type.Field(fieldNode.Name.Value, fieldNode.FieldType.ToSyntaxString(), field => { - var argument = field.Argument(argumentNode.Name.Value, - argumentNode.Type.ToSyntaxString()); + if (fieldNode.Description != null) + { + field.Description(fieldNode.Description.Value); + } + + foreach (var directiveNode in fieldNode.Directives) + { + field.DirectiveAnnotation(directiveNode.Name.Value, directiveNode); + } + + foreach (var argumentNode in fieldNode.Arguments) + { + var argument = field.Argument(argumentNode.Name.Value, + argumentNode.Type.ToSyntaxString()); + + if (argumentNode.Description != null) + { + argument.Description(argumentNode.Description.Value); + } + } + }); + } - if (argumentNode.Description != null) - argument.Description(argumentNode.Description.Value); - } - }); + break; } - break; - } - case ScalarTypeDefinitionSyntax node: - { - var type = schemaBuilder.Scalar(node.Name.Value); - if (node.Description != null) type.Description(node.Description.Value); + { + var type = schemaBuilder.Scalar(node.Name.Value); + if (node.Description != null) + { + type.Description(node.Description.Value); + } - break; - } + break; + } case UnionTypeDefinitionSyntax node: - { - var type = schemaBuilder.Union(node.Name.Value); - if (node.Description != null) type.Description(node.Description.Value); - - type.OfTypes(node.MemberTypes.Select(_ => { - Debug.Assert(_ != null, nameof(_) + " != null"); - return _.Name.Value; - }).ToArray()); + var type = schemaBuilder.Union(node.Name.Value); + if (node.Description != null) + { + type.Description(node.Description.Value); + } - break; - } + type.OfTypes(node.MemberTypes.Select(_ => + { + Debug.Assert(_ != null, nameof(_) + " != null"); + return _.Name.Value; + }).ToArray()); + + break; + } } } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Introspection.cs b/src/GraphZen.TypeSystem/TypeSystem/Introspection.cs index d048d8dd8..4a35d5e56 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Introspection.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Introspection.cs @@ -54,8 +54,10 @@ source is IAbstractType abstractType .Resolve((type, args) => { if (type is EnumType enumType) + { return enumType.GetValues() .Where(f => args.includeDeprecated || !f.IsDeprecated).ToList(); + } return null; })) @@ -126,4 +128,4 @@ type is InputObjectType inputObject Schema.GetTypes() .Where(_ => SpecScalars.All.All(ss => ss.Name != _.Name)) .ToImmutableList(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/IsTypeOf.cs b/src/GraphZen.TypeSystem/TypeSystem/IsTypeOf.cs index 7de24a5a6..17c8b6d5a 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/IsTypeOf.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/IsTypeOf.cs @@ -4,4 +4,4 @@ namespace GraphZen.TypeSystem; public delegate bool IsTypeOf(TObject value, TContext context, ResolveInfo info) - where TContext : GraphQLContext; \ No newline at end of file + where TContext : GraphQLContext; diff --git a/src/GraphZen.TypeSystem/TypeSystem/LeafLiteralParser.cs b/src/GraphZen.TypeSystem/TypeSystem/LeafLiteralParser.cs index 55fa8f6f3..6d94375d3 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/LeafLiteralParser.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/LeafLiteralParser.cs @@ -6,4 +6,4 @@ namespace GraphZen.TypeSystem; public delegate Maybe LeafLiteralParser(TValueNode valueNode) - where TValueNode : ValueSyntax; \ No newline at end of file + where TValueNode : ValueSyntax; diff --git a/src/GraphZen.TypeSystem/TypeSystem/LeafSerializer.cs b/src/GraphZen.TypeSystem/TypeSystem/LeafSerializer.cs index 74c3ff745..d93ecaf5d 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/LeafSerializer.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/LeafSerializer.cs @@ -7,4 +7,4 @@ namespace GraphZen.TypeSystem; public delegate Maybe LeafSerializer(TScalar value); -public delegate Maybe LeafSerializer(object value); \ No newline at end of file +public delegate Maybe LeafSerializer(object value); diff --git a/src/GraphZen.TypeSystem/TypeSystem/LeafValueParser.cs b/src/GraphZen.TypeSystem/TypeSystem/LeafValueParser.cs index a4c6207ee..dcba90388 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/LeafValueParser.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/LeafValueParser.cs @@ -7,4 +7,4 @@ namespace GraphZen.TypeSystem; public delegate Maybe LeafValueParser(object value); -public delegate Maybe LeafValueParser(object value); \ No newline at end of file +public delegate Maybe LeafValueParser(object value); diff --git a/src/GraphZen.TypeSystem/TypeSystem/ListType.cs b/src/GraphZen.TypeSystem/TypeSystem/ListType.cs index 54c1e7ce2..bf0c57ba1 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/ListType.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/ListType.cs @@ -18,11 +18,20 @@ public class ListType : IListType public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } - if (obj.GetType() != GetType()) return false; + if (obj.GetType() != GetType()) + { + return false; + } return Equals((ListType)obj); } @@ -30,4 +39,4 @@ public override bool Equals(object? obj) public override int GetHashCode() => OfType.GetHashCode(); public override string ToString() => $"[{OfType}]"; -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Member.cs b/src/GraphZen.TypeSystem/TypeSystem/Member.cs index eb94b07c8..17fed01f8 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Member.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Member.cs @@ -10,4 +10,4 @@ public abstract class Member : ISyntaxConvertable [GraphQLIgnore] public abstract SyntaxNode ToSyntaxNode(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/MemberDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/MemberDefinition.cs index f6e7872da..7652139ec 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/MemberDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/MemberDefinition.cs @@ -32,4 +32,4 @@ public void UpdateConfigurationSource(ConfigurationSource configurationSource) { _configurationSource = _configurationSource.Max(configurationSource); } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/NamedType.cs b/src/GraphZen.TypeSystem/TypeSystem/NamedType.cs index 0ee9f5340..a4d22d16a 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/NamedType.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/NamedType.cs @@ -42,4 +42,4 @@ public static NamedType From(INamedTypeDefinition definition, Schema schema) } public override string ToString() => Name; -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/NamedTypeDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/NamedTypeDefinition.cs index af6d2947c..2f9d53b6e 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/NamedTypeDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/NamedTypeDefinition.cs @@ -22,9 +22,13 @@ protected NamedTypeDefinition(TypeIdentity identity, SchemaDefinition schema, { if (identity.ClrType.TryGetGraphQLNameFromDataAnnotation(out var customName) && customName == identity.Name) + { _nameConfigurationSource = ConfigurationSource.DataAnnotation; + } else + { _nameConfigurationSource = ConfigurationSource.Convention; + } } else { @@ -45,7 +49,11 @@ protected NamedTypeDefinition(TypeIdentity identity, SchemaDefinition schema, public bool SetName(string name, ConfigurationSource configurationSource) { - if (!configurationSource.Overrides(_nameConfigurationSource)) return false; + if (!configurationSource.Overrides(_nameConfigurationSource)) + { + return false; + } + _nameConfigurationSource = configurationSource; Identity.Name = name; return true; @@ -57,7 +65,11 @@ public bool SetName(string name, ConfigurationSource configurationSource) public virtual bool SetClrType(Type clrType, ConfigurationSource configurationSource) { - if (!configurationSource.Overrides(_clrTypeConfigurationSource)) return false; + if (!configurationSource.Overrides(_clrTypeConfigurationSource)) + { + return false; + } + _clrTypeConfigurationSource = configurationSource; Identity.ClrType = clrType; return true; @@ -71,4 +83,4 @@ public TypeReference GetTypeReference() => ClrType != null ? NamedType(ClrType) : NamedType(Name(Name))); public override string ToString() => Name; -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/NonNullType.cs b/src/GraphZen.TypeSystem/TypeSystem/NonNullType.cs index 2009068ca..7f0d22fe2 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/NonNullType.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/NonNullType.cs @@ -21,11 +21,20 @@ public class NonNullType : INonNullType public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } - if (obj.GetType() != GetType()) return false; + if (obj.GetType() != GetType()) + { + return false; + } return Equals((NonNullType)obj); } @@ -33,4 +42,4 @@ public override bool Equals(object? obj) public override int GetHashCode() => OfType.GetHashCode(); public override string ToString() => $"{OfType}!"; -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/ObjectType.cs b/src/GraphZen.TypeSystem/TypeSystem/ObjectType.cs index 7c4718346..99830b901 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/ObjectType.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/ObjectType.cs @@ -90,4 +90,4 @@ public static ObjectType From(IObjectTypeDefinition definition, Schema schema) schema ); } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/ObjectTypeBuilder.cs b/src/GraphZen.TypeSystem/TypeSystem/ObjectTypeBuilder.cs index 2539abd7b..bfa809f22 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/ObjectTypeBuilder.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/ObjectTypeBuilder.cs @@ -194,4 +194,4 @@ public IObjectTypeBuilder IgnoreDirectiveAnnotation(string na public IObjectTypeBuilder IgnoreField(Expression> fieldSelector) => throw new NotImplementedException(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/ObjectTypeDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/ObjectTypeDefinition.cs index 7c47271a9..6f24b2325 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/ObjectTypeDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/ObjectTypeDefinition.cs @@ -50,19 +50,28 @@ public bool AddInterface(InterfaceTypeDefinition @interface, ConfigurationSource { Check.NotNull(@interface, nameof(@interface)); - if (@interface.Name == null) throw new ArgumentException("Interface must have a name", nameof(@interface)); + if (@interface.Name == null) + { + throw new ArgumentException("Interface must have a name", nameof(@interface)); + } var interfaceName = @interface.Name; var ignoredInterfaceConfigurationSource = FindIgnoredInterfaceConfigurationSource(interfaceName); if (ignoredInterfaceConfigurationSource.HasValue) { - if (!configurationSource.Overrides(ignoredInterfaceConfigurationSource)) return false; + if (!configurationSource.Overrides(ignoredInterfaceConfigurationSource)) + { + return false; + } UnignoreInterface(interfaceName); } - if (_interfaces.Contains(@interface)) return true; + if (_interfaces.Contains(@interface)) + { + return true; + } _interfaces.Add(@interface); return true; @@ -78,7 +87,10 @@ public bool IgnoreInterface(string interfaceName, ConfigurationSource configurat { Check.NotNull(interfaceName, nameof(interfaceName)); var ignoredConfigurationSource = FindIgnoredInterfaceConfigurationSource(interfaceName); - if (!configurationSource.Overrides(ignoredConfigurationSource)) return false; + if (!configurationSource.Overrides(ignoredConfigurationSource)) + { + return false; + } if (_ignoredInterfaces.TryGetValue(interfaceName, out var existingIgnoredConfigurationSource)) { @@ -98,11 +110,15 @@ private bool RemoveInterface(string interfaceName, ConfigurationSource configura var existing = _interfaces.SingleOrDefault(_ => _.Name == interfaceName); if (existing != null) { - if (!configurationSource.Overrides(existing.GetConfigurationSource())) return false; + if (!configurationSource.Overrides(existing.GetConfigurationSource())) + { + return false; + } + _interfaces.Remove(existing); return true; } return false; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Resolver.cs b/src/GraphZen.TypeSystem/TypeSystem/Resolver.cs index 8b1e8b2db..a24cf0b8f 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Resolver.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Resolver.cs @@ -5,4 +5,4 @@ namespace GraphZen.TypeSystem; public delegate TResult Resolver(TSource source, dynamic args, GraphQLContext context, - ResolveInfo resolveInfo); \ No newline at end of file + ResolveInfo resolveInfo); diff --git a/src/GraphZen.TypeSystem/TypeSystem/ScalarType.cs b/src/GraphZen.TypeSystem/TypeSystem/ScalarType.cs index 642adfbd4..8e186ad02 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/ScalarType.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/ScalarType.cs @@ -69,7 +69,10 @@ public Maybe ParseLiteral(ValueSyntax value) public static ScalarType From(IScalarTypeDefinition definition) { Check.NotNull(definition, nameof(definition)); - if (definition is ScalarTypeDefinition scalarDef && scalarDef.Source != null) return scalarDef.Source; + if (definition is ScalarTypeDefinition scalarDef && scalarDef.Source != null) + { + return scalarDef.Source; + } return new ScalarType( definition.Name, @@ -105,4 +108,4 @@ public static ScalarType Create(Action DirectiveAnnotation(string name, public IScalarTypeBuilder IgnoreDirectiveAnnotation(string name) => throw new NotImplementedException(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/ScalarTypeDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/ScalarTypeDefinition.cs index c21d6be19..7bc6aa556 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/ScalarTypeDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/ScalarTypeDefinition.cs @@ -54,4 +54,4 @@ public bool SetValueParser(LeafValueParser? valueParser, ConfigurationSo public override DirectiveLocation DirectiveLocation { get; } = DirectiveLocation.Scalar; public override TypeKind Kind { get; } = TypeKind.Scalar; -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Schema.cs b/src/GraphZen.TypeSystem/TypeSystem/Schema.cs index e88853552..2cbbaf5f2 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Schema.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Schema.cs @@ -55,8 +55,9 @@ public Schema(SchemaDefinition schemaDefinition, IEnumerable? types = // initialTypes.AddRange(SpecScalars.All); //} if (schemaDefinition.Types.All(_ => _.Name != "__Schema")) + { initialTypes.AddRange(Introspection.IntrospectionTypes); - + } initialTypes.AddRange(types); @@ -84,7 +85,9 @@ public Schema(SchemaDefinition schemaDefinition, IEnumerable? types = .FirstOrDefault(); if (duplicate != null) + { throw new InvalidOperationException($"Type `{duplicate.Name}` defined twice, cannot create schema."); + } // ReSharper disable once PossibleNullReferenceException Types = initialTypes @@ -104,25 +107,33 @@ public Schema(SchemaDefinition schemaDefinition, IEnumerable? types = foreach (var type in Types.Values) { if (type is ObjectType objectType) + { foreach (var iface in objectType.Interfaces) { if (_implementations.TryGetValue(iface.Name, out var impls)) + { impls.Add(objectType); + } else + { _implementations[iface.Name] = new List { objectType }; + } } + } } foreach (var type in Types.Values) { if (type is ObjectType objectType) + { foreach (var iface in objectType.Interfaces) { AssertObjectImplementsInterfaces(objectType, iface); } + } } _syntax = new Lazy(() => @@ -130,17 +141,22 @@ public Schema(SchemaDefinition schemaDefinition, IEnumerable? types = var rootOperationTypes = new List(); // ReSharper disable once ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract if (QueryType != null) + { rootOperationTypes.Add(new OperationTypeDefinitionSyntax(OperationType.Query, SyntaxFactory.NamedType(SyntaxFactory.Name(QueryType.Name)))); + } if (MutationType != null) + { rootOperationTypes.Add(new OperationTypeDefinitionSyntax(OperationType.Mutation, SyntaxFactory.NamedType(SyntaxFactory.Name(MutationType.Name)))); + } if (SubscriptionType != null) + { rootOperationTypes.Add(new OperationTypeDefinitionSyntax(OperationType.Subscription, SyntaxFactory.NamedType(SyntaxFactory.Name(SubscriptionType.Name)))); - + } return new SchemaDefinitionSyntax(rootOperationTypes); }); @@ -149,7 +165,10 @@ public Schema(SchemaDefinition schemaDefinition, IEnumerable? types = { var definitions = new List(); var schemaDef = _syntax.Value; - if (!schemaDef.IsSchemaOfCommonNames()) definitions.Add(schemaDef); + if (!schemaDef.IsSchemaOfCommonNames()) + { + definitions.Add(schemaDef); + } definitions.AddRange(Directives.ToSyntaxNodes()); definitions.AddRange(Types.Values.ToSyntaxNodes()); @@ -316,27 +335,27 @@ public static Schema Create(Action> schemaConf switch (typeSyntax) { case ListTypeSyntax listNode: - { - var innerType = GetTypeFromAst(listNode.OfType); - switch (innerType) { - case null: - return null; - default: - return ListType.Of(innerType); + var innerType = GetTypeFromAst(listNode.OfType); + switch (innerType) + { + case null: + return null; + default: + return ListType.Of(innerType); + } } - } case NonNullTypeSyntax nnNode: - { - var innerType = GetTypeFromAst(nnNode.OfType); - switch (innerType) { - case null: - return null; - case INullableType nullable: - return NonNullType.Of(nullable); + var innerType = GetTypeFromAst(nnNode.OfType); + switch (innerType) + { + case null: + return null; + case INullableType nullable: + return NonNullType.Of(nullable); + } } - } break; case NamedTypeSyntax namedTypeNode: return Types.TryGetValue(namedTypeNode.Name.Value, out var result) ? result : null; @@ -411,11 +430,13 @@ public bool TryGetType(string name, [NotNullWhen(true)] out T? type) where T { Check.NotNull(name, nameof(name)); if (TryGetType(name, out var t)) + { if (t is T requestedType) { type = requestedType; return true; } + } type = default; return false; @@ -431,11 +452,13 @@ public bool TryGetType(Type clrType, [NotNullWhen(true)] out T? type) where T { Check.NotNull(clrType, nameof(clrType)); if (TryGetType(clrType, out var t)) + { if (t is T requestedType) { type = requestedType; return true; } + } type = default; return false; @@ -457,7 +480,10 @@ public T GetType(Type clrType) where T : INamedType Check.NotNull(clrType, nameof(clrType)); if (TryGetType(clrType, out var type)) { - if (type is T requestedType) return requestedType; + if (type is T requestedType) + { + return requestedType; + } throw new InvalidOperationException( $"Type with CLR type \"{clrType}\" already exists, but its type \"{type.GetType().Name}\" is different than the requested type of \"{typeof(T).Name}\"."); @@ -472,7 +498,10 @@ public T GetType(string name) where T : INamedType Check.NotNull(name, nameof(name)); if (TryGetType(name, out var type)) { - if (type is T requestedType) return requestedType; + if (type is T requestedType) + { + return requestedType; + } throw new InvalidOperationException( $"Type named \"{name}\" already exists, but its type \"{type.GetType().Name}\" is different than the requested type of \"{typeof(T).Name}\"."); @@ -485,7 +514,10 @@ public T GetType(string name) where T : INamedType [GraphQLIgnore] public IEnumerable GetPossibleTypes(IAbstractType abstractType) { - if (abstractType is UnionType unionType) return unionType.MemberTypes; + if (abstractType is UnionType unionType) + { + return unionType.MemberTypes; + } return abstractType is InterfaceType interfaceType ? _implementations[interfaceType.Name] ?? throw new InvalidOperationException() @@ -519,17 +551,21 @@ private void AssertObjectImplementsInterfaces(ObjectType objectType, InterfaceTy var fieldName = ifaceField.Name; var objectField = objectType.FindField(ifaceField.Name); if (objectField == null) + { throw new GraphQLException( $"\"{interfaceType.Name}\" expects field \"{ifaceField.Name}\" but \"{objectType.Name}\" " + "does not provide it."); + } // Assert interface field type is satisfied by object field type, by being // a valid subtype. (covariant) if (!objectField.FieldType.IsSubtypeOf(ifaceField.FieldType, this)) + { throw new GraphQLException( $"{ifaceField} expects type \"{ifaceField.FieldType}\" " + "but" + $"{objectField} provides type \"{objectField.FieldType}\"."); + } // Assert each interface field arg is implemented. foreach (var ifaceArg in ifaceField.GetArguments()) @@ -538,17 +574,21 @@ private void AssertObjectImplementsInterfaces(ObjectType objectType, InterfaceTy var objectArg = objectField.FindArgument(argName); // Assert interface field arg exists on object field. if (objectArg == null) + { throw new GraphQLException( $"{ifaceField} expects argument \"{argName}\" " + "but" + $"{objectField} does not provide it."); + } // Assert interface field arg type matches object field arg type. if (!ifaceArg.InputType.Equals(objectArg.InputType)) + { throw new GraphQLException( $"{ifaceField}(${argName}) expects type \"{ifaceArg.InputType}\" " + "but" + $"{objectField}(${argName}) provides type \"{objectArg.InputType}\"."); + } } foreach (var objectArg in objectField.GetArguments()) @@ -556,14 +596,18 @@ private void AssertObjectImplementsInterfaces(ObjectType objectType, InterfaceTy var argName = objectArg.Name; var ifaceArg = ifaceField.FindArgument(argName); if (ifaceArg == null) + { if (!(objectArg.InputType is NonNullType)) + { throw new GraphQLException( $"{objectField}({argName}) is of required type " + $"\"{objectArg.InputType}\" but is not also provided by the " + $"interface {interfaceType.Name}.{fieldName}."); + } + } } } } public override string ToString() => "Schema"; -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/SchemaBuilder.cs b/src/GraphZen.TypeSystem/TypeSystem/SchemaBuilder.cs index 8e504a1c4..8f79083b3 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/SchemaBuilder.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/SchemaBuilder.cs @@ -338,4 +338,4 @@ public SchemaBuilder(SchemaDefinition schemaDefinition) : base(schemaDefinition) public new ISchemaBuilder IgnoreDirectiveAnnotation(string name) => (ISchemaBuilder)base.IgnoreDirectiveAnnotation(name); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/SchemaBuilderExtensions.cs b/src/GraphZen.TypeSystem/TypeSystem/SchemaBuilderExtensions.cs index fa347d133..03fa83ec6 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/SchemaBuilderExtensions.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/SchemaBuilderExtensions.cs @@ -29,4 +29,4 @@ public static SchemaBuilder Build(this SchemaBuilder schemaBuilder, string schem internal static SchemaDefinition GetDefinition(this SchemaBuilder schemaBuilder) => Check.NotNull(schemaBuilder, nameof(schemaBuilder)).GetInfrastructure(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/SchemaDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/SchemaDefinition.cs index 78840a6fa..2fe4be00a 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/SchemaDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/SchemaDefinition.cs @@ -39,7 +39,10 @@ public SchemaDefinition(IReadOnlyList scalars) : base(ConfigurationS var id = scalarType.ClrType != null ? new TypeIdentity(scalarType.ClrType, this) : new TypeIdentity(scalarType.Name, this); - if (id.Name != scalarType.Name) id.Name = scalarType.Name; + if (id.Name != scalarType.Name) + { + id.Name = scalarType.Name; + } // TODO: add logic to handle adding duplicate scalars AddTypeIdentity(id); @@ -117,11 +120,16 @@ public bool SetSubscriptionType(ObjectTypeDefinition? type, ConfigurationSource public bool RenameDirective(DirectiveDefinition directive, string name, ConfigurationSource configurationSource) { - if (!configurationSource.Overrides(directive.GetNameConfigurationSource())) return false; + if (!configurationSource.Overrides(directive.GetNameConfigurationSource())) + { + return false; + } if (_directives.TryGetValue(directive.Name, out var existing) && existing != directive) + { throw new InvalidOperationException( $"Cannot rename {directive} to '{name}'. {this} already contains a directive named '{name}'."); + } _directives.Remove(directive.Name); _directives[name] = directive; @@ -178,7 +186,9 @@ private bool TryDefineFirstUndefinedType(TypeIdentity? prev, out TypeIdentity id identity = undefined.FirstOrDefault()!; // ReSharper disable once PossibleUnintendedReferenceComparison if ((prev != null) & (prev == identity)) + { throw new InvalidOperationException("This type was already defined."); + } // identity can be null at runtime (FirstOrDefault on empty sequence) // ReSharper disable once ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract @@ -186,7 +196,9 @@ private bool TryDefineFirstUndefinedType(TypeIdentity? prev, out TypeIdentity id { if (Builder.Type(identity)?.Definition is INamedTypeDefinition def && identity.Definition == null) + { identity.Definition = def; + } return identity.Definition != null; } @@ -267,20 +279,28 @@ private void FinalizeTypes() var clrTypeAndName = // ReSharper disable once PossibleNullReferenceException validIdentities.SingleOrDefault(_ => _.ClrType == identity.ClrType && _.Name == identity.Name); - if (clrTypeAndName != null) return clrTypeAndName; + if (clrTypeAndName != null) + { + return clrTypeAndName; + } // ReSharper disable once PossibleNullReferenceException var nameOnly = validIdentities.SingleOrDefault(_ => _.Name == identity.Name); if (nameOnly != null) + { if (identity.ClrType != null) { if (nameOnly.ClrType == null) + { nameOnly.ClrType = identity.ClrType; + } else if (nameOnly.ClrType != identity.ClrType) + { throw new InvalidOperationException( $"Found mismatched type identity {nameOnly} for identity {identity}"); + } } - + } return nameOnly; } @@ -290,7 +310,10 @@ private void FinalizeTypes() { Check.NotNull(identity, nameof(identity)); var ids = _typeIdentities.Where(_ => _.Overlaps(identity)).ToList(); - if (ids.Count > 1) throw new InvalidOperationException(); + if (ids.Count > 1) + { + throw new InvalidOperationException(); + } return ids.SingleOrDefault(); } @@ -362,8 +385,10 @@ IMemberDefinition referencingMember { if (clrType.TryGetGraphQLTypeInfo(out var typeNode, out var innerClrType)) { - if (clrType != innerClrType) return null; - + if (clrType != innerClrType) + { + return null; + } var identity = GetOrAddTypeIdentity(new TypeIdentity(innerClrType, this, kind)); return new TypeReference(identity, typeNode); @@ -426,7 +451,10 @@ private TypeIdentity GetOrAddTypeIdentity(TypeIdentity identity) private TypeIdentity AddTypeIdentity(TypeIdentity identity) { var existing = FindTypeIdentity(identity); - if (existing != null) throw new InvalidOperationException(); + if (existing != null) + { + throw new InvalidOperationException(); + } _typeIdentities.Add(identity); return identity; @@ -596,14 +624,18 @@ private T AddType(T type) where T : NamedTypeDefinition { var existingBasedOnType = _types.SingleOrDefault(_ => _.ClrType == type.ClrType); if (existingBasedOnType != null) + { throw new InvalidOperationException( $"Cannot add type \"{type.Name}\" with CLR type \"{type.ClrType}\", a type named \"{existingBasedOnType.Name}\" already exists with that CLR type."); + } } var existingBasedOnName = _types.SingleOrDefault(_ => _.Name == type.Name); if (existingBasedOnName != null) + { throw new InvalidOperationException( $"Cannot add type \"{type.Name}\", a {existingBasedOnName.GetType().Name} type with that name already exists."); + } _types.Add(type); return type; @@ -627,13 +659,18 @@ public void UnignoreDirective(string name, ConfigurationSource configurationSour { var existingIgnoredConfigurationSource = FindIgnoredDirectiveConfigurationSource(name); if (existingIgnoredConfigurationSource != null && - configurationSource.Overrides(existingIgnoredConfigurationSource)) _ignoredDirectives.Remove(name); + configurationSource.Overrides(existingIgnoredConfigurationSource)) + { + _ignoredDirectives.Remove(name); + } } public void IgnoreType(string name, ConfigurationSource configurationSource) { if (_ignoredTypes.TryGetValue(name, out var existingIgnoredConfigurationSource)) + { configurationSource = configurationSource.Max(existingIgnoredConfigurationSource); + } _ignoredTypes[name] = configurationSource; } @@ -725,7 +762,10 @@ public T FindType(TypeIdentity identity) where T : NamedTypeDefinition if (type != null) { - if (type is T requested) return requested; + if (type is T requested) + { + return requested; + } throw new Exception( $"Expected type \"{type.Name}\" to be of type \"{typeof(T).Name}\", but instead found a type of \"{type.GetType().Name}\" "); @@ -824,4 +864,4 @@ private DirectiveDefinition AddDirective(DirectiveDefinition directive) _directives[directive.Name] = directive; return directive; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/SchemaDefinitionExtensions.cs b/src/GraphZen.TypeSystem/TypeSystem/SchemaDefinitionExtensions.cs index a2fced97e..abeb5328e 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/SchemaDefinitionExtensions.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/SchemaDefinitionExtensions.cs @@ -291,4 +291,4 @@ public static bool HasObject(this SchemaDefinition schema) => Check.No public static bool HasObject(this SchemaDefinition schema, string name) => Check.NotNull(schema, nameof(schema)) .HasType(Check.NotNull(name, nameof(name))); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/SchemaExtensions.cs b/src/GraphZen.TypeSystem/TypeSystem/SchemaExtensions.cs index 8b641755f..19154969d 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/SchemaExtensions.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/SchemaExtensions.cs @@ -254,4 +254,4 @@ public static bool HasObject(this Schema schema) => public static bool HasObject(this Schema schema, string name) => Check.NotNull(schema, nameof(schema)) .HasType(Check.NotNull(name, nameof(name))); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/SchemaPrinter.cs b/src/GraphZen.TypeSystem/TypeSystem/SchemaPrinter.cs index c153bb77a..9f46962b0 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/SchemaPrinter.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/SchemaPrinter.cs @@ -10,4 +10,4 @@ public static string Print(this Schema schema) => .ToDocumentSyntax() .WithoutBuiltInDefinitions() .ToSyntaxString(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/SpecDirectives.cs b/src/GraphZen.TypeSystem/TypeSystem/SpecDirectives.cs index 155dca1a1..d81d45f37 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/SpecDirectives.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/SpecDirectives.cs @@ -52,4 +52,4 @@ public static class SpecDirectives Include, Skip }.AsReadOnly(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/SpecScalars.cs b/src/GraphZen.TypeSystem/TypeSystem/SpecScalars.cs index 32c559193..7eafe2cc1 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/SpecScalars.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/SpecScalars.cs @@ -18,18 +18,29 @@ public static class SpecScalars .Description(SpecScalarSyntaxNodes.ID.Description!.Value) .Serializer(value => { - if (value is string str) return Maybe.Some(str); + if (value is string str) + { + return Maybe.Some(str); + } - if (value is int intVal) return Maybe.Some(intVal.ToString()); + if (value is int intVal) + { + return Maybe.Some(intVal.ToString()); + } throw new Exception($"ID cannot represent value: {value.Inspect()}"); }) .ValueParser(value => { - if (value is string str) return Maybe.Some(str); + if (value is string str) + { + return Maybe.Some(str); + } if (InternalNumerics.TryGetWholeDouble(value, out var wholeVal)) + { return Maybe.Some(wholeVal.ToString(CultureInfo.InvariantCulture)); + } throw new Exception($"ID cannot represent value: {value.Inspect()}"); }) @@ -53,7 +64,10 @@ public static class SpecScalars .Description(SpecScalarSyntaxNodes.String.Description!.Value) .ValueParser(value => { - if (value is string str) return Maybe.Some(str); + if (value is string str) + { + return Maybe.Some(str); + } throw new Exception($"String cannot represent a non string value: {value.Inspect()}"); }) @@ -61,11 +75,20 @@ public static class SpecScalars node is StringValueSyntax svn ? Maybe.Some(svn.Value) : Maybe.None()) .Serializer(value => { - if (value is string str) return Maybe.Some(str); + if (value is string str) + { + return Maybe.Some(str); + } - if (value is bool boolean) return Maybe.Some(boolean ? "true" : "false"); + if (value is bool boolean) + { + return Maybe.Some(boolean ? "true" : "false"); + } - if (InternalNumerics.IsNumber(value)) return Maybe.Some(value.ToString()!); + if (InternalNumerics.IsNumber(value)) + { + return Maybe.Some(value.ToString()!); + } throw new Exception($"String cannot represent a non string value: {value}"); }) @@ -82,7 +105,9 @@ public static class SpecScalars if (InternalNumerics.TryGetWholeDouble(value, out var wholeNumber)) { if (InternalNumerics.TryConvertToInt32(wholeNumber, out var intValue)) + { return Maybe.Some(intValue); + } throw new Exception($"Int cannot represent non 32-bit signed integer value: {value}"); } @@ -93,15 +118,22 @@ public static class SpecScalars .Serializer(value => { - if (value is bool boolean) return Maybe.Some(boolean ? 1 : 0); - + if (value is bool boolean) + { + return Maybe.Some(boolean ? 1 : 0); + } - if (value is string str && str != "") return Maybe.Some(Convert.ToInt32(value)); + if (value is string str && str != "") + { + return Maybe.Some(Convert.ToInt32(value)); + } if (InternalNumerics.TryGetWholeDouble(value, out var wholeNumber)) { if (InternalNumerics.TryConvertToInt32(wholeNumber, out var intValue)) + { return Maybe.Some(intValue); + } throw new Exception($"Int cannot represent non 32-bit signed integer value: {value}"); } @@ -171,4 +203,4 @@ public static class SpecScalars Float, Boolean }.ToImmutableList(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/SyntaxConverter.cs b/src/GraphZen.TypeSystem/TypeSystem/SyntaxConverter.cs index 6bfd83e7f..929e15c48 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/SyntaxConverter.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/SyntaxConverter.cs @@ -11,4 +11,4 @@ public abstract class SyntaxConverter : ISyntaxConverter public virtual object? FromSyntax(SyntaxNode node) => throw new NotImplementedException(); public virtual SyntaxNode? ToSyntax(object value) => throw new NotImplementedException(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/SyntaxHelpers.cs b/src/GraphZen.TypeSystem/TypeSystem/SyntaxHelpers.cs index 9c696f008..f1a4c4767 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/SyntaxHelpers.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/SyntaxHelpers.cs @@ -36,4 +36,4 @@ public static IReadOnlyList ToDirectiveNodes( var annotationConverter = new DefaultIDirectiveAnnotationSyntaxConverter(); return directives.Select(_ => (DirectiveSyntax)annotationConverter.ToSyntax(_)!).ToList().AsReadOnly(); } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IAbstractType.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IAbstractType.cs index de89ffd39..1c28f3d8e 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IAbstractType.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IAbstractType.cs @@ -6,4 +6,4 @@ namespace GraphZen.TypeSystem.Taxonomy; [GraphQLIgnore] public interface IAbstractType : IAbstractTypeDefinition, INamedType { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IAbstractTypeDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IAbstractTypeDefinition.cs index 2aed2922c..9814f2663 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IAbstractTypeDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IAbstractTypeDefinition.cs @@ -7,4 +7,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface IAbstractTypeDefinition : INamedTypeDefinition { TypeResolver? ResolveType { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IAnnotatableDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IAnnotatableDefinition.cs index 9a727aeea..5c8f30b2a 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IAnnotatableDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IAnnotatableDefinition.cs @@ -6,4 +6,4 @@ namespace GraphZen.TypeSystem.Taxonomy; [GraphQLIgnore] public interface IAnnotatableDefinition : IDirectiveAnnotationsDefinition, IMemberDefinition { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IArgument.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IArgument.cs index fdd645696..dd32de382 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IArgument.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IArgument.cs @@ -7,4 +7,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface IArgument : IArgumentDefinition, IInputValue { new IArguments DeclaringMember { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IArgumentDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IArgumentDefinition.cs index 17ebb506e..10d224448 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IArgumentDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IArgumentDefinition.cs @@ -11,4 +11,4 @@ public interface IArgumentDefinition : IInputValueDefinition new IArgumentsDefinition DeclaringMember { get; } new ParameterInfo? ClrInfo { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IArguments.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IArguments.cs index dcd6b4303..15eb1ce7c 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IArguments.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IArguments.cs @@ -10,4 +10,4 @@ public interface IArguments : IArgumentsDefinition new IEnumerable GetArguments(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IArgumentsDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IArgumentsDefinition.cs index 4c0289714..c492d2908 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IArgumentsDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IArgumentsDefinition.cs @@ -7,4 +7,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface IArgumentsDefinition : IMemberDefinition { IEnumerable GetArguments(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IClrInfo.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IClrInfo.cs index d980785b1..bf10bac03 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IClrInfo.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IClrInfo.cs @@ -7,4 +7,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface IClrInfo { object? ClrInfo { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IClrType.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IClrType.cs index a495ad7eb..7ace867bf 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IClrType.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IClrType.cs @@ -7,4 +7,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface IClrType { Type? ClrType { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ICompositeType.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ICompositeType.cs index 3536db899..9f61c3d49 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ICompositeType.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ICompositeType.cs @@ -6,4 +6,4 @@ namespace GraphZen.TypeSystem.Taxonomy; [GraphQLIgnore] public interface ICompositeType : ICompositeTypeDefinition, INamedType { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ICompositeTypeDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ICompositeTypeDefinition.cs index 0dcec9179..0a1b13cf2 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ICompositeTypeDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ICompositeTypeDefinition.cs @@ -6,4 +6,4 @@ namespace GraphZen.TypeSystem.Taxonomy; [GraphQLIgnore] public interface ICompositeTypeDefinition : INamedTypeDefinition { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDeprecation.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDeprecation.cs index db0d59f90..4875e8dda 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDeprecation.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDeprecation.cs @@ -10,4 +10,4 @@ public interface IDeprecation string? DeprecationReason { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDescription.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDescription.cs index b3d2eb38c..02fe6ea90 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDescription.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDescription.cs @@ -7,4 +7,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface IDescription { string? Description { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDirective.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDirective.cs index d8193e2db..84981776b 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDirective.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDirective.cs @@ -6,4 +6,4 @@ namespace GraphZen.TypeSystem.Taxonomy; [GraphQLIgnore] public interface IDirective : IDirectiveDefinition, IArguments, ISyntaxConvertable, IDirectiveLocations { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDirectiveAnnotation.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDirectiveAnnotation.cs index 5a834a6d7..02af5f139 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDirectiveAnnotation.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDirectiveAnnotation.cs @@ -9,4 +9,4 @@ public interface IDirectiveAnnotation string Name { get; } object? Value { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDirectiveAnnotations.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDirectiveAnnotations.cs index c098b8dd1..48f5dabc1 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDirectiveAnnotations.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDirectiveAnnotations.cs @@ -19,4 +19,4 @@ public interface IMutableDirectiveAnnotationsDefinition : IDirectiveAnnotationsD public interface IDirectiveAnnotations : IDirectiveAnnotationsDefinition { IDirectiveAnnotation? FindDirectiveAnnotation(string name); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDirectiveDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDirectiveDefinition.cs index b4cf6afd0..af13f5292 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDirectiveDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDirectiveDefinition.cs @@ -11,4 +11,4 @@ public interface IDirectiveDefinition : IArgumentsDefinition, IDirectiveLocationsDefinition { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDirectiveLocations.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDirectiveLocations.cs index 28342e73a..76e2dcc22 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDirectiveLocations.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDirectiveLocations.cs @@ -6,4 +6,4 @@ namespace GraphZen.TypeSystem.Taxonomy; [GraphQLIgnore] public interface IDirectiveLocations : IDirectiveLocationsDefinition { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDirectiveLocationsDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDirectiveLocationsDefinition.cs index 2f5f531d0..9c202ba44 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDirectiveLocationsDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDirectiveLocationsDefinition.cs @@ -7,4 +7,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface IDirectiveLocationsDefinition { IReadOnlyCollection Locations { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDirectives.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDirectives.cs index de7586136..f57335d0d 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDirectives.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDirectives.cs @@ -10,4 +10,4 @@ public interface IDirectives : IDirectivesDefinition [GraphQLIgnore] new IEnumerable GetDirectives(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDirectivesDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDirectivesDefinition.cs index 7e7780464..0658a1eb1 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDirectivesDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IDirectivesDefinition.cs @@ -8,4 +8,4 @@ public interface IDirectivesDefinition { [GraphQLIgnore] IEnumerable GetDirectives(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IEnumType.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IEnumType.cs index ba05ac3e5..cd9506201 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IEnumType.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IEnumType.cs @@ -7,4 +7,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface IEnumType : IEnumTypeDefinition, ILeafType, IEnumValues { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IEnumTypeDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IEnumTypeDefinition.cs index b5b62eee5..b62601177 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IEnumTypeDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IEnumTypeDefinition.cs @@ -10,4 +10,4 @@ public interface IEnumTypeDefinition : IInputDefinition, IOutputDefinition { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IEnumTypes.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IEnumTypes.cs index 123a5e57c..e9258121b 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IEnumTypes.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IEnumTypes.cs @@ -10,4 +10,4 @@ public interface IEnumTypes : IEnumTypesDefinition [GraphQLIgnore] new IEnumerable GetEnums(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IEnumTypesDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IEnumTypesDefinition.cs index 86972f366..c51c4869a 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IEnumTypesDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IEnumTypesDefinition.cs @@ -8,4 +8,4 @@ public interface IEnumTypesDefinition { [GraphQLIgnore] IEnumerable GetEnums(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IEnumValue.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IEnumValue.cs index e1ae34f9f..1a3b5fc65 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IEnumValue.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IEnumValue.cs @@ -7,4 +7,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface IEnumValue : IEnumValueDefinition, ISyntaxConvertable { new EnumType DeclaringType { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IEnumValueDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IEnumValueDefinition.cs index 31f1fee03..aa00d9cdb 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IEnumValueDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IEnumValueDefinition.cs @@ -12,4 +12,4 @@ public interface IEnumValueDefinition : IAnnotatableDefinition, INamed, IDescrip [GraphQLIgnore] IEnumTypeDefinition DeclaringType { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IEnumValues.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IEnumValues.cs index 0d3940a0a..c450b83cb 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IEnumValues.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IEnumValues.cs @@ -13,4 +13,4 @@ public interface IEnumValues : IEnumValuesDefinition new IEnumerable GetValues(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IEnumValuesDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IEnumValuesDefinition.cs index 4281f4f75..78b4e8e97 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IEnumValuesDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IEnumValuesDefinition.cs @@ -7,4 +7,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface IEnumValuesDefinition { IEnumerable GetValues(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IField.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IField.cs index 8f4a51cf8..7a022f125 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IField.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IField.cs @@ -10,4 +10,4 @@ public interface IField : IFieldDefinition, IArguments, ISyntaxConvertable new IFields DeclaringType { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IFieldDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IFieldDefinition.cs index 5917b436f..4f07daa3f 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IFieldDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IFieldDefinition.cs @@ -19,4 +19,4 @@ public interface IFieldDefinition : IAnnotatableDefinition, IArgumentsDefinition IFieldsDefinition? DeclaringType { get; } new MemberInfo? ClrInfo { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IFields.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IFields.cs index 1806b6bd5..2aba12abb 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IFields.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IFields.cs @@ -11,4 +11,4 @@ public interface IFields : IFieldsDefinition, INamedType [GraphQLCanBeNull] new IEnumerable GetFields(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IFieldsDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IFieldsDefinition.cs index 3a614d26e..16baf2c7c 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IFieldsDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IFieldsDefinition.cs @@ -7,4 +7,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface IFieldsDefinition { IEnumerable GetFields(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IGraphQLType.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IGraphQLType.cs index 1cf4e0a4c..19995ca5b 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IGraphQLType.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IGraphQLType.cs @@ -7,4 +7,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface IGraphQLType : IGraphQLTypeReference, ISyntaxConvertable { TypeKind Kind { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IGraphQLTypeReference.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IGraphQLTypeReference.cs index 771486e5b..f56c0cfcf 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IGraphQLTypeReference.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IGraphQLTypeReference.cs @@ -6,4 +6,4 @@ namespace GraphZen.TypeSystem.Taxonomy; [GraphQLIgnore] public interface IGraphQLTypeReference { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputDefinition.cs index 54e85acdf..30bd6e97d 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputDefinition.cs @@ -6,4 +6,4 @@ namespace GraphZen.TypeSystem.Taxonomy; [GraphQLIgnore] public interface IInputDefinition { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputField.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputField.cs index 0301ac40c..a2dd0db98 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputField.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputField.cs @@ -7,4 +7,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface IInputField : IInputFieldDefinition, IInputValue { new InputObjectType DeclaringMember { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputFieldDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputFieldDefinition.cs index a573fb51d..3b72b1cba 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputFieldDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputFieldDefinition.cs @@ -11,4 +11,4 @@ public interface IInputFieldDefinition : IInputValueDefinition new PropertyInfo? ClrInfo { get; } new IInputObjectTypeDefinition DeclaringMember { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputFields.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputFields.cs index 5b43f38b8..3f451e2be 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputFields.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputFields.cs @@ -9,4 +9,4 @@ public interface IInputFields : IInputFieldsDefinition new IEnumerable GetFields(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputFieldsDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputFieldsDefinition.cs index 318dab98d..52f6ea956 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputFieldsDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputFieldsDefinition.cs @@ -6,4 +6,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface IInputFieldsDefinition { IEnumerable GetFields(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputObjectType.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputObjectType.cs index 568b72ed6..78b1bc057 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputObjectType.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputObjectType.cs @@ -6,4 +6,4 @@ namespace GraphZen.TypeSystem.Taxonomy; [GraphQLIgnore] public interface IInputObjectType : IInputObjectTypeDefinition, INamedType, IInputFields { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputObjectTypeDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputObjectTypeDefinition.cs index 02cf6f217..bd9f8c56d 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputObjectTypeDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputObjectTypeDefinition.cs @@ -7,4 +7,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface IInputObjectTypeDefinition : IInputFieldsDefinition, INamedTypeDefinition, IInputDefinition { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputObjectTypes.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputObjectTypes.cs index 4ff4b51d8..6fc8cac8c 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputObjectTypes.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputObjectTypes.cs @@ -10,4 +10,4 @@ public interface IInputObjectTypes : IInputObjectTypesDefinition [GraphQLIgnore] new IEnumerable GetInputObjects(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputObjectTypesDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputObjectTypesDefinition.cs index 9a26ac6a1..b6218bac9 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputObjectTypesDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputObjectTypesDefinition.cs @@ -8,4 +8,4 @@ public interface IInputObjectTypesDefinition { [GraphQLIgnore] IEnumerable GetInputObjects(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputValue.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputValue.cs index 12100da57..da0b11083 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputValue.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputValue.cs @@ -7,4 +7,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface IInputValue : IInputValueDefinition, ISyntaxConvertable { new IGraphQLType InputType { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputValueDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputValueDefinition.cs index 12d38436d..8827d2fe5 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputValueDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInputValueDefinition.cs @@ -15,4 +15,4 @@ public interface IInputValueDefinition : IAnnotatableDefinition, INamed, IDescri object? DefaultValue { get; } bool HasDefaultValue { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInterfaceType.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInterfaceType.cs index cdd9130a8..4ded5ec14 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInterfaceType.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInterfaceType.cs @@ -9,4 +9,4 @@ public interface IInterfaceType : IInterfaceTypeDefinition, IAbstractType, IFields { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInterfaceTypeDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInterfaceTypeDefinition.cs index 6b636d7b6..77855063e 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInterfaceTypeDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInterfaceTypeDefinition.cs @@ -9,4 +9,4 @@ public interface IInterfaceTypeDefinition : ICompositeTypeDefinition, IAbstractTypeDefinition, IOutputDefinition { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInterfaceTypes.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInterfaceTypes.cs index c85066961..da6e7e5aa 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInterfaceTypes.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInterfaceTypes.cs @@ -10,4 +10,4 @@ public interface IInterfaceTypes : IInterfaceTypesDefinition [GraphQLIgnore] new IEnumerable GetInterfaces(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInterfaceTypesDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInterfaceTypesDefinition.cs index b8a4f5a54..70d7ea120 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInterfaceTypesDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInterfaceTypesDefinition.cs @@ -8,4 +8,4 @@ public interface IInterfaceTypesDefinition { [GraphQLIgnore] IEnumerable GetInterfaces(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInterfaces.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInterfaces.cs index 69faf357c..8664f2e98 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInterfaces.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInterfaces.cs @@ -13,4 +13,4 @@ public interface IInterfaces : IInterfacesDefinition new IEnumerable GetInterfaces(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInterfacesDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInterfacesDefinition.cs index 13fd0084e..41fc6273b 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInterfacesDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IInterfacesDefinition.cs @@ -6,4 +6,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface IInterfacesDefinition { IEnumerable GetInterfaces(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ILeafType.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ILeafType.cs index 2897f9225..ca41d5282 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ILeafType.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ILeafType.cs @@ -14,4 +14,4 @@ public interface ILeafType : INamedType Maybe ParseValue(object value); Maybe ParseLiteral(ValueSyntax value); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ILeafTypeDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ILeafTypeDefinition.cs index 6fa688414..618d6bd9e 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ILeafTypeDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ILeafTypeDefinition.cs @@ -6,4 +6,4 @@ namespace GraphZen.TypeSystem.Taxonomy; [GraphQLIgnore] public interface ILeafTypeDefinition : INamedTypeDefinition { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IListType.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IListType.cs index 86d1312f8..0a77f716d 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IListType.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IListType.cs @@ -6,4 +6,4 @@ namespace GraphZen.TypeSystem.Taxonomy; [GraphQLIgnore] public interface IListType : IWrappingType, INullableType { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ILiteralParser.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ILiteralParser.cs index ad850bc03..f8e38e835 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ILiteralParser.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ILiteralParser.cs @@ -5,4 +5,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface ILiteralParser : ILiteralParserDefinition { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ILiteralParserDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ILiteralParserDefinition.cs index 52247a9df..4dfe1bb79 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ILiteralParserDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ILiteralParserDefinition.cs @@ -6,4 +6,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface ILiteralParserDefinition { LeafLiteralParser? LiteralParser { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMember.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMember.cs index 438b69ad8..d5fade9c5 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMember.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMember.cs @@ -5,4 +5,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface IMember : IMemberDefinition { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMemberDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMemberDefinition.cs index cd33a1d13..661711734 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMemberDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMemberDefinition.cs @@ -6,4 +6,4 @@ namespace GraphZen.TypeSystem.Taxonomy; [GraphQLIgnore] public interface IMemberDefinition { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMemberTypes.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMemberTypes.cs index e1020751f..4a5cee189 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMemberTypes.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMemberTypes.cs @@ -11,4 +11,4 @@ public interface IMemberTypes : IMemberTypesDefinition IReadOnlyDictionary MemberTypesMap { get; } new IEnumerable GetMemberTypes(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMemberTypesDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMemberTypesDefinition.cs index 7b6e4980e..8e013ad43 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMemberTypesDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMemberTypesDefinition.cs @@ -7,4 +7,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface IMemberTypesDefinition { IEnumerable GetMemberTypes(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableAbstractTypeDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableAbstractTypeDefinition.cs index 610c6bf94..1f3652e1c 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableAbstractTypeDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableAbstractTypeDefinition.cs @@ -7,4 +7,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface IMutableAbstractTypeDefinition : IAbstractTypeDefinition { new TypeResolver? ResolveType { get; set; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableAnnotatableDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableAnnotatableDefinition.cs index ed845a6fe..d9e779aa2 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableAnnotatableDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableAnnotatableDefinition.cs @@ -9,4 +9,4 @@ public interface IMutableAnnotatableDefinition : IMutableDefinition, IMutableDirectiveAnnotationsDefinition { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableArgumentDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableArgumentDefinition.cs index 5260c54c9..7241e758d 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableArgumentDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableArgumentDefinition.cs @@ -7,4 +7,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface IMutableArgumentDefinition : IArgumentDefinition, IMutableInputValueDefinition { new IMutableArgumentsDefinition DeclaringMember { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableArgumentsDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableArgumentsDefinition.cs index a3d535495..df492cf35 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableArgumentsDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableArgumentsDefinition.cs @@ -13,4 +13,4 @@ bool RenameArgument(ArgumentDefinition argument, string name, new IEnumerable GetArguments(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableClrType.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableClrType.cs index 21cb91cc4..439de5dc3 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableClrType.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableClrType.cs @@ -7,4 +7,4 @@ public interface IMutableClrType : IClrType { bool SetClrType(Type clrType, ConfigurationSource configurationSource); ConfigurationSource? GetClrTypeConfigurationSource(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableDefinition.cs index c66877da7..1be9da3bf 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableDefinition.cs @@ -7,4 +7,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface IMutableDefinition : IMemberDefinition { ConfigurationSource GetConfigurationSource(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableDeprecation.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableDeprecation.cs index 29f040174..1ad9aef61 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableDeprecation.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableDeprecation.cs @@ -8,4 +8,4 @@ public interface IMutableDeprecation : IDeprecation { bool MarkAsDeprecated(string reason, ConfigurationSource configurationSource); bool RemoveDeprecation(ConfigurationSource configurationSource); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableDescription.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableDescription.cs index 84e414958..dce78ae7e 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableDescription.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableDescription.cs @@ -8,4 +8,4 @@ public interface IMutableDescription : IDescription { bool SetDescription(string description, ConfigurationSource configurationSource); ConfigurationSource GetDescriptionConfigurationSource(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableDirectiveDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableDirectiveDefinition.cs index ba8786d05..8cc4bbbae 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableDirectiveDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableDirectiveDefinition.cs @@ -12,4 +12,4 @@ public interface IMutableDirectiveDefinition : IMutableDescription, IMutableClrType { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableDirectiveLocationsDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableDirectiveLocationsDefinition.cs index d1f3ab73c..0831edfee 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableDirectiveLocationsDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableDirectiveLocationsDefinition.cs @@ -10,4 +10,4 @@ public interface IMutableDirectiveLocationsDefinition : IDirectiveLocationsDefin bool UnignoreLocation(DirectiveLocation location, ConfigurationSource configurationSource); ConfigurationSource? FindDirectiveLocationConfigurationSource(DirectiveLocation location); ConfigurationSource? FindIgnoredDirectiveLocationConfigurationSource(DirectiveLocation location); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableDirectivesDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableDirectivesDefinition.cs index 4f1f6fecb..07c0a52e5 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableDirectivesDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableDirectivesDefinition.cs @@ -13,4 +13,4 @@ public interface IMutableDirectivesDefinition : IDirectivesDefinition ConfigurationSource? FindIgnoredDirectiveConfigurationSource(string name); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableEnumTypeDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableEnumTypeDefinition.cs index 9296622bc..95990f720 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableEnumTypeDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableEnumTypeDefinition.cs @@ -9,4 +9,4 @@ public interface IMutableEnumTypeDefinition : IMutableNamedTypeDefinition, IMutableEnumValuesDefinition { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableEnumTypesDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableEnumTypesDefinition.cs index e0697e32f..f4096f832 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableEnumTypesDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableEnumTypesDefinition.cs @@ -8,4 +8,4 @@ public interface IMutableEnumTypesDefinition : IEnumTypesDefinition { [GraphQLIgnore] new IEnumerable GetEnums(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableEnumValueDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableEnumValueDefinition.cs index 4197ffb3d..2c2d38205 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableEnumValueDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableEnumValueDefinition.cs @@ -13,4 +13,4 @@ public interface IMutableEnumValueDefinition : IEnumValueDefinition, IMutableAnn new EnumTypeDefinition DeclaringType { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableEnumValuesDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableEnumValuesDefinition.cs index 080ebbba5..908e05fb1 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableEnumValuesDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableEnumValuesDefinition.cs @@ -16,4 +16,4 @@ EnumValueDefinition AddValue(string name, ConfigurationSource configurationSourc ConfigurationSource nameConfigurationSource); new IEnumerable GetValues(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableFieldDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableFieldDefinition.cs index afd5c7322..294c99e9c 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableFieldDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableFieldDefinition.cs @@ -17,4 +17,4 @@ public interface IMutableFieldDefinition : IFieldDefinition, IMutableAnnotatable new IMutableFieldsDefinition DeclaringType { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableFieldsDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableFieldsDefinition.cs index 5d3e3bcb5..15719b2e2 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableFieldsDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableFieldsDefinition.cs @@ -8,4 +8,4 @@ public interface IMutableFieldsDefinition : IFieldsDefinition IReadOnlyDictionary Fields { get; } ConfigurationSource? FindIgnoredFieldConfigurationSource(string fieldName); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableInputFieldDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableInputFieldDefinition.cs index 76bf6ab6d..585e02fcb 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableInputFieldDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableInputFieldDefinition.cs @@ -7,4 +7,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface IMutableInputFieldDefinition : IInputFieldDefinition, IMutableInputValueDefinition { new InputObjectTypeDefinition DeclaringMember { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableInputFieldsDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableInputFieldsDefinition.cs index 87260de2a..5acf7887d 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableInputFieldsDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableInputFieldsDefinition.cs @@ -11,4 +11,4 @@ public interface IMutableInputFieldsDefinition : IInputFieldsDefinition new IEnumerable GetFields(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableInputObjectTypeDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableInputObjectTypeDefinition.cs index f85cc1919..fea84e77b 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableInputObjectTypeDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableInputObjectTypeDefinition.cs @@ -7,4 +7,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface IMutableInputObjectTypeDefinition : IInputObjectTypeDefinition, IMutableNamedTypeDefinition, IMutableInputFieldsDefinition { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableInputObjectTypesDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableInputObjectTypesDefinition.cs index 7494a3978..b5b8724b6 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableInputObjectTypesDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableInputObjectTypesDefinition.cs @@ -8,4 +8,4 @@ public interface IMutableInputObjectTypesDefinition : IInputObjectTypesDefinitio { [GraphQLIgnore] new IEnumerable GetInputObjects(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableInputValueDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableInputValueDefinition.cs index b7b61a335..29564385f 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableInputValueDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableInputValueDefinition.cs @@ -12,4 +12,4 @@ public interface IMutableInputValueDefinition : IInputValueDefinition, IMutableA bool SetDefaultValue(object value, ConfigurationSource configurationSource); bool RemoveDefaultValue(ConfigurationSource configurationSource); ConfigurationSource? GetDefaultValueConfigurationSource(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableInterfaceTypeDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableInterfaceTypeDefinition.cs index 7e4ee904c..f01a36121 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableInterfaceTypeDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableInterfaceTypeDefinition.cs @@ -8,4 +8,4 @@ public interface IMutableInterfaceTypeDefinition : IInterfaceTypeDefinition, IMu IMutableFieldsDefinition, IMutableAbstractTypeDefinition { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableInterfaceTypesDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableInterfaceTypesDefinition.cs index fdbc832bb..cbbb49f91 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableInterfaceTypesDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableInterfaceTypesDefinition.cs @@ -8,4 +8,4 @@ public interface IMutableInterfaceTypesDefinition : IInterfaceTypesDefinition { [GraphQLIgnore] new IEnumerable GetInterfaces(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableInterfacesDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableInterfacesDefinition.cs index 734f32e60..bb6936663 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableInterfacesDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableInterfacesDefinition.cs @@ -8,4 +8,4 @@ public interface IMutableInterfacesDefinition : IInterfacesDefinition new IEnumerable GetInterfaces(); ConfigurationSource? FindIgnoredInterfaceConfigurationSource(string name); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableLiteralParserDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableLiteralParserDefinition.cs index e310b72d6..34192b191 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableLiteralParserDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableLiteralParserDefinition.cs @@ -9,4 +9,4 @@ public interface IMutableLiteralParserDefinition : ILiteralParserDefinition bool SetLiteralParser(LeafLiteralParser? literalParser, ConfigurationSource configurationSource); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableMemberTypesDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableMemberTypesDefinition.cs index c239b626f..8633f3554 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableMemberTypesDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableMemberTypesDefinition.cs @@ -8,4 +8,4 @@ public interface IMutableMemberTypesDefinition : IMemberTypesDefinition { new IEnumerable GetMemberTypes(); ConfigurationSource? FindIgnoredMemberTypeConfigurationSource(string name); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableMutationTypeDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableMutationTypeDefinition.cs index 3a66836a3..4ab20fb25 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableMutationTypeDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableMutationTypeDefinition.cs @@ -8,4 +8,4 @@ public interface IMutableMutationTypeDefinition : IMutationTypeDefinition new ObjectTypeDefinition? MutationType { get; } bool SetMutationType(ObjectTypeDefinition? type, ConfigurationSource configurationSource); ConfigurationSource? GetMutationTypeConfigurationSource(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableNamed.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableNamed.cs index c48c535fc..1f8755e8c 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableNamed.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableNamed.cs @@ -8,4 +8,4 @@ public interface IMutableNamed : INamed, IMutableDefinition { bool SetName(string name, ConfigurationSource configurationSource); ConfigurationSource GetNameConfigurationSource(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableNamedTypeDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableNamedTypeDefinition.cs index d4f21f6b0..5f3283d2a 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableNamedTypeDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableNamedTypeDefinition.cs @@ -11,4 +11,4 @@ public interface IMutableNamedTypeDefinition : IMutableNamed, IMutableDescription { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableObjectTypeDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableObjectTypeDefinition.cs index 39cd943da..ee888f0e3 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableObjectTypeDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableObjectTypeDefinition.cs @@ -8,4 +8,4 @@ public interface IMutableObjectTypeDefinition : IObjectTypeDefinition, IMutableN IMutableFieldsDefinition, IMutableInterfacesDefinition { new IsTypeOf? IsTypeOf { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableObjectTypesDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableObjectTypesDefinition.cs index 43ba518e9..17b329ced 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableObjectTypesDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableObjectTypesDefinition.cs @@ -8,4 +8,4 @@ public interface IMutableObjectTypesDefinition : IObjectTypesDefinition { [GraphQLIgnore] new IEnumerable GetObjects(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableQueryTypeDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableQueryTypeDefinition.cs index e046f1232..b2221d540 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableQueryTypeDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableQueryTypeDefinition.cs @@ -8,4 +8,4 @@ public interface IMutableQueryTypeDefinition : IQueryTypeDefinition new ObjectTypeDefinition? QueryType { get; } bool SetQueryType(ObjectTypeDefinition? type, ConfigurationSource configurationSource); ConfigurationSource? GetQueryTypeConfigurationSource(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableScalarTypeDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableScalarTypeDefinition.cs index cfb01b0f8..a60e66185 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableScalarTypeDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableScalarTypeDefinition.cs @@ -12,4 +12,4 @@ public interface IMutableScalarTypeDefinition : IMutableLiteralParserDefinition { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableScalarTypesDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableScalarTypesDefinition.cs index ae449f8fe..c930aadb8 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableScalarTypesDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableScalarTypesDefinition.cs @@ -8,4 +8,4 @@ public interface IMutableScalarTypesDefinition : IScalarTypesDefinition { [GraphQLIgnore] new IEnumerable GetScalars(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableSchemaDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableSchemaDefinition.cs index 7cbd74734..76dca0203 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableSchemaDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableSchemaDefinition.cs @@ -17,4 +17,4 @@ public interface IMutableSchemaDefinition : IMutableScalarTypesDefinition, IMutableEnumTypesDefinition, IMutableInputObjectTypesDefinition { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableSerializerDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableSerializerDefinition.cs index dd968da8e..56a0b237c 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableSerializerDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableSerializerDefinition.cs @@ -7,4 +7,4 @@ public interface IMutableSerializerDefinition : ISerializerDefinition { ConfigurationSource? GetSerializerConfigurationSource(); bool SetSerializer(LeafSerializer? serializer, ConfigurationSource configurationSource); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableSubscriptionTypeDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableSubscriptionTypeDefinition.cs index 49d902d8d..12940a48b 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableSubscriptionTypeDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableSubscriptionTypeDefinition.cs @@ -8,4 +8,4 @@ public interface IMutableSubscriptionTypeDefinition : ISubscriptionTypeDefinitio new ObjectTypeDefinition? SubscriptionType { get; } bool SetSubscriptionType(ObjectTypeDefinition? type, ConfigurationSource configurationSource); ConfigurationSource? GetSubscriptionTypeConfigurationSource(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableUnionTypeDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableUnionTypeDefinition.cs index 4765917ac..98dc8cc1e 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableUnionTypeDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableUnionTypeDefinition.cs @@ -8,4 +8,4 @@ public interface IMutableUnionTypeDefinition : IUnionTypeDefinition, IMutableNamedTypeDefinition, IMutableAbstractTypeDefinition, IMutableMemberTypesDefinition { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableUnionTypesDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableUnionTypesDefinition.cs index 7ee6a3a08..9bd61a2d8 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableUnionTypesDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableUnionTypesDefinition.cs @@ -8,4 +8,4 @@ public interface IMutableUnionTypesDefinition : IUnionTypesDefinition { [GraphQLIgnore] new IEnumerable GetUnions(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableValueParserDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableValueParserDefinition.cs index f23d78d13..aa0649266 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableValueParserDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutableValueParserDefinition.cs @@ -7,4 +7,4 @@ public interface IMutableValueParserDefinition : IValueParserDefinition { ConfigurationSource? GetValueParserConfigurationSource(); bool SetValueParser(LeafValueParser? valueParser, ConfigurationSource configurationSource); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutationType.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutationType.cs index dc40a4c62..bfe84a80a 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutationType.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutationType.cs @@ -7,4 +7,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface IMutationType : IMutationTypeDefinition { new ObjectType? MutationType { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutationTypeDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutationTypeDefinition.cs index 9e0f7ad8f..56fa0f27e 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutationTypeDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IMutationTypeDefinition.cs @@ -7,4 +7,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface IMutationTypeDefinition { IObjectTypeDefinition? MutationType { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/INamed.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/INamed.cs index 75f16955d..457fe1680 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/INamed.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/INamed.cs @@ -7,4 +7,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface INamed { string Name { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/INamedType.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/INamedType.cs index a2930eddd..07097f3b9 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/INamedType.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/INamedType.cs @@ -8,4 +8,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface INamedType : INamedTypeDefinition, INullableType { new string Name { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/INamedTypeDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/INamedTypeDefinition.cs index 6562d244f..d8c596893 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/INamedTypeDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/INamedTypeDefinition.cs @@ -12,4 +12,4 @@ public interface INamedTypeDefinition : IClrType { TypeKind Kind { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/INamedTypeReference.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/INamedTypeReference.cs index 05a71f6a7..2236b5cef 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/INamedTypeReference.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/INamedTypeReference.cs @@ -8,4 +8,4 @@ public interface INamedTypeReference : IGraphQLTypeReference, INamed { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/INonNullType.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/INonNullType.cs index 97227902c..43e38d4e9 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/INonNullType.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/INonNullType.cs @@ -6,4 +6,4 @@ namespace GraphZen.TypeSystem.Taxonomy; [GraphQLIgnore] public interface INonNullType : IWrappingNullableType { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/INullableType.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/INullableType.cs index 80b6a23d2..20d62f803 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/INullableType.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/INullableType.cs @@ -6,4 +6,4 @@ namespace GraphZen.TypeSystem.Taxonomy; [GraphQLIgnore] public interface INullableType : IGraphQLType { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IObjectType.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IObjectType.cs index 93e806136..0387a761f 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IObjectType.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IObjectType.cs @@ -8,4 +8,4 @@ public interface IObjectType : IObjectTypeDefinition, IInterfaces, ICompositeType, IFields { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IObjectTypeDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IObjectTypeDefinition.cs index 2c3372cc8..be32e18cb 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IObjectTypeDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IObjectTypeDefinition.cs @@ -10,4 +10,4 @@ public interface IObjectTypeDefinition : ICompositeTypeDefinition, IOutputDefinition { IsTypeOf? IsTypeOf { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IObjectTypes.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IObjectTypes.cs index 9ce3dd421..c897fd691 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IObjectTypes.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IObjectTypes.cs @@ -10,4 +10,4 @@ public interface IObjectTypes : IObjectTypesDefinition [GraphQLIgnore] new IEnumerable GetObjects(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IObjectTypesDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IObjectTypesDefinition.cs index 440403181..431881ae3 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IObjectTypesDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IObjectTypesDefinition.cs @@ -8,4 +8,4 @@ public interface IObjectTypesDefinition { [GraphQLIgnore] IEnumerable GetObjects(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IOutputDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IOutputDefinition.cs index 7eb78d395..0a038d398 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IOutputDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IOutputDefinition.cs @@ -6,4 +6,4 @@ namespace GraphZen.TypeSystem.Taxonomy; [GraphQLIgnore] public interface IOutputDefinition { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IQueryType.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IQueryType.cs index 071c020af..e991a8e5c 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IQueryType.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IQueryType.cs @@ -7,4 +7,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface IQueryType : IQueryTypeDefinition { new ObjectType QueryType { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IQueryTypeDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IQueryTypeDefinition.cs index 815186982..b4bc46d05 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IQueryTypeDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IQueryTypeDefinition.cs @@ -7,4 +7,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface IQueryTypeDefinition { IObjectTypeDefinition? QueryType { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IScalarType.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IScalarType.cs index 8626aaa19..5922c2262 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IScalarType.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IScalarType.cs @@ -11,4 +11,4 @@ public interface IScalarType : IValueParser, ILiteralParser { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IScalarTypeDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IScalarTypeDefinition.cs index 20897542d..0756980c4 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IScalarTypeDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IScalarTypeDefinition.cs @@ -12,4 +12,4 @@ public interface IScalarTypeDefinition : IInputDefinition, IOutputDefinition { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IScalarTypes.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IScalarTypes.cs index 581f48cde..9649bf0da 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IScalarTypes.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IScalarTypes.cs @@ -10,4 +10,4 @@ public interface IScalarTypes : IScalarTypesDefinition [GraphQLIgnore] new IEnumerable GetScalars(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IScalarTypesDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IScalarTypesDefinition.cs index 72185a680..4d84c37ba 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IScalarTypesDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IScalarTypesDefinition.cs @@ -8,4 +8,4 @@ public interface IScalarTypesDefinition { [GraphQLIgnore] IEnumerable GetScalars(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ISchema.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ISchema.cs index 7ba7adc19..58b8f3cd4 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ISchema.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ISchema.cs @@ -12,4 +12,4 @@ public interface ISchema : IDirectives, IObjectTypes, IInterfaceTypes, IUnionTypes, IScalarTypes, IEnumTypes, IInputObjectTypes { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ISchemaDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ISchemaDefinition.cs index 3f3fd056e..b130cf4cb 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ISchemaDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ISchemaDefinition.cs @@ -17,4 +17,4 @@ public interface ISchemaDefinition : IEnumTypesDefinition, IInputObjectTypesDefinition { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ISerializer.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ISerializer.cs index b82650079..95addbf9f 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ISerializer.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ISerializer.cs @@ -5,4 +5,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface ISerializer : ISerializerDefinition { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ISerializerDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ISerializerDefinition.cs index cfdf7e7e1..377f4a0f6 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ISerializerDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ISerializerDefinition.cs @@ -6,4 +6,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface ISerializerDefinition { LeafSerializer? Serializer { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ISubscriptionType.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ISubscriptionType.cs index 6945c6172..1a271bf08 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ISubscriptionType.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ISubscriptionType.cs @@ -7,4 +7,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface ISubscriptionType : ISubscriptionTypeDefinition { new ObjectType? SubscriptionType { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ISubscriptionTypeDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ISubscriptionTypeDefinition.cs index b8d3cef14..e7c2dcac9 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ISubscriptionTypeDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ISubscriptionTypeDefinition.cs @@ -7,4 +7,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface ISubscriptionTypeDefinition { IObjectTypeDefinition? SubscriptionType { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ISyntaxConvertable.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ISyntaxConvertable.cs index 67ab17097..68efa6206 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ISyntaxConvertable.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/ISyntaxConvertable.cs @@ -7,4 +7,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface ISyntaxConvertable { SyntaxNode ToSyntaxNode(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IUnionType.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IUnionType.cs index 933ca9ec6..2a8d4250b 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IUnionType.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IUnionType.cs @@ -8,4 +8,4 @@ public interface IUnionType : IUnionTypeDefinition, ICompositeType, IAbstractType, IMemberTypes { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IUnionTypeDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IUnionTypeDefinition.cs index 5734614eb..b25a1c9cf 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IUnionTypeDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IUnionTypeDefinition.cs @@ -10,4 +10,4 @@ public interface IUnionTypeDefinition : IOutputDefinition, IMemberTypesDefinition { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IUnionTypes.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IUnionTypes.cs index 20c488f1a..130c27dba 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IUnionTypes.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IUnionTypes.cs @@ -10,4 +10,4 @@ public interface IUnionTypes : IUnionTypesDefinition [GraphQLIgnore] new IEnumerable GetUnions(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IUnionTypesDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IUnionTypesDefinition.cs index cee56a497..0fe4fd9d0 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IUnionTypesDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IUnionTypesDefinition.cs @@ -8,4 +8,4 @@ public interface IUnionTypesDefinition { [GraphQLIgnore] IEnumerable GetUnions(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IValueParser.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IValueParser.cs index a0f3486f4..4b0764010 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IValueParser.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IValueParser.cs @@ -5,4 +5,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface IValueParser : IValueParserDefinition { -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IValueParserDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IValueParserDefinition.cs index dc1c6663e..3cb542124 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IValueParserDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IValueParserDefinition.cs @@ -6,4 +6,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface IValueParserDefinition { LeafValueParser? ValueParser { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IWrappingNullableType.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IWrappingNullableType.cs index d3888d866..4a2554e84 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IWrappingNullableType.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IWrappingNullableType.cs @@ -7,4 +7,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface IWrappingNullableType : IWrappingType { new INullableType OfType { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IWrappingType.cs b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IWrappingType.cs index fef0bae1d..93a57e8e6 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IWrappingType.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/Taxonomy/IWrappingType.cs @@ -7,4 +7,4 @@ namespace GraphZen.TypeSystem.Taxonomy; public interface IWrappingType : IGraphQLType { IGraphQLType OfType { get; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/TypeComparators.cs b/src/GraphZen.TypeSystem/TypeSystem/TypeComparators.cs index 6370497f2..88f33b1c7 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/TypeComparators.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/TypeComparators.cs @@ -12,13 +12,18 @@ public static bool IsSubtypeOf(this IGraphQLType maybeSubType, IGraphQLType supe Check.NotNull(superType, nameof(superType)); Check.NotNull(schema, nameof(schema)); // Equivalent type is a valid subtype - if (maybeSubType.Equals(superType)) return true; + if (maybeSubType.Equals(superType)) + { + return true; + } // If superType is non-null, maybeSubType must also be non-null. if (superType is NonNullType superTypeNonNull) { if (maybeSubType is NonNullType maybeSubTypeNonNull) + { return maybeSubTypeNonNull.OfType.IsSubtypeOf(superTypeNonNull.OfType, schema); + } return false; } @@ -31,14 +36,18 @@ public static bool IsSubtypeOf(this IGraphQLType maybeSubType, IGraphQLType supe if (superType is ListType superTypeList) { if (maybeSubType is ListType maybeSubTypeList) + { return maybeSubTypeList.OfType.IsSubtypeOf(superTypeList.OfType, schema); + } return false; } if (maybeSubType is ListType) + { // If superType is not a list, maybeSubType must also be not a list. return false; + } // If superType type is an abstract type, maybeSubType type may be a currently @@ -47,9 +56,11 @@ public static bool IsSubtypeOf(this IGraphQLType maybeSubType, IGraphQLType supe maybeSubType is ObjectType maybeSubTypeObject && schema.IsPossibleType(superTypeAbstract, maybeSubTypeObject) ) + { return true; + } // Otherwise, the child type is not a valid subtype of the parent type. return false; } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/TypeIdentity.cs b/src/GraphZen.TypeSystem/TypeSystem/TypeIdentity.cs index 26b1810dc..edcce3799 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/TypeIdentity.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/TypeIdentity.cs @@ -43,8 +43,10 @@ public INamedTypeDefinition? Definition set { if (_typeDefinition != null) + { throw new InvalidOperationException( $"Cannot set property {nameof(TypeIdentity)}.{nameof(Definition)} with value {value}, it's value has already been set with {_typeDefinition}."); + } _typeDefinition = value ?? throw new InvalidOperationException( @@ -59,10 +61,20 @@ public string Name { get { - if (_typeDefinition is NamedType named) return named.Name; - if (_name != null) return _name; - if (ClrType != null) return ClrType.GetGraphQLName(); + if (_typeDefinition is NamedType named) + { + return named.Name; + } + if (_name != null) + { + return _name; + } + + if (ClrType != null) + { + return ClrType.GetGraphQLName(); + } throw new InvalidOperationException(); } @@ -73,8 +85,10 @@ public string Name var newId = new TypeIdentity(newName, _schema); var existing = _schema.FindTypeIdentity(newId); if (existing != null && !existing.Equals(this)) + { throw new InvalidOperationException( $"Cannot rename type \"{Name}\" to \"{newName}\", type named \"{newName}\" already exists."); + } _name = newName; } @@ -89,8 +103,10 @@ public bool? IsInputType set { if (_kind.HasValue) + { throw new InvalidOperationException( $"Cannot set property {nameof(TypeIdentity)}.{nameof(IsInputType)}, because the identity's type kind ({Kind}) is already set."); + } _isInputType = value; } @@ -102,8 +118,10 @@ public bool? IsOutputType set { if (_kind.HasValue) + { throw new InvalidOperationException( $"Cannot set property {nameof(TypeIdentity)}.{nameof(IsOutputType)}, because the type identity's kind ({Kind}) is already set."); + } _isOutputType = value; } @@ -113,11 +131,20 @@ public bool? IsOutputType public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } - if (obj.GetType() != GetType()) return false; + if (obj.GetType() != GetType()) + { + return false; + } return Equals((TypeIdentity)obj); } @@ -131,13 +158,17 @@ public bool Overlaps(TypeIdentity identity) Check.NotNull(identity, nameof(identity)); if (ClrType != null && identity.ClrType != null) + { if ((IsInputType == true && identity.IsInputType == true) || (IsOutputType == true && identity.IsOutputType == true)) + { return ClrType == identity.ClrType; + } + } return string.Equals(Name, identity.Name); } public override string ToString() => $"Identity:{(name: Name, clrType: ClrType, Kind, IsInputType, IsOutputType)}"; -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/TypeKind.cs b/src/GraphZen.TypeSystem/TypeSystem/TypeKind.cs index 23c51c236..ad6150176 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/TypeKind.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/TypeKind.cs @@ -9,29 +9,35 @@ namespace GraphZen.TypeSystem; [Description("An enum describing what kind of type a given `__Type` is.")] public enum TypeKind { - [Description("Indicates this type is a scalar.")] [GraphQLName("SCALAR")] + [Description("Indicates this type is a scalar.")] + [GraphQLName("SCALAR")] Scalar, - [Description("Indicates this type is an object fields` and `interfaces` are valid fields.")] [GraphQLName("OBJECT")] + [Description("Indicates this type is an object fields` and `interfaces` are valid fields.")] + [GraphQLName("OBJECT")] Object, [Description("Indicates this type is an interface. `fields` and `possibleTypes` are valid fields.")] [GraphQLName("INTERFACE")] Interface, - [Description("Indicates this type is a union. `possibleTypes` is a valid field.")] [GraphQLName("UNION")] + [Description("Indicates this type is a union. `possibleTypes` is a valid field.")] + [GraphQLName("UNION")] Union, - [Description("Indicates this type is an enum. `enumValues` is a valid field.")] [GraphQLName("ENUM")] + [Description("Indicates this type is an enum. `enumValues` is a valid field.")] + [GraphQLName("ENUM")] Enum, [Description("Indicates this type is an input object. `inputFields` is a valid field.")] [GraphQLName("INPUT_OBJECT")] InputObject, - [Description("Indicates this type is a list. `ofType` is a valid field.")] [GraphQLName("LIST")] + [Description("Indicates this type is a list. `ofType` is a valid field.")] + [GraphQLName("LIST")] List, - [Description("Indicates this type is a non-null. `ofType` is a valid field.")] [GraphQLName("NON_NULL")] + [Description("Indicates this type is a non-null. `ofType` is a valid field.")] + [GraphQLName("NON_NULL")] NonNull -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/TypeKindHelpers.cs b/src/GraphZen.TypeSystem/TypeSystem/TypeKindHelpers.cs index b8b8dc7fc..a30092607 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/TypeKindHelpers.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/TypeKindHelpers.cs @@ -117,4 +117,4 @@ public static bool IsOutputType(this TypeKind kind) throw new InvalidOperationException($"Cannot infer if output type from type kind {kind}."); } } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/TypeReference.cs b/src/GraphZen.TypeSystem/TypeSystem/TypeReference.cs index f9dd7707b..a0de3ee4f 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/TypeReference.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/TypeReference.cs @@ -32,7 +32,10 @@ IGraphQLType ResolveType(TypeSyntax node) return NonNullType.Of((INullableType)ResolveType(nn.OfType)); case NamedTypeSyntax _: var nameMatch = schema.FindType(Identity.Name); - if (nameMatch != null) return nameMatch; + if (nameMatch != null) + { + return nameMatch; + } if (Identity.ClrType != null) { @@ -40,11 +43,16 @@ IGraphQLType ResolveType(TypeSyntax node) .Where(_ => _.ClrType != null && _.ClrType.IsAssignableFrom(Identity.ClrType)) .ToArray(); - if (typeMatches.Length == 1) return typeMatches[0]; + if (typeMatches.Length == 1) + { + return typeMatches[0]; + } if (typeMatches.Length > 1) + { throw new Exception( $"More than one type in the schema matched type reference \"{Identity.Name}\" with CLR type {Identity.ClrType}"); + } throw new Exception( $"Unable to find output type for type reference named \"{Identity.Name}\" with CLR type {Identity.ClrType}"); @@ -62,4 +70,4 @@ IGraphQLType ResolveType(TypeSyntax node) } public override string ToString() => "Reference:" + Name; -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/TypeResolver.cs b/src/GraphZen.TypeSystem/TypeSystem/TypeResolver.cs index 51e2a4aa6..32f09854f 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/TypeResolver.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/TypeResolver.cs @@ -6,4 +6,4 @@ namespace GraphZen.TypeSystem; public delegate string TypeResolver(TSource value, TContext context, ResolveInfo info) where TContext : GraphQLContext; -public delegate IGraphQLType TypeResolver(IGraphQLTypeReference typeReference); \ No newline at end of file +public delegate IGraphQLType TypeResolver(IGraphQLTypeReference typeReference); diff --git a/src/GraphZen.TypeSystem/TypeSystem/UnionType.cs b/src/GraphZen.TypeSystem/TypeSystem/UnionType.cs index 9b4d05c0d..48e7a3a18 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/UnionType.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/UnionType.cs @@ -25,13 +25,17 @@ IReadOnlyList directives { var types = lazyTypes.Value; if (types == null || types.Count == 0) + { throw new Exception($"Must provide list of types for Union {name}"); + } var includedTypeNames = new Dictionary(); foreach (var objectType in types.Values) { if (includedTypeNames.ContainsKey(objectType.Name)) + { throw new Exception($"Union {name} can include {objectType.Name} only once."); + } includedTypeNames[objectType.Name] = true; } @@ -88,4 +92,4 @@ public static UnionType From(IUnionTypeDefinition definition, Schema schema) return new UnionType(definition.Name, definition.Description, definition.ClrType, lazyTypes, definition.ResolveType, definition.GetDirectiveAnnotations().ToList()); } -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/UnionTypeBuilder.cs b/src/GraphZen.TypeSystem/TypeSystem/UnionTypeBuilder.cs index 16bae983f..d5ac6daf9 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/UnionTypeBuilder.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/UnionTypeBuilder.cs @@ -108,4 +108,4 @@ public IUnionTypeBuilder DirectiveAnnotation(string name, obje public IUnionTypeBuilder IgnoreDirectiveAnnotation(string name) => throw new NotImplementedException(); -} \ No newline at end of file +} diff --git a/src/GraphZen.TypeSystem/TypeSystem/UnionTypeDefinition.cs b/src/GraphZen.TypeSystem/TypeSystem/UnionTypeDefinition.cs index 5161bae27..8e1bf4b87 100644 --- a/src/GraphZen.TypeSystem/TypeSystem/UnionTypeDefinition.cs +++ b/src/GraphZen.TypeSystem/TypeSystem/UnionTypeDefinition.cs @@ -45,8 +45,14 @@ public void AddType(ObjectTypeDefinition type) { Check.NotNull(type, nameof(type)); if (type.Name == null) + { throw new ArgumentException( $"Cannot include {type} in {Name} union type definition unless a name is defined"); - if (!_types.Contains(type)) _types.Add(type); + } + + if (!_types.Contains(type)) + { + _types.Add(type); + } } -} \ No newline at end of file +} diff --git a/src/Shared/JetBrainsAnnotations.cs b/src/Shared/JetBrainsAnnotations.cs index 438678ac7..a98aba95d 100644 --- a/src/Shared/JetBrainsAnnotations.cs +++ b/src/Shared/JetBrainsAnnotations.cs @@ -25,8 +25,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // ReSharper disable InheritdocConsiderUsage -using GraphZen.Infrastructure; - #pragma warning disable 1591 // ReSharper disable UnusedMember.Global // ReSharper disable MemberCanBePrivate.Global @@ -1196,4 +1194,4 @@ internal sealed class RazorWriteMethodAttribute : Attribute [AttributeUsage(AttributeTargets.Parameter)] internal sealed class RazorWriteMethodParameterAttribute : Attribute { -} \ No newline at end of file +} diff --git a/test/GraphZen.AspNetCore.Playground.IntegrationTests/PlaygroundEndpointBuilderExtensionIntegrationTests.cs b/test/GraphZen.AspNetCore.Playground.IntegrationTests/PlaygroundEndpointBuilderExtensionIntegrationTests.cs index 148901a07..093d5e152 100644 --- a/test/GraphZen.AspNetCore.Playground.IntegrationTests/PlaygroundEndpointBuilderExtensionIntegrationTests.cs +++ b/test/GraphZen.AspNetCore.Playground.IntegrationTests/PlaygroundEndpointBuilderExtensionIntegrationTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.Playground; using GraphZen.Playground.Internal; using Microsoft.AspNetCore; @@ -138,4 +137,4 @@ private static HttpClient CreateAppClient() where T : class => #pragma warning disable ASPDEPR008 new TestServer(WebHost.CreateDefaultBuilder().UseStartup()).CreateClient(); #pragma warning restore ASPDEPR008 -} \ No newline at end of file +} diff --git a/test/GraphZen.AspNetCore.Playground.Tests/PlaygroundHtmlWriterTests.cs b/test/GraphZen.AspNetCore.Playground.Tests/PlaygroundHtmlWriterTests.cs index e718264ea..1e5c35cf6 100644 --- a/test/GraphZen.AspNetCore.Playground.Tests/PlaygroundHtmlWriterTests.cs +++ b/test/GraphZen.AspNetCore.Playground.Tests/PlaygroundHtmlWriterTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.Playground; using GraphZen.Playground.Internal; @@ -26,4 +25,4 @@ public void playground_html_should_contain_options_object() var optionsJson = PlaygroundHtmlWriter.GetPlaygroundOptionsJson(options); Assert.Contains(optionsJson, html); } -} \ No newline at end of file +} diff --git a/test/GraphZen.AspNetCore.Server.Tests/ApplicationBuilderExtensionsTests.cs b/test/GraphZen.AspNetCore.Server.Tests/ApplicationBuilderExtensionsTests.cs index f4451a9bb..45e5023f6 100644 --- a/test/GraphZen.AspNetCore.Server.Tests/ApplicationBuilderExtensionsTests.cs +++ b/test/GraphZen.AspNetCore.Server.Tests/ApplicationBuilderExtensionsTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using Microsoft.AspNetCore.Builder; namespace GraphZen.AspNetCore.Server.Tests; @@ -13,4 +12,4 @@ public class ApplicationBuilderExtensionsTests public void should_share_IApplicationBuilder_namespace() => Assert.Equal(typeof(IApplicationBuilder).Namespace, typeof(GraphZenApplicationBuilderExtensions).Namespace); -} \ No newline at end of file +} diff --git a/test/GraphZen.AspNetCore.Server.Tests/ServiceCollectionExtensionTests.cs b/test/GraphZen.AspNetCore.Server.Tests/ServiceCollectionExtensionTests.cs index 03de8d0d2..1df3fb863 100644 --- a/test/GraphZen.AspNetCore.Server.Tests/ServiceCollectionExtensionTests.cs +++ b/test/GraphZen.AspNetCore.Server.Tests/ServiceCollectionExtensionTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using Microsoft.Extensions.DependencyInjection; namespace GraphZen.AspNetCore.Server.Tests; @@ -96,4 +95,4 @@ public void add_custom_context_with_no_options_ctor_with_options_throws_exceptio $"AddGraphQLContext was called with configuration, but the context type '{typeof(GraphQLContextNoOptionsConstructor)}' only declares a parameterless constructor. This means that the configuration passed to AddGraphQLContext will never be used. If configuration is passed to AddGraphQLContext, then '{typeof(GraphQLContextNoOptionsConstructor)}' should declare a constructor that accepts a GraphQLContextOptions and must pass it to the base constructor for GraphQLContext.", ex.Message); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Client.IntegrationTests/GraphQLRequestIntegrationTests.cs b/test/GraphZen.Client.IntegrationTests/GraphQLRequestIntegrationTests.cs index 5d091c22c..d8781c498 100644 --- a/test/GraphZen.Client.IntegrationTests/GraphQLRequestIntegrationTests.cs +++ b/test/GraphZen.Client.IntegrationTests/GraphQLRequestIntegrationTests.cs @@ -60,4 +60,4 @@ public class TypedQueryResult { public string? Message { get; set; } } -} \ No newline at end of file +} diff --git a/test/GraphZen.Client.Tests/GraphQLRequestToHttpRequestTests.cs b/test/GraphZen.Client.Tests/GraphQLRequestToHttpRequestTests.cs index 3ae3b94d9..9c832c4f0 100644 --- a/test/GraphZen.Client.Tests/GraphQLRequestToHttpRequestTests.cs +++ b/test/GraphZen.Client.Tests/GraphQLRequestToHttpRequestTests.cs @@ -40,4 +40,4 @@ public void it_sets_content_to_utf8_application_json_media_type_string() var requestJsonContent = new StringContent(requestJson, Encoding.UTF8, "application/json"); Assert.Equivalent(requestJsonContent, request.ToHttpRequest().Content); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Client.Tests/Internal/GraphQLSerializerTests.cs b/test/GraphZen.Client.Tests/Internal/GraphQLSerializerTests.cs index 3203b3a5f..bb2807f15 100644 --- a/test/GraphZen.Client.Tests/Internal/GraphQLSerializerTests.cs +++ b/test/GraphZen.Client.Tests/Internal/GraphQLSerializerTests.cs @@ -67,4 +67,4 @@ public void parse_typed_data_should_return_typed_data() Number = 1 }); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Infrastructure.Testing.Tests/Extensions/Assertions/JsonAssertTests.cs b/test/GraphZen.Infrastructure.Testing.Tests/Extensions/Assertions/JsonAssertTests.cs index ae94f70bd..e3b854fe2 100644 --- a/test/GraphZen.Infrastructure.Testing.Tests/Extensions/Assertions/JsonAssertTests.cs +++ b/test/GraphZen.Infrastructure.Testing.Tests/Extensions/Assertions/JsonAssertTests.cs @@ -2,7 +2,6 @@ // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. using System.Text.Json.Nodes; -using GraphZen.Infrastructure; using Xunit.Sdk; namespace GraphZen.Infrastructure; @@ -62,4 +61,4 @@ public void unequal_json_should_fail() JsonAssert.EquivalentToJson(new { foo = 1 }, expected, options => { })); Assert.Equal(expectedDiff, ex3.Message); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Infrastructure.Testing.Tests/Extensions/Assertions/StringAssertTests.cs b/test/GraphZen.Infrastructure.Testing.Tests/Extensions/Assertions/StringAssertTests.cs index be097a101..50221d48b 100644 --- a/test/GraphZen.Infrastructure.Testing.Tests/Extensions/Assertions/StringAssertTests.cs +++ b/test/GraphZen.Infrastructure.Testing.Tests/Extensions/Assertions/StringAssertTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using Xunit.Sdk; namespace GraphZen.Infrastructure; @@ -32,4 +31,4 @@ public void it_should_fail_for_unequal_strings(string actual, string expected) var ex3 = Assert.Throws(() => StringAssert.Equal(actual, expected, opt => { })); Assert.Equal(expectedDiff, ex3.Message); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Infrastructure.Testing.Tests/Extensions/Json/JsonNodeSortingExtensionsTests.cs b/test/GraphZen.Infrastructure.Testing.Tests/Extensions/Json/JsonNodeSortingExtensionsTests.cs index 8627e239c..c2b7596ee 100644 --- a/test/GraphZen.Infrastructure.Testing.Tests/Extensions/Json/JsonNodeSortingExtensionsTests.cs +++ b/test/GraphZen.Infrastructure.Testing.Tests/Extensions/Json/JsonNodeSortingExtensionsTests.cs @@ -2,7 +2,6 @@ // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. using System.Text.Json.Nodes; -using GraphZen.Infrastructure; namespace GraphZen.Infrastructure; @@ -42,4 +41,4 @@ public void it_should_sort_json_arrays_by_item(string unsortedJson, string expec expectedJson = expectedNode!.ToJsonString(); StringAssert.Equal(unsortedJson, expectedJson, true); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Infrastructure.Testing.Tests/Extensions/Superpower/SuperpowerTestExtensionsTests.cs b/test/GraphZen.Infrastructure.Testing.Tests/Extensions/Superpower/SuperpowerTestExtensionsTests.cs index 8820fa0c8..4b7a05dbc 100644 --- a/test/GraphZen.Infrastructure.Testing.Tests/Extensions/Superpower/SuperpowerTestExtensionsTests.cs +++ b/test/GraphZen.Infrastructure.Testing.Tests/Extensions/Superpower/SuperpowerTestExtensionsTests.cs @@ -1,10 +1,8 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.Infrastructure; public class SuperpowerTestExtensionsTests { -} \ No newline at end of file +} diff --git a/test/GraphZen.Infrastructure.Testing.Tests/Extensions/System/EnumerableTestExtensionsTests.cs b/test/GraphZen.Infrastructure.Testing.Tests/Extensions/System/EnumerableTestExtensionsTests.cs index 50898e731..e0a02aefb 100644 --- a/test/GraphZen.Infrastructure.Testing.Tests/Extensions/System/EnumerableTestExtensionsTests.cs +++ b/test/GraphZen.Infrastructure.Testing.Tests/Extensions/System/EnumerableTestExtensionsTests.cs @@ -1,10 +1,8 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.Infrastructure; public class EnumerableTestExtensionsTests { -} \ No newline at end of file +} diff --git a/test/GraphZen.Infrastructure.Testing.Tests/Extensions/System/JsonDifferTests.cs b/test/GraphZen.Infrastructure.Testing.Tests/Extensions/System/JsonDifferTests.cs index de5a04ff1..010202e35 100644 --- a/test/GraphZen.Infrastructure.Testing.Tests/Extensions/System/JsonDifferTests.cs +++ b/test/GraphZen.Infrastructure.Testing.Tests/Extensions/System/JsonDifferTests.cs @@ -1,10 +1,8 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.Infrastructure; public class JsonDifferTests { -} \ No newline at end of file +} diff --git a/test/GraphZen.Infrastructure.Testing.Tests/Extensions/System/ResultComparisonOptionsTests.cs b/test/GraphZen.Infrastructure.Testing.Tests/Extensions/System/ResultComparisonOptionsTests.cs index 301ae4d20..d7fd0c678 100644 --- a/test/GraphZen.Infrastructure.Testing.Tests/Extensions/System/ResultComparisonOptionsTests.cs +++ b/test/GraphZen.Infrastructure.Testing.Tests/Extensions/System/ResultComparisonOptionsTests.cs @@ -1,10 +1,8 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.Infrastructure; public class ResultComparisonOptionsTests { -} \ No newline at end of file +} diff --git a/test/GraphZen.Infrastructure.Testing.Tests/Extensions/System/StringDifferTests.cs b/test/GraphZen.Infrastructure.Testing.Tests/Extensions/System/StringDifferTests.cs index b20e2189a..d460d18f6 100644 --- a/test/GraphZen.Infrastructure.Testing.Tests/Extensions/System/StringDifferTests.cs +++ b/test/GraphZen.Infrastructure.Testing.Tests/Extensions/System/StringDifferTests.cs @@ -1,10 +1,8 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.Infrastructure; public class StringDifferTests { -} \ No newline at end of file +} diff --git a/test/GraphZen.Infrastructure.Testing.Tests/Extensions/System/StringTestExtensionTests.cs b/test/GraphZen.Infrastructure.Testing.Tests/Extensions/System/StringTestExtensionTests.cs index 747b2bb77..968427572 100644 --- a/test/GraphZen.Infrastructure.Testing.Tests/Extensions/System/StringTestExtensionTests.cs +++ b/test/GraphZen.Infrastructure.Testing.Tests/Extensions/System/StringTestExtensionTests.cs @@ -1,10 +1,8 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.Infrastructure; public class StringTestExtensionTests { -} \ No newline at end of file +} diff --git a/test/GraphZen.Infrastructure.Testing/Extensions/Assertions/JsonAssert.cs b/test/GraphZen.Infrastructure.Testing/Extensions/Assertions/JsonAssert.cs index 94d3d9a35..a6531e659 100644 --- a/test/GraphZen.Infrastructure.Testing/Extensions/Assertions/JsonAssert.cs +++ b/test/GraphZen.Infrastructure.Testing/Extensions/Assertions/JsonAssert.cs @@ -2,7 +2,6 @@ // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. using System.Text.Json.Nodes; -using GraphZen.Infrastructure; using Xunit.Sdk; namespace GraphZen.Infrastructure; @@ -11,9 +10,16 @@ public static class JsonAssert { public static void EquivalentToJsonFromObject(object? actual, object expected, JsonDiffOptions? options = null) { - if (actual == null) throw new XunitException("Expected object to be equivalent to JSON, but actual was null."); + if (actual == null) + { + throw new XunitException("Expected object to be equivalent to JSON, but actual was null."); + } + var diff = JsonDiffer.GetDiff(actual, expected, options); - if (diff != null) throw new XunitException(diff); + if (diff != null) + { + throw new XunitException(diff); + } } public static void EquivalentToJsonFromObject(object? actual, object expected, @@ -25,10 +31,17 @@ public static void EquivalentToJsonFromObject(object? actual, object expected, public static void EquivalentToJson(object? actual, string expected, JsonDiffOptions? options = null) { - if (actual == null) throw new XunitException("Expected object to be equivalent to JSON, but actual was null."); + if (actual == null) + { + throw new XunitException("Expected object to be equivalent to JSON, but actual was null."); + } + var expectedNode = JsonNode.Parse(expected); var diff = JsonDiffer.GetDiff(actual, expectedNode!, options); - if (diff != null) throw new XunitException(diff); + if (diff != null) + { + throw new XunitException(diff); + } } public static void EquivalentToJson(object? actual, string expected, Action optionsAction) @@ -36,4 +49,4 @@ public static void EquivalentToJson(object? actual, string expected, Action?)null); + } else + { Assert.Equal(expected, actual); + } } -} \ No newline at end of file +} diff --git a/test/GraphZen.Infrastructure.Testing/Extensions/Json/JsonNodeSortingExtensions.cs b/test/GraphZen.Infrastructure.Testing/Extensions/Json/JsonNodeSortingExtensions.cs index 863d6bed4..3662d75eb 100644 --- a/test/GraphZen.Infrastructure.Testing/Extensions/Json/JsonNodeSortingExtensions.cs +++ b/test/GraphZen.Infrastructure.Testing/Extensions/Json/JsonNodeSortingExtensions.cs @@ -2,7 +2,6 @@ // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. using System.Text.Json.Nodes; -using GraphZen.Infrastructure; namespace GraphZen.Infrastructure; @@ -41,7 +40,9 @@ private static void SortArray(this JsonArray arr) foreach (var el in arr) { if (el is JsonObject elObj) + { elObj.SortProperties(); + } } string? GetComparable(JsonNode? jn) @@ -50,11 +51,15 @@ private static void SortArray(this JsonArray arr) { var nameNode = jo["name"]; if (nameNode is JsonValue jv) + { return jv.ToString(); + } } if (jn is JsonValue jtv) + { return jtv.ToString(); + } return null; } @@ -67,7 +72,10 @@ private static void SortArray(this JsonArray arr) { var xc = GetComparable(x); var yc = GetComparable(y); - if (xc != null && yc != null) return string.Compare(xc, yc, StringComparison.Ordinal); + if (xc != null && yc != null) + { + return string.Compare(xc, yc, StringComparison.Ordinal); + } return 0; }); @@ -77,4 +85,4 @@ private static void SortArray(this JsonArray arr) arr.Add(el); } } -} \ No newline at end of file +} diff --git a/test/GraphZen.Infrastructure.Testing/Extensions/Superpower/SuperpowerTestExtensions.cs b/test/GraphZen.Infrastructure.Testing/Extensions/Superpower/SuperpowerTestExtensions.cs index 1e499890a..592ea12ef 100644 --- a/test/GraphZen.Infrastructure.Testing/Extensions/Superpower/SuperpowerTestExtensions.cs +++ b/test/GraphZen.Infrastructure.Testing/Extensions/Superpower/SuperpowerTestExtensions.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using Superpower.Model; namespace GraphZen.Infrastructure; @@ -10,6 +9,9 @@ public static class SuperpowerTestExtensions { public static void ThrowOnParserError(this TokenListParserResult result) { - if (!result.HasValue) throw new Exception(result.ToString()); + if (!result.HasValue) + { + throw new Exception(result.ToString()); + } } -} \ No newline at end of file +} diff --git a/test/GraphZen.Infrastructure.Testing/Extensions/System/EnumerableTestExtensions.cs b/test/GraphZen.Infrastructure.Testing/Extensions/System/EnumerableTestExtensions.cs index d5e72d14a..eb7706745 100644 --- a/test/GraphZen.Infrastructure.Testing/Extensions/System/EnumerableTestExtensions.cs +++ b/test/GraphZen.Infrastructure.Testing/Extensions/System/EnumerableTestExtensions.cs @@ -1,12 +1,10 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.Infrastructure; public static class EnumerableTestExtensions { public static string ToMultiLineString(this IEnumerable values) => string.Join(Environment.NewLine, values); -} \ No newline at end of file +} diff --git a/test/GraphZen.Infrastructure.Testing/Extensions/System/StringDiffExtensions.cs b/test/GraphZen.Infrastructure.Testing/Extensions/System/StringDiffExtensions.cs index 858d28320..dd1c3f1db 100644 --- a/test/GraphZen.Infrastructure.Testing/Extensions/System/StringDiffExtensions.cs +++ b/test/GraphZen.Infrastructure.Testing/Extensions/System/StringDiffExtensions.cs @@ -5,7 +5,6 @@ using DiffPlex; using DiffPlex.DiffBuilder; using DiffPlex.DiffBuilder.Model; -using GraphZen.Infrastructure; namespace GraphZen.Infrastructure; @@ -67,13 +66,22 @@ private static bool TryGetDiff(string actual, string expected, out string differ var errorMessage = hasDiff ? "Differences found " : "No differences found"; errorMessage += "\n"; - if (options.ShowActual) errorMessage += $"=== Actual ===\n{actual}\n"; + if (options.ShowActual) + { + errorMessage += $"=== Actual ===\n{actual}\n"; + } - if (options.ShowExpected) errorMessage += $"=== Expected ===\n{expected}\n"; + if (options.ShowExpected) + { + errorMessage += $"=== Expected ===\n{expected}\n"; + } - if (options.ShowDiffs) errorMessage += $"=== Differences ===\n{diffString}\n"; + if (options.ShowDiffs) + { + errorMessage += $"=== Differences ===\n{diffString}\n"; + } differences = errorMessage; return hasDiff; } -} \ No newline at end of file +} diff --git a/test/GraphZen.Infrastructure.Testing/Extensions/System/StringDiffOptions.cs b/test/GraphZen.Infrastructure.Testing/Extensions/System/StringDiffOptions.cs index d1756a9cc..dbab6e172 100644 --- a/test/GraphZen.Infrastructure.Testing/Extensions/System/StringDiffOptions.cs +++ b/test/GraphZen.Infrastructure.Testing/Extensions/System/StringDiffOptions.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.Infrastructure; public class StringDiffOptions @@ -14,9 +12,13 @@ public class StringDiffOptions internal static StringDiffOptions? FromOptionsAction( Action? optionsAction) { - if (optionsAction == null) return null; + if (optionsAction == null) + { + return null; + } + var options = new StringDiffOptions(); optionsAction(options); return options; } -} \ No newline at end of file +} diff --git a/test/GraphZen.Infrastructure.Testing/Extensions/System/StringDisplayExtensions.cs b/test/GraphZen.Infrastructure.Testing/Extensions/System/StringDisplayExtensions.cs index 646e893d2..f783b6ebb 100644 --- a/test/GraphZen.Infrastructure.Testing/Extensions/System/StringDisplayExtensions.cs +++ b/test/GraphZen.Infrastructure.Testing/Extensions/System/StringDisplayExtensions.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.Infrastructure; public static class StringDisplayExtensions @@ -21,4 +19,4 @@ public static string Dedent(this string str) var result = lines.ToMultiLineString(); return result; } -} \ No newline at end of file +} diff --git a/test/GraphZen.Infrastructure.Testing/JsonDiffOptions.cs b/test/GraphZen.Infrastructure.Testing/JsonDiffOptions.cs index 73852610e..d5b288868 100644 --- a/test/GraphZen.Infrastructure.Testing/JsonDiffOptions.cs +++ b/test/GraphZen.Infrastructure.Testing/JsonDiffOptions.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.Infrastructure; public class JsonDiffOptions @@ -13,9 +11,13 @@ public class JsonDiffOptions internal static JsonDiffOptions? FromOptionsAction( Action? optionsAction) { - if (optionsAction == null) return null; + if (optionsAction == null) + { + return null; + } + var options = new JsonDiffOptions(); optionsAction(options); return options; } -} \ No newline at end of file +} diff --git a/test/GraphZen.Infrastructure.Testing/JsonDiffer.cs b/test/GraphZen.Infrastructure.Testing/JsonDiffer.cs index d14afb350..f60ee4272 100644 --- a/test/GraphZen.Infrastructure.Testing/JsonDiffer.cs +++ b/test/GraphZen.Infrastructure.Testing/JsonDiffer.cs @@ -3,7 +3,6 @@ using System.Text.Json; using System.Text.Json.Nodes; -using GraphZen.Infrastructure; namespace GraphZen.Infrastructure; @@ -40,7 +39,11 @@ public static class JsonDiffer var expectedFormatted = Json.SerializeObject(expected); var actualFormatted = Json.SerializeObject(actual); var diff = actualFormatted.GetDiff(expectedFormatted, options.StringDiffOptions); - if (diff == null) return "a difference was detected, but there was an error calculating the difference"; + if (diff == null) + { + return "a difference was detected, but there was an error calculating the difference"; + } + return diff; } @@ -49,18 +52,34 @@ public static class JsonDiffer private static bool JsonNodesEqual(JsonNode? a, JsonNode? b) { - if (a is null && b is null) return true; - if (a is null || b is null) return false; + if (a is null && b is null) + { + return true; + } + + if (a is null || b is null) + { + return false; + } if (a is JsonObject objA && b is JsonObject objB) { - if (objA.Count != objB.Count) return false; + if (objA.Count != objB.Count) + { + return false; + } + foreach (var prop in objA) { if (!objB.TryGetPropertyValue(prop.Key, out var bVal)) + { return false; + } + if (!JsonNodesEqual(prop.Value, bVal)) + { return false; + } } return true; @@ -68,12 +87,19 @@ private static bool JsonNodesEqual(JsonNode? a, JsonNode? b) if (a is JsonArray arrA && b is JsonArray arrB) { - if (arrA.Count != arrB.Count) return false; + if (arrA.Count != arrB.Count) + { + return false; + } + return arrA.Zip(arrB).All(pair => JsonNodesEqual(pair.First, pair.Second)); } - if (a is JsonValue valA && b is JsonValue valB) return valA.ToJsonString() == valB.ToJsonString(); + if (a is JsonValue valA && b is JsonValue valB) + { + return valA.ToJsonString() == valB.ToJsonString(); + } return false; } -} \ No newline at end of file +} diff --git a/test/GraphZen.Infrastructure.Testing/NamedCollection.cs b/test/GraphZen.Infrastructure.Testing/NamedCollection.cs index 4038b104f..8a5a9c64e 100644 --- a/test/GraphZen.Infrastructure.Testing/NamedCollection.cs +++ b/test/GraphZen.Infrastructure.Testing/NamedCollection.cs @@ -2,7 +2,6 @@ // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. using System.Collections; -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Taxonomy; namespace GraphZen.Infrastructure; @@ -41,7 +40,10 @@ public override T this[string key] { get { - if (TryGetValue(key, out var value)) return value; + if (TryGetValue(key, out var value)) + { + return value; + } throw new InvalidOperationException($"Item named '{key}' does not exist in this collection"); } @@ -110,4 +112,4 @@ public override string ToString() // ReSharper disable once PossibleNullReferenceException return string.Join(", ", this.Select(_ => _.Name)); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Infrastructure.Testing/TestDataExtensions.cs b/test/GraphZen.Infrastructure.Testing/TestDataExtensions.cs index fc389e62d..65c549e66 100644 --- a/test/GraphZen.Infrastructure.Testing/TestDataExtensions.cs +++ b/test/GraphZen.Infrastructure.Testing/TestDataExtensions.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.Infrastructure; public static class TestDataExtensions @@ -15,4 +13,4 @@ public static class TestDataExtensions /// public static IEnumerable ToTestData(this IEnumerable source) => source.Select(_ => new object[] { _! }); -} \ No newline at end of file +} diff --git a/test/GraphZen.Infrastructure.Testing/TestDataFixtureRunner.cs b/test/GraphZen.Infrastructure.Testing/TestDataFixtureRunner.cs index 6846d3cd4..8e1e4276f 100644 --- a/test/GraphZen.Infrastructure.Testing/TestDataFixtureRunner.cs +++ b/test/GraphZen.Infrastructure.Testing/TestDataFixtureRunner.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.Infrastructure; public abstract class TestDataFixtureRunner @@ -48,4 +46,4 @@ protected void RunFixture(T fixture, Action test) {ex.GetType()}: {ex.Message}", ex); } } -} \ No newline at end of file +} diff --git a/test/GraphZen.Infrastructure.Testing/TestHelpers.cs b/test/GraphZen.Infrastructure.Testing/TestHelpers.cs index 4740d3ead..dc204fa56 100644 --- a/test/GraphZen.Infrastructure.Testing/TestHelpers.cs +++ b/test/GraphZen.Infrastructure.Testing/TestHelpers.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.Infrastructure; public static class TestHelpers @@ -14,4 +12,4 @@ public static IDictionary ToDictionary(dynamic value) : new Dictionary(); return dict; } -} \ No newline at end of file +} diff --git a/test/GraphZen.LanguageModel.Tests/Internal/Grammar/DirectiveLocationExtensionTests.cs b/test/GraphZen.LanguageModel.Tests/Internal/Grammar/DirectiveLocationExtensionTests.cs index d56f19e0e..8dc14463b 100644 --- a/test/GraphZen.LanguageModel.Tests/Internal/Grammar/DirectiveLocationExtensionTests.cs +++ b/test/GraphZen.LanguageModel.Tests/Internal/Grammar/DirectiveLocationExtensionTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Internal; namespace GraphZen.LanguageModel.Tests.Internal.Grammar; @@ -16,4 +15,4 @@ public void get_display_value_should_not_be_null_for_all_values() Assert.NotNull(value.GetDisplayValue()); } } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Error/GraphQLErrorTests.cs b/test/GraphZen.Tests/Error/GraphQLErrorTests.cs index c49b9d03c..4fb338599 100644 --- a/test/GraphZen.Tests/Error/GraphQLErrorTests.cs +++ b/test/GraphZen.Tests/Error/GraphQLErrorTests.cs @@ -76,4 +76,4 @@ public void ItSerializesToIncludePath() path = new object[] { "path", 3, "to", "field" } }); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/FixIndentTests.cs b/test/GraphZen.Tests/FixIndentTests.cs index 04b445c2e..7cdd8c31e 100644 --- a/test/GraphZen.Tests/FixIndentTests.cs +++ b/test/GraphZen.Tests/FixIndentTests.cs @@ -53,4 +53,4 @@ public void RemovesOnlyFirstLevelOfIndentation() }.ToMultiLineString(); Assert.Equal(expected, result); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Infrastructure/Extensions/ClrTypeExtensionTests.cs b/test/GraphZen.Tests/Infrastructure/Extensions/ClrTypeExtensionTests.cs index ac07d1bc7..5b5400f81 100644 --- a/test/GraphZen.Tests/Infrastructure/Extensions/ClrTypeExtensionTests.cs +++ b/test/GraphZen.Tests/Infrastructure/Extensions/ClrTypeExtensionTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Internal; using GraphZen.TypeSystem.Internal; @@ -22,7 +21,10 @@ public void TryGetNullableType_ShouldGetNullableType(Type input, bool isNullable { var result = input.TryGetNullableType(out var nullableClrType); Assert.Equal(isNullable, result); - if (result) Assert.Equal(expectedNullableType, nullableClrType); + if (result) + { + Assert.Equal(expectedNullableType, nullableClrType); + } } [Theory] @@ -81,4 +83,4 @@ public void try_get_graphql_type_info_returns_false_for_generic_inner_type(Type Assert.Null(typeNode); Assert.Null(innerClrType); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Infrastructure/Extensions/StringExtensionTests.cs b/test/GraphZen.Tests/Infrastructure/Extensions/StringExtensionTests.cs index 0e0561e79..210c2a234 100644 --- a/test/GraphZen.Tests/Infrastructure/Extensions/StringExtensionTests.cs +++ b/test/GraphZen.Tests/Infrastructure/Extensions/StringExtensionTests.cs @@ -39,4 +39,4 @@ public void ToUpperSnakeCase(string input, string expectation) { Assert.Equal(expectation, input.ToUpperSnakeCase()); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Infrastructure/StringUtilsTests/QuotedOrListTests.cs b/test/GraphZen.Tests/Infrastructure/StringUtilsTests/QuotedOrListTests.cs index 0de01112e..8603461a6 100644 --- a/test/GraphZen.Tests/Infrastructure/StringUtilsTests/QuotedOrListTests.cs +++ b/test/GraphZen.Tests/Infrastructure/StringUtilsTests/QuotedOrListTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using static GraphZen.Infrastructure.StringUtils; namespace GraphZen.Tests.Infrastructure.StringUtilsTests; @@ -38,4 +37,4 @@ public void ReturnsTwoItemList() { Assert.Equal("\"A\" or \"B\"", QuotedOrList("A", "B")); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Infrastructure/StringUtilsTests/SuggestionListTests.cs b/test/GraphZen.Tests/Infrastructure/StringUtilsTests/SuggestionListTests.cs index ebe853b11..584aeaeba 100644 --- a/test/GraphZen.Tests/Infrastructure/StringUtilsTests/SuggestionListTests.cs +++ b/test/GraphZen.Tests/Infrastructure/StringUtilsTests/SuggestionListTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using static GraphZen.Infrastructure.StringUtils; @@ -26,4 +25,4 @@ public void ReturnsResultsWhenInputIsEmpty() { Assert.Equivalent(new[] { "a" }, GetSuggestionList("", "a")); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Internal/GetGraphQLFieldNameTests.cs b/test/GraphZen.Tests/Internal/GetGraphQLFieldNameTests.cs index 29bebb535..9d0605718 100644 --- a/test/GraphZen.Tests/Internal/GetGraphQLFieldNameTests.cs +++ b/test/GraphZen.Tests/Internal/GetGraphQLFieldNameTests.cs @@ -44,4 +44,4 @@ public void VoidMethod() [UsedImplicitly] public Task StringMethodAsync() => Task.FromResult("hello world"); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/LanguageModel/BlockStringPrinterTests.cs b/test/GraphZen.Tests/LanguageModel/BlockStringPrinterTests.cs index 6dbd6a628..a366d83c0 100644 --- a/test/GraphZen.Tests/LanguageModel/BlockStringPrinterTests.cs +++ b/test/GraphZen.Tests/LanguageModel/BlockStringPrinterTests.cs @@ -43,4 +43,4 @@ public void ItCorrectlyPrintsStringWithFirstLineOfIndentation() } ").ToSyntaxString()); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/LanguageModel/BlockStringValueTests.cs b/test/GraphZen.Tests/LanguageModel/BlockStringValueTests.cs index e4f0fd927..8837fd752 100644 --- a/test/GraphZen.Tests/LanguageModel/BlockStringValueTests.cs +++ b/test/GraphZen.Tests/LanguageModel/BlockStringValueTests.cs @@ -134,4 +134,4 @@ public void RetainsIndentationFromFirstLine() Assert.Equal(expected, result); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/LanguageModel/Internal/GraphQLNameTests.cs b/test/GraphZen.Tests/LanguageModel/Internal/GraphQLNameTests.cs index e4a7b2d55..09b66b587 100644 --- a/test/GraphZen.Tests/LanguageModel/Internal/GraphQLNameTests.cs +++ b/test/GraphZen.Tests/LanguageModel/Internal/GraphQLNameTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Internal; namespace GraphZen.Tests.LanguageModel.Internal; @@ -34,4 +33,4 @@ public class Foo public class Bar { } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/LanguageModel/Internal/Parser/ArgumentsParserTests.cs b/test/GraphZen.Tests/LanguageModel/Internal/Parser/ArgumentsParserTests.cs index 4a1fca761..ebd55f4a4 100644 --- a/test/GraphZen.Tests/LanguageModel/Internal/Parser/ArgumentsParserTests.cs +++ b/test/GraphZen.Tests/LanguageModel/Internal/Parser/ArgumentsParserTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel; using GraphZen.LanguageModel.Internal; using Superpower; @@ -28,4 +27,4 @@ public void MultipleArguments() }; Assert.Equal(expectedValue, test.Value); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/LanguageModel/Internal/Parser/DirectiveDefinitionParsingTests.cs b/test/GraphZen.Tests/LanguageModel/Internal/Parser/DirectiveDefinitionParsingTests.cs index b4b23f702..af7d80399 100644 --- a/test/GraphZen.Tests/LanguageModel/Internal/Parser/DirectiveDefinitionParsingTests.cs +++ b/test/GraphZen.Tests/LanguageModel/Internal/Parser/DirectiveDefinitionParsingTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel; namespace GraphZen.Tests.LanguageModel.Internal.Parser; @@ -69,4 +68,4 @@ directive @include2(if: Boolean!) on Assert.Equal(expected, result); Assert.Equal(expected, PrintAndParse(result)); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/LanguageModel/Internal/Parser/DirectiveParserTests.cs b/test/GraphZen.Tests/LanguageModel/Internal/Parser/DirectiveParserTests.cs index 06bcbeca5..b11c03032 100644 --- a/test/GraphZen.Tests/LanguageModel/Internal/Parser/DirectiveParserTests.cs +++ b/test/GraphZen.Tests/LanguageModel/Internal/Parser/DirectiveParserTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel; using GraphZen.LanguageModel.Internal; using Superpower; @@ -40,4 +39,4 @@ public void NameWithArguments() }; Assert.Equal(expectedValue, testResult.Value); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/LanguageModel/Internal/Parser/DocumentParserTests.cs b/test/GraphZen.Tests/LanguageModel/Internal/Parser/DocumentParserTests.cs index cd7055904..139b62814 100644 --- a/test/GraphZen.Tests/LanguageModel/Internal/Parser/DocumentParserTests.cs +++ b/test/GraphZen.Tests/LanguageModel/Internal/Parser/DocumentParserTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel; namespace GraphZen.Tests.LanguageModel.Internal.Parser; @@ -44,4 +43,4 @@ public void parse_empty_document_with_comments() ")); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/LanguageModel/Internal/Parser/EnumTypeDefinitionParsingTests.cs b/test/GraphZen.Tests/LanguageModel/Internal/Parser/EnumTypeDefinitionParsingTests.cs index 81e8fa19a..a0cb4066c 100644 --- a/test/GraphZen.Tests/LanguageModel/Internal/Parser/EnumTypeDefinitionParsingTests.cs +++ b/test/GraphZen.Tests/LanguageModel/Internal/Parser/EnumTypeDefinitionParsingTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel; using GraphZen.TypeSystem; using static GraphZen.LanguageModel.SyntaxFactory; @@ -88,4 +87,4 @@ enum DescribedEnum { Assert.Equal(expected.ToSyntaxString(), parsed.ToSyntaxString()); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/LanguageModel/Internal/Parser/EnumTypeExtensionParserTests.cs b/test/GraphZen.Tests/LanguageModel/Internal/Parser/EnumTypeExtensionParserTests.cs index 61114d209..3b3478e9b 100644 --- a/test/GraphZen.Tests/LanguageModel/Internal/Parser/EnumTypeExtensionParserTests.cs +++ b/test/GraphZen.Tests/LanguageModel/Internal/Parser/EnumTypeExtensionParserTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel; namespace GraphZen.Tests.LanguageModel.Internal.Parser; @@ -33,4 +32,4 @@ extend enum Site { Assert.Equal(expected, result); Assert.Equal(expected, PrintAndParse(result)); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/LanguageModel/Internal/Parser/FieldParserTests.cs b/test/GraphZen.Tests/LanguageModel/Internal/Parser/FieldParserTests.cs index c7f8c70d8..9cd346814 100644 --- a/test/GraphZen.Tests/LanguageModel/Internal/Parser/FieldParserTests.cs +++ b/test/GraphZen.Tests/LanguageModel/Internal/Parser/FieldParserTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel; using GraphZen.LanguageModel.Internal; using Superpower; @@ -49,4 +48,4 @@ public void NameOnlyField() var expectedValue = SyntaxFactory.Field(SyntaxFactory.Name("foo")); Assert.True(expectedValue.Equals(test.Value)); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/LanguageModel/Internal/Parser/FragmentDefinitionParsingTests.cs b/test/GraphZen.Tests/LanguageModel/Internal/Parser/FragmentDefinitionParsingTests.cs index e1635c8f1..e4636fb74 100644 --- a/test/GraphZen.Tests/LanguageModel/Internal/Parser/FragmentDefinitionParsingTests.cs +++ b/test/GraphZen.Tests/LanguageModel/Internal/Parser/FragmentDefinitionParsingTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel; namespace GraphZen.Tests.LanguageModel.Internal.Parser; @@ -39,4 +38,4 @@ block string uses \"""""" Assert.Equal(expected, result); Assert.Equal(expected, PrintAndParse(result)); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/LanguageModel/Internal/Parser/FragmentParserTests.cs b/test/GraphZen.Tests/LanguageModel/Internal/Parser/FragmentParserTests.cs index 1a1ee1f88..21d9418bd 100644 --- a/test/GraphZen.Tests/LanguageModel/Internal/Parser/FragmentParserTests.cs +++ b/test/GraphZen.Tests/LanguageModel/Internal/Parser/FragmentParserTests.cs @@ -106,4 +106,4 @@ fragment address on User @directive { }); Assert.Equal(expectedValue, test.Value); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/LanguageModel/Internal/Parser/InputObjectTypeDefinitionParsingTests.cs b/test/GraphZen.Tests/LanguageModel/Internal/Parser/InputObjectTypeDefinitionParsingTests.cs index 220370b49..6ebf4dde2 100644 --- a/test/GraphZen.Tests/LanguageModel/Internal/Parser/InputObjectTypeDefinitionParsingTests.cs +++ b/test/GraphZen.Tests/LanguageModel/Internal/Parser/InputObjectTypeDefinitionParsingTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel; namespace GraphZen.Tests.LanguageModel.Internal.Parser; @@ -61,4 +60,4 @@ public void UndefinedInput() Assert.Equal(expected, result); Assert.Equal(expected, PrintAndParse(result)); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/LanguageModel/Internal/Parser/InputObjectTypeExtensionParsingTests.cs b/test/GraphZen.Tests/LanguageModel/Internal/Parser/InputObjectTypeExtensionParsingTests.cs index 78f43dff2..264cd9803 100644 --- a/test/GraphZen.Tests/LanguageModel/Internal/Parser/InputObjectTypeExtensionParsingTests.cs +++ b/test/GraphZen.Tests/LanguageModel/Internal/Parser/InputObjectTypeExtensionParsingTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel; namespace GraphZen.Tests.LanguageModel.Internal.Parser; @@ -37,4 +36,4 @@ public void ExtendInputTypeWithDirective() Assert.Equal(expected, result); Assert.Equal(expected, PrintAndParse(result)); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/LanguageModel/Internal/Parser/InputTypeParserTests.cs b/test/GraphZen.Tests/LanguageModel/Internal/Parser/InputTypeParserTests.cs index 584f9350e..c4bee5448 100644 --- a/test/GraphZen.Tests/LanguageModel/Internal/Parser/InputTypeParserTests.cs +++ b/test/GraphZen.Tests/LanguageModel/Internal/Parser/InputTypeParserTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel; namespace GraphZen.Tests.LanguageModel.Internal.Parser; @@ -33,4 +32,4 @@ public void ParseNonNullableNamedType() { Assert.Equal(SyntaxFactory.NonNull(SyntaxFactory.NamedType(SyntaxFactory.Name("Foo"))), ParseType("Foo!")); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/LanguageModel/Internal/Parser/InputValueParserTests.cs b/test/GraphZen.Tests/LanguageModel/Internal/Parser/InputValueParserTests.cs index c097cf916..4e207a401 100644 --- a/test/GraphZen.Tests/LanguageModel/Internal/Parser/InputValueParserTests.cs +++ b/test/GraphZen.Tests/LanguageModel/Internal/Parser/InputValueParserTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel; namespace GraphZen.Tests.LanguageModel.Internal.Parser; @@ -86,4 +85,4 @@ public void ParseListValue() Assert.Equal(SyntaxFactory.ListValue(SyntaxFactory.EnumValue(SyntaxFactory.Name("foo")), SyntaxFactory.StringValue("bar")), ParseValue(@"[foo, ""bar""]")); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/LanguageModel/Internal/Parser/InterfaceTypeDefinitionParsingTests.cs b/test/GraphZen.Tests/LanguageModel/Internal/Parser/InterfaceTypeDefinitionParsingTests.cs index d9c597741..3a6cac798 100644 --- a/test/GraphZen.Tests/LanguageModel/Internal/Parser/InterfaceTypeDefinitionParsingTests.cs +++ b/test/GraphZen.Tests/LanguageModel/Internal/Parser/InterfaceTypeDefinitionParsingTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel; namespace GraphZen.Tests.LanguageModel.Internal.Parser; @@ -70,4 +69,4 @@ public void UndefinedInterface() Assert.Equal(expected, result); Assert.Equal(expected, PrintAndParse(result)); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/LanguageModel/Internal/Parser/InterfaceTypeExtensionParsingTests.cs b/test/GraphZen.Tests/LanguageModel/Internal/Parser/InterfaceTypeExtensionParsingTests.cs index 61192dc75..e74a99a06 100644 --- a/test/GraphZen.Tests/LanguageModel/Internal/Parser/InterfaceTypeExtensionParsingTests.cs +++ b/test/GraphZen.Tests/LanguageModel/Internal/Parser/InterfaceTypeExtensionParsingTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel; namespace GraphZen.Tests.LanguageModel.Internal.Parser; @@ -40,4 +39,4 @@ extend interface Bar { Assert.Equal(expected, result); Assert.Equal(expected, PrintAndParse(result)); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/LanguageModel/Internal/Parser/KitchenSinkTests.cs b/test/GraphZen.Tests/LanguageModel/Internal/Parser/KitchenSinkTests.cs index d300165ab..d71004e04 100644 --- a/test/GraphZen.Tests/LanguageModel/Internal/Parser/KitchenSinkTests.cs +++ b/test/GraphZen.Tests/LanguageModel/Internal/Parser/KitchenSinkTests.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.Tests.LanguageModel.Internal.Parser; public class KitchenSinkTests : ParserTests @@ -73,4 +71,4 @@ public void CanRoundTripKitchenSink() var fromPrintedDoc = ParseDocument(doc.ToSyntaxString()); Assert.Equal(doc, fromPrintedDoc); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/LanguageModel/Internal/Parser/ObjectTypeDefinitionParsingTests.cs b/test/GraphZen.Tests/LanguageModel/Internal/Parser/ObjectTypeDefinitionParsingTests.cs index 7ee2dba59..8be848a46 100644 --- a/test/GraphZen.Tests/LanguageModel/Internal/Parser/ObjectTypeDefinitionParsingTests.cs +++ b/test/GraphZen.Tests/LanguageModel/Internal/Parser/ObjectTypeDefinitionParsingTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel; namespace GraphZen.Tests.LanguageModel.Internal.Parser; @@ -140,4 +139,4 @@ public void UndefinedType() Assert.Equal(expected, result); Assert.Equal(expected, PrintAndParse(result)); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/LanguageModel/Internal/Parser/ObjectTypeExtensionParsingTests.cs b/test/GraphZen.Tests/LanguageModel/Internal/Parser/ObjectTypeExtensionParsingTests.cs index 2d86a688b..16fab4979 100644 --- a/test/GraphZen.Tests/LanguageModel/Internal/Parser/ObjectTypeExtensionParsingTests.cs +++ b/test/GraphZen.Tests/LanguageModel/Internal/Parser/ObjectTypeExtensionParsingTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel; namespace GraphZen.Tests.LanguageModel.Internal.Parser; @@ -62,4 +61,4 @@ extend type Foo { Assert.Equal(expected, result); Assert.Equal(expected, PrintAndParse(result)); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/LanguageModel/Internal/Parser/OperationDefinitionParsingTests.cs b/test/GraphZen.Tests/LanguageModel/Internal/Parser/OperationDefinitionParsingTests.cs index 9380eacf2..813b82d67 100644 --- a/test/GraphZen.Tests/LanguageModel/Internal/Parser/OperationDefinitionParsingTests.cs +++ b/test/GraphZen.Tests/LanguageModel/Internal/Parser/OperationDefinitionParsingTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel; namespace GraphZen.Tests.LanguageModel.Internal.Parser; @@ -159,4 +158,4 @@ subscription StoryLikeSubscription($input: StoryLikeSubscribeInput) { Assert.Equal(expected, result); Assert.Equal(expected, PrintAndParse(result)); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/LanguageModel/Internal/Parser/QueryDocumentParserTests.cs b/test/GraphZen.Tests/LanguageModel/Internal/Parser/QueryDocumentParserTests.cs index 212b04d46..32e2ba45f 100644 --- a/test/GraphZen.Tests/LanguageModel/Internal/Parser/QueryDocumentParserTests.cs +++ b/test/GraphZen.Tests/LanguageModel/Internal/Parser/QueryDocumentParserTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel; using GraphZen.LanguageModel.Internal; using Superpower; @@ -60,4 +59,4 @@ public void QueryShorthand() SyntaxFactory.SelectionSet(SyntaxFactory.Field(SyntaxFactory.Name("likeCount"))))))); Assert.Equal(expectedValue, test); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/LanguageModel/Internal/Parser/ScalarTypeDefinitionParsingTests.cs b/test/GraphZen.Tests/LanguageModel/Internal/Parser/ScalarTypeDefinitionParsingTests.cs index cb67c9580..b5474f3db 100644 --- a/test/GraphZen.Tests/LanguageModel/Internal/Parser/ScalarTypeDefinitionParsingTests.cs +++ b/test/GraphZen.Tests/LanguageModel/Internal/Parser/ScalarTypeDefinitionParsingTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel; namespace GraphZen.Tests.LanguageModel.Internal.Parser; @@ -28,4 +27,4 @@ public void SimpleScalar() Assert.Equal(expected, result); Assert.Equal(expected, PrintAndParse(result)); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/LanguageModel/Internal/Parser/ScalarTypeExtensionParsingTests.cs b/test/GraphZen.Tests/LanguageModel/Internal/Parser/ScalarTypeExtensionParsingTests.cs index 02a75dd5a..fb1434acf 100644 --- a/test/GraphZen.Tests/LanguageModel/Internal/Parser/ScalarTypeExtensionParsingTests.cs +++ b/test/GraphZen.Tests/LanguageModel/Internal/Parser/ScalarTypeExtensionParsingTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel; namespace GraphZen.Tests.LanguageModel.Internal.Parser; @@ -18,4 +17,4 @@ public void AnnotatedScalarExtension() Assert.Equal(expected, result); Assert.Equal(expected, PrintAndParse(result)); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/LanguageModel/Internal/Parser/SchemaDefinitionParsingTests.cs b/test/GraphZen.Tests/LanguageModel/Internal/Parser/SchemaDefinitionParsingTests.cs index b0c382d52..28b706358 100644 --- a/test/GraphZen.Tests/LanguageModel/Internal/Parser/SchemaDefinitionParsingTests.cs +++ b/test/GraphZen.Tests/LanguageModel/Internal/Parser/SchemaDefinitionParsingTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel; namespace GraphZen.Tests.LanguageModel.Internal.Parser; @@ -30,4 +29,4 @@ public void SchemaDefinitionNode() Assert.Equal(expected, result); Assert.Equal(expected, PrintAndParse(result)); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/LanguageModel/Internal/Parser/SchemaTypeExtensionParsingTests.cs b/test/GraphZen.Tests/LanguageModel/Internal/Parser/SchemaTypeExtensionParsingTests.cs index 4d0a3bd20..e9487703a 100644 --- a/test/GraphZen.Tests/LanguageModel/Internal/Parser/SchemaTypeExtensionParsingTests.cs +++ b/test/GraphZen.Tests/LanguageModel/Internal/Parser/SchemaTypeExtensionParsingTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel; namespace GraphZen.Tests.LanguageModel.Internal.Parser; @@ -36,4 +35,4 @@ extend schema @onSchema { Assert.Equal(expected, result); Assert.Equal(expected, PrintAndParse(result)); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/LanguageModel/Internal/Parser/SelectionSetParserTests.cs b/test/GraphZen.Tests/LanguageModel/Internal/Parser/SelectionSetParserTests.cs index 899c56f0f..6afeea50f 100644 --- a/test/GraphZen.Tests/LanguageModel/Internal/Parser/SelectionSetParserTests.cs +++ b/test/GraphZen.Tests/LanguageModel/Internal/Parser/SelectionSetParserTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel; using GraphZen.LanguageModel.Internal; using Superpower; @@ -74,4 +73,4 @@ public void SelectionSetWithMultipleFieldsWithCommas() ); Assert.Equal(expectedResultValue, testResult.Value); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/LanguageModel/Internal/Parser/UnionTypeDefnitionParsingTests.cs b/test/GraphZen.Tests/LanguageModel/Internal/Parser/UnionTypeDefnitionParsingTests.cs index 7c64f730b..1f228ca1b 100644 --- a/test/GraphZen.Tests/LanguageModel/Internal/Parser/UnionTypeDefnitionParsingTests.cs +++ b/test/GraphZen.Tests/LanguageModel/Internal/Parser/UnionTypeDefnitionParsingTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel; namespace GraphZen.Tests.LanguageModel.Internal.Parser; @@ -33,4 +32,4 @@ public void UndefinedUnion() Assert.Equal(expected, result); Assert.Equal(expected, PrintAndParse(result)); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/LanguageModel/Internal/Parser/UnionTypeExtensionParsingTests.cs b/test/GraphZen.Tests/LanguageModel/Internal/Parser/UnionTypeExtensionParsingTests.cs index 1b743883f..2243ef522 100644 --- a/test/GraphZen.Tests/LanguageModel/Internal/Parser/UnionTypeExtensionParsingTests.cs +++ b/test/GraphZen.Tests/LanguageModel/Internal/Parser/UnionTypeExtensionParsingTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel; namespace GraphZen.Tests.LanguageModel.Internal.Parser; @@ -30,4 +29,4 @@ public void UnionWithExtendedTypes() Assert.Equal(expected, result); Assert.Equal(expected, PrintAndParse(result)); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/LanguageModel/Internal/Parser/VariableParserTests.cs b/test/GraphZen.Tests/LanguageModel/Internal/Parser/VariableParserTests.cs index 7db773a3e..c44b0c36d 100644 --- a/test/GraphZen.Tests/LanguageModel/Internal/Parser/VariableParserTests.cs +++ b/test/GraphZen.Tests/LanguageModel/Internal/Parser/VariableParserTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel; using GraphZen.LanguageModel.Internal; using Superpower; @@ -26,4 +25,4 @@ public void VariableDefinition() var expectedValue = SyntaxFactory.Variable(SyntaxFactory.Name("name")); Assert.Equal(expectedValue, test.Value); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/LanguageModel/ParserTestBase.cs b/test/GraphZen.Tests/LanguageModel/ParserTestBase.cs index 1f0cc9d76..54a708462 100644 --- a/test/GraphZen.Tests/LanguageModel/ParserTestBase.cs +++ b/test/GraphZen.Tests/LanguageModel/ParserTestBase.cs @@ -35,4 +35,4 @@ protected void AssertSyntaxError(string document, string expectedMessage, locations = locations.Select(l => new { l.line, l.column }) }); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/LanguageModel/ParserTests.cs b/test/GraphZen.Tests/LanguageModel/ParserTests.cs index d1f5e5765..96777b981 100644 --- a/test/GraphZen.Tests/LanguageModel/ParserTests.cs +++ b/test/GraphZen.Tests/LanguageModel/ParserTests.cs @@ -185,4 +185,4 @@ public void SourceIsProvided() var exception = Assert.Throws(() => { ParseDocument(null!); }); Assert.Contains("document", exception.Message); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/LanguageModel/PunctuatorsSpec.cs b/test/GraphZen.Tests/LanguageModel/PunctuatorsSpec.cs index 95490f3fa..538c23bdd 100644 --- a/test/GraphZen.Tests/LanguageModel/PunctuatorsSpec.cs +++ b/test/GraphZen.Tests/LanguageModel/PunctuatorsSpec.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Internal; using Superpower; @@ -31,4 +30,4 @@ internal void Punctuators(string input, TokenKind kind, string stringValue) Assert.Equal(kind, result.Kind); Assert.Equal(stringValue, result.ToStringValue()); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/LanguageModel/VisitorTests.cs b/test/GraphZen.Tests/LanguageModel/VisitorTests.cs index 42e3d039d..6d14278b4 100644 --- a/test/GraphZen.Tests/LanguageModel/VisitorTests.cs +++ b/test/GraphZen.Tests/LanguageModel/VisitorTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel; using GraphZen.LanguageModel.Internal; @@ -351,4 +350,4 @@ public void ValidatesPathArgument() Assert.Equal(expected, visited); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/QueryEngine/AbstractTests.cs b/test/GraphZen.Tests/QueryEngine/AbstractTests.cs index 5c69ff318..2efa820b3 100644 --- a/test/GraphZen.Tests/QueryEngine/AbstractTests.cs +++ b/test/GraphZen.Tests/QueryEngine/AbstractTests.cs @@ -2,7 +2,6 @@ // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. using System.Diagnostics; -using GraphZen.Infrastructure; using GraphZen.TypeSystem; namespace GraphZen.Tests.QueryEngine; @@ -370,4 +369,4 @@ ... on Cat { } }); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/QueryEngine/DirectivesTests.cs b/test/GraphZen.Tests/QueryEngine/DirectivesTests.cs index f730d429f..c5dfab94e 100644 --- a/test/GraphZen.Tests/QueryEngine/DirectivesTests.cs +++ b/test/GraphZen.Tests/QueryEngine/DirectivesTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.QueryEngine; using GraphZen.TypeSystem; @@ -213,4 +212,4 @@ public Task NoIncludeOrSkip() => b @include(if: false) @skip(if: false) } ").ShouldEqual(new { data = new { a = "a" } }); -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/QueryEngine/ExecutorHarness.cs b/test/GraphZen.Tests/QueryEngine/ExecutorHarness.cs index a4e8c7f6d..1d3b11973 100644 --- a/test/GraphZen.Tests/QueryEngine/ExecutorHarness.cs +++ b/test/GraphZen.Tests/QueryEngine/ExecutorHarness.cs @@ -33,4 +33,4 @@ public Task ExecuteAsync(Schema schema, string doc, object? roo ThrowOnError = throwOnError }); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/QueryEngine/ExecutorTests.cs b/test/GraphZen.Tests/QueryEngine/ExecutorTests.cs index 3668d2195..d620c3f54 100644 --- a/test/GraphZen.Tests/QueryEngine/ExecutorTests.cs +++ b/test/GraphZen.Tests/QueryEngine/ExecutorTests.cs @@ -475,4 +475,4 @@ public Task ExecutesIgnoringInvalidNonExecutableDefinitions() [Fact(Skip = "TODO")] public Task UsesACustomFieldResolver() => throw new NotImplementedException(); -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/QueryEngine/MutationsTests.cs b/test/GraphZen.Tests/QueryEngine/MutationsTests.cs index b43d107ab..088a0ace6 100644 --- a/test/GraphZen.Tests/QueryEngine/MutationsTests.cs +++ b/test/GraphZen.Tests/QueryEngine/MutationsTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem; namespace GraphZen.Tests.QueryEngine; @@ -157,4 +156,4 @@ mutation M { } }); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/QueryEngine/UnionInterfaceTests.cs b/test/GraphZen.Tests/QueryEngine/UnionInterfaceTests.cs index 0deaa8ba8..e0d6a6edc 100644 --- a/test/GraphZen.Tests/QueryEngine/UnionInterfaceTests.cs +++ b/test/GraphZen.Tests/QueryEngine/UnionInterfaceTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Internal; using GraphZen.TypeSystem; @@ -386,4 +385,4 @@ await Executor.ExecuteAsync(schema, ast, john, cxt).ShouldEqual(new Assert.Equal(schema, encounteredSchema); Assert.Equal(john, encounteredRootValue); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/QueryEngine/Variables/ArgumentDefaultValuesTests.cs b/test/GraphZen.Tests/QueryEngine/Variables/ArgumentDefaultValuesTests.cs index 94933ebf9..952504fb9 100644 --- a/test/GraphZen.Tests/QueryEngine/Variables/ArgumentDefaultValuesTests.cs +++ b/test/GraphZen.Tests/QueryEngine/Variables/ArgumentDefaultValuesTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem; namespace GraphZen.Tests.QueryEngine.Variables; @@ -82,4 +81,4 @@ public class SchemaBuilderTests : ArgumentDefaultValuesTests { public override Schema Schema => SchemaBuilderSchema; } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/QueryEngine/Variables/CustomEnumValuesTests.cs b/test/GraphZen.Tests/QueryEngine/Variables/CustomEnumValuesTests.cs index 26a57a5f6..19ec1960b 100644 --- a/test/GraphZen.Tests/QueryEngine/Variables/CustomEnumValuesTests.cs +++ b/test/GraphZen.Tests/QueryEngine/Variables/CustomEnumValuesTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem; namespace GraphZen.Tests.QueryEngine.Variables; @@ -53,4 +52,4 @@ public class SchemaBuilderTests : CustomEnumValuesTests { public override Schema Schema => SchemaBuilderSchema; } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/QueryEngine/Variables/ListsAndNullabilityTests.cs b/test/GraphZen.Tests/QueryEngine/Variables/ListsAndNullabilityTests.cs index 7e0a7c362..612ef01f5 100644 --- a/test/GraphZen.Tests/QueryEngine/Variables/ListsAndNullabilityTests.cs +++ b/test/GraphZen.Tests/QueryEngine/Variables/ListsAndNullabilityTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem; namespace GraphZen.Tests.QueryEngine.Variables; @@ -249,4 +248,4 @@ public class SchemaBuilderTests : ListsAndNullabilityTests { public override Schema Schema => SchemaBuilderSchema; } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/QueryEngine/Variables/NonNullableScalarsTests.cs b/test/GraphZen.Tests/QueryEngine/Variables/NonNullableScalarsTests.cs index 8ed8ac7ec..71d597317 100644 --- a/test/GraphZen.Tests/QueryEngine/Variables/NonNullableScalarsTests.cs +++ b/test/GraphZen.Tests/QueryEngine/Variables/NonNullableScalarsTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem; namespace GraphZen.Tests.QueryEngine.Variables; @@ -161,4 +160,4 @@ public class SchemaBuilderTests : NonNullableScalarsTests { public override Schema Schema => SchemaBuilderSchema; } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/QueryEngine/Variables/NullableScalarsTests.cs b/test/GraphZen.Tests/QueryEngine/Variables/NullableScalarsTests.cs index 15760f907..83eeb1524 100644 --- a/test/GraphZen.Tests/QueryEngine/Variables/NullableScalarsTests.cs +++ b/test/GraphZen.Tests/QueryEngine/Variables/NullableScalarsTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem; namespace GraphZen.Tests.QueryEngine.Variables; @@ -103,4 +102,4 @@ public class SchemaBuilderTests : NullableScalarsTests { public override Schema Schema => SchemaBuilderSchema; } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/QueryEngine/Variables/UsingInlineStructs.cs b/test/GraphZen.Tests/QueryEngine/Variables/UsingInlineStructs.cs index 558392494..5e4c8950e 100644 --- a/test/GraphZen.Tests/QueryEngine/Variables/UsingInlineStructs.cs +++ b/test/GraphZen.Tests/QueryEngine/Variables/UsingInlineStructs.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem; namespace GraphZen.Tests.QueryEngine.Variables; @@ -120,4 +119,4 @@ public class SchemaBuilderTest : UsingInlineStructs { public override Schema Schema => SchemaBuilderSchema; } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/QueryEngine/Variables/UsingVariables.cs b/test/GraphZen.Tests/QueryEngine/Variables/UsingVariables.cs index 4dafa0810..4ad6153c8 100644 --- a/test/GraphZen.Tests/QueryEngine/Variables/UsingVariables.cs +++ b/test/GraphZen.Tests/QueryEngine/Variables/UsingVariables.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem; namespace GraphZen.Tests.QueryEngine.Variables; @@ -37,24 +36,24 @@ public Task ErrorsOnDeepNestedErrorsAndWithmanyErrors() => query ($input: TestNestedInputObject) { fieldWithNestedObjectInput(input: $input) }", new + { + input = new { - input = new - { - na = new { a = "foo" } - } - }) + na = new { a = "foo" } + } + }) .ShouldEqual(new { errors = Array(new - { - message = + { + message = "Variable \"$input\" got invalid value `{na: {a: \"foo\"}}`; Field value.nb of required type String! was not provided.", - locations = Array(new - { - line = 2, - column = 20 - }) - }, + locations = Array(new + { + line = 2, + column = 20 + }) + }, new { message = @@ -132,9 +131,9 @@ query q($input: String = ""Default value"") { fieldWithNullableStringInput(input: $input) } ", new - { - input = "Variable value" - }) + { + input = "Variable value" + }) .ShouldEqual(new { data = new @@ -195,9 +194,9 @@ query q($input: String = ""Default value"") { fieldWithNullableStringInput(input: $input) } ", new - { - input = (string?)null - }) + { + input = (string?)null + }) .ShouldEqual(new { data = new @@ -271,4 +270,4 @@ public class SchemaBuilderTests : UsingVariables { public override Schema Schema => SchemaBuilderSchema; } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/QueryEngine/Variables/VariablesTests.cs b/test/GraphZen.Tests/QueryEngine/Variables/VariablesTests.cs index 7829620c7..f3656ec16 100644 --- a/test/GraphZen.Tests/QueryEngine/Variables/VariablesTests.cs +++ b/test/GraphZen.Tests/QueryEngine/Variables/VariablesTests.cs @@ -40,4 +40,4 @@ protected Task ExecuteAsync(string gql, dynamic? variableValues var doc = Parser.ParseDocument(gql); return ExecutionFunctions.ExecuteAsync(Schema, doc, null, null, varValues); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/QueryEngine/Variables/VariablesTestsGraphQLContext.cs b/test/GraphZen.Tests/QueryEngine/Variables/VariablesTestsGraphQLContext.cs index 42478e062..84f372c43 100644 --- a/test/GraphZen.Tests/QueryEngine/Variables/VariablesTestsGraphQLContext.cs +++ b/test/GraphZen.Tests/QueryEngine/Variables/VariablesTestsGraphQLContext.cs @@ -2,7 +2,6 @@ // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. using System.Text.Json; -using GraphZen.Infrastructure; using GraphZen.Internal; using GraphZen.TypeSystem; @@ -65,7 +64,10 @@ protected internal override void OnSchemaCreating(SchemaBuilder schemaBuilder) { f.Argument("input", field.inputArgType, arg => { - if (field.defaultValue != null) arg.DefaultValue(field.defaultValue); + if (field.defaultValue != null) + { + arg.DefaultValue(field.defaultValue); + } }) .Resolve((source, args) => args.ContainsKey("input") @@ -76,4 +78,4 @@ protected internal override void OnSchemaCreating(SchemaBuilder schemaBuilder) schemaBuilder.QueryType("TestType"); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/QueryEngineTestHelpers.cs b/test/GraphZen.Tests/QueryEngineTestHelpers.cs index 83c3fc267..960245c5f 100644 --- a/test/GraphZen.Tests/QueryEngineTestHelpers.cs +++ b/test/GraphZen.Tests/QueryEngineTestHelpers.cs @@ -24,4 +24,4 @@ public static async Task ShouldEqualJsonFile(this Task opt.ShowExpected = false; }); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/StarWars/StarWarsIntrospectionTest.cs b/test/GraphZen.Tests/StarWars/StarWarsIntrospectionTest.cs index 505675934..4ad561be6 100644 --- a/test/GraphZen.Tests/StarWars/StarWarsIntrospectionTest.cs +++ b/test/GraphZen.Tests/StarWars/StarWarsIntrospectionTest.cs @@ -481,4 +481,4 @@ query IntrospectionDroidDescriptionQuery { } } }); -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/StarWars/StarWarsQueryTest.cs b/test/GraphZen.Tests/StarWars/StarWarsQueryTest.cs index 448087a0a..8c86079e2 100644 --- a/test/GraphZen.Tests/StarWars/StarWarsQueryTest.cs +++ b/test/GraphZen.Tests/StarWars/StarWarsQueryTest.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.Tests.StarWars; [NoReorder] @@ -424,4 +422,4 @@ query HeroNameQuery { } }); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/StarWars/StarWarsSchemaAndData.cs b/test/GraphZen.Tests/StarWars/StarWarsSchemaAndData.cs index 7b74e147b..981c237c4 100644 --- a/test/GraphZen.Tests/StarWars/StarWarsSchemaAndData.cs +++ b/test/GraphZen.Tests/StarWars/StarWarsSchemaAndData.cs @@ -2,7 +2,6 @@ // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. using System.ComponentModel; -using GraphZen.Infrastructure; using GraphZen.Tests.QueryEngine; using GraphZen.TypeSystem; @@ -276,13 +275,16 @@ public class Droid : ICharacter [Description("One of the films in the Star Wars Trilogy")] public enum Episode { - [Description("Released in 1977")] [GraphQLName("NEW_HOPE")] + [Description("Released in 1977")] + [GraphQLName("NEW_HOPE")] NewHope = 4, - [Description("Released in 1980")] [GraphQLName("EMPIRE")] + [Description("Released in 1980")] + [GraphQLName("EMPIRE")] Empire = 5, - [Description("Released in 1983")] [GraphQLName("JEDI")] + [Description("Released in 1983")] + [GraphQLName("JEDI")] Jedi = 6 } @@ -307,4 +309,4 @@ public ICharacter Hero( [UsedImplicitly] public Droid? GetDroidData([Description("id of the droid")] string id) => GetDroid(id); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/TypeSystem/IntrospectionTests/IntrospectionTests.cs b/test/GraphZen.Tests/TypeSystem/IntrospectionTests/IntrospectionTests.cs index 011b0d86e..a94c9deb4 100644 --- a/test/GraphZen.Tests/TypeSystem/IntrospectionTests/IntrospectionTests.cs +++ b/test/GraphZen.Tests/TypeSystem/IntrospectionTests/IntrospectionTests.cs @@ -51,4 +51,4 @@ await ExecuteAsync(schema, query, throwOnError: true) } }); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Utilities/AstFromValueTests.cs b/test/GraphZen.Tests/Utilities/AstFromValueTests.cs index 78b80d27c..8bbf95716 100644 --- a/test/GraphZen.Tests/Utilities/AstFromValueTests.cs +++ b/test/GraphZen.Tests/Utilities/AstFromValueTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.Internal; using GraphZen.TypeSystem; using static GraphZen.LanguageModel.SyntaxFactory; @@ -187,4 +186,4 @@ public void ItConvertsInputObjectsWithExplicitNulls() foo = (string?)null }), MyInputObj)); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Utilities/SdlSchemaConfiguratorTests.cs b/test/GraphZen.Tests/Utilities/SdlSchemaConfiguratorTests.cs index 8455e209c..982b42348 100644 --- a/test/GraphZen.Tests/Utilities/SdlSchemaConfiguratorTests.cs +++ b/test/GraphZen.Tests/Utilities/SdlSchemaConfiguratorTests.cs @@ -759,4 +759,4 @@ public void AcceptsLegacyNames() public void RejectsInvalidSDL() { } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/EnumTypesMustBeWellDefinedTests.cs b/test/GraphZen.Tests/Validation/Rules/EnumTypesMustBeWellDefinedTests.cs index ac7609065..d30c8bb10 100644 --- a/test/GraphZen.Tests/Validation/Rules/EnumTypesMustBeWellDefinedTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/EnumTypesMustBeWellDefinedTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; namespace GraphZen.Tests.Validation.Rules; @@ -46,4 +45,4 @@ enum SomeEnum { public void RejectsEnumWithIncorrectlyTypedEnums() { } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/ExecutableDefinitionsTests.cs b/test/GraphZen.Tests/Validation/Rules/ExecutableDefinitionsTests.cs index b27befa51..e8887cbe3 100644 --- a/test/GraphZen.Tests/Validation/Rules/ExecutableDefinitionsTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/ExecutableDefinitionsTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; using GraphZen.QueryEngine.Validation; using GraphZen.QueryEngine.Validation.Rules; @@ -95,4 +94,4 @@ extend schema @directive NonExecutableDefinition("schema", 11, 11) ); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/ExpectedError.cs b/test/GraphZen.Tests/Validation/Rules/ExpectedError.cs index 6f7853335..09471b482 100644 --- a/test/GraphZen.Tests/Validation/Rules/ExpectedError.cs +++ b/test/GraphZen.Tests/Validation/Rules/ExpectedError.cs @@ -2,7 +2,6 @@ // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. using System.Text.Json.Serialization; -using GraphZen.Infrastructure; using GraphZen.LanguageModel; namespace GraphZen.Tests.Validation.Rules; @@ -43,11 +42,20 @@ protected bool Equals(ExpectedError other) => public override bool Equals(object? obj) { - if (ReferenceEquals(null, obj)) return false; + if (obj is null) + { + return false; + } - if (ReferenceEquals(this, obj)) return true; + if (ReferenceEquals(this, obj)) + { + return true; + } - if (obj.GetType() != GetType()) return false; + if (obj.GetType() != GetType()) + { + return false; + } return Equals((ExpectedError)obj); } @@ -62,4 +70,4 @@ public override int GetHashCode() return hashCode; } } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/FieldArgsMustBeProperlynamedTests.cs b/test/GraphZen.Tests/Validation/Rules/FieldArgsMustBeProperlynamedTests.cs index b7c466097..5b87abac5 100644 --- a/test/GraphZen.Tests/Validation/Rules/FieldArgsMustBeProperlynamedTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/FieldArgsMustBeProperlynamedTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; namespace GraphZen.Tests.Validation.Rules; @@ -10,4 +9,4 @@ namespace GraphZen.Tests.Validation.Rules; public class FieldArgsMustBeProperlyNamedTests : ValidationRuleHarness { public override ValidationRule RuleUnderTest { get; } = DocumentValidationRules.FieldArgsMustBeProperlyNamed; -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/FieldArgumentsMustHaveInputTypesTests.cs b/test/GraphZen.Tests/Validation/Rules/FieldArgumentsMustHaveInputTypesTests.cs index a2aa287f4..6503663e5 100644 --- a/test/GraphZen.Tests/Validation/Rules/FieldArgumentsMustHaveInputTypesTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/FieldArgumentsMustHaveInputTypesTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; using static GraphZen.Tests.Validation.Rules.SdlValidationHelpers; @@ -17,9 +16,9 @@ public class FieldArgumentsMustHaveInputTypesTests : ValidationRuleHarness public static IEnumerable GetInputTypeData(string typeName) { return from fieldsType in OutputFieldsTypes - from inputType in InputTypes - from fieldType in typeName.WithModifiers() - select new object[] { fieldsType, inputType, fieldType }; + from inputType in InputTypes + from fieldType in typeName.WithModifiers() + select new object[] { fieldsType, inputType, fieldType }; } [Theory] @@ -38,9 +37,9 @@ public void AcceptsInputTypeAsFieldArgType(string fieldsType, string inputType, public static IEnumerable GetNonInputTypeData(string typeName) { return from fieldsType in OutputFieldsTypes - from inputType in NonInputTypes - from fieldType in typeName.WithModifiers() - select new object[] { fieldsType, inputType, fieldType }; + from inputType in NonInputTypes + from fieldType in typeName.WithModifiers() + select new object[] { fieldsType, inputType, fieldType }; } [Theory] @@ -55,4 +54,4 @@ public void RejectsNonInputTypeAsFieldArgType(string fieldsType, string outputTy }} ", Error($"The type of BadObject.badField(badArg:) must be Input Type but got: {argType}.", (4, 12))); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/FieldsOnCorrectTypeTests.cs b/test/GraphZen.Tests/Validation/Rules/FieldsOnCorrectTypeTests.cs index a5026569c..37816e375 100644 --- a/test/GraphZen.Tests/Validation/Rules/FieldsOnCorrectTypeTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/FieldsOnCorrectTypeTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; using GraphZen.QueryEngine.Validation; using static GraphZen.QueryEngine.Validation.Rules.FieldsOnCorrectType; @@ -297,4 +296,4 @@ public void LimitsLotsOfFieldSuggestions() UndefinedFieldMessage("f", "T", new string[] { }, new[] { "z", "y", "x", "w", "v", "u" })); } } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/FragmentsOnCompositeTypesTests.cs b/test/GraphZen.Tests/Validation/Rules/FragmentsOnCompositeTypesTests.cs index e9da7ca63..067faa27b 100644 --- a/test/GraphZen.Tests/Validation/Rules/FragmentsOnCompositeTypesTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/FragmentsOnCompositeTypesTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; using GraphZen.QueryEngine.Validation; using static GraphZen.QueryEngine.Validation.Rules.FragmentsOnCompositeTypes; @@ -132,4 +131,4 @@ ... on String { ", Error(InlineFragmentOnNonCompositeErrorMessage("String"), (4, 20))); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/InputDocumentNonConflictingVariableInferenceTests.cs b/test/GraphZen.Tests/Validation/Rules/InputDocumentNonConflictingVariableInferenceTests.cs index 2a8af0c2b..9bad04441 100644 --- a/test/GraphZen.Tests/Validation/Rules/InputDocumentNonConflictingVariableInferenceTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/InputDocumentNonConflictingVariableInferenceTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; using GraphZen.QueryEngine.Validation; @@ -12,4 +11,4 @@ public class InputDocumentNonConflictingVariableInferenceTests : ValidationRuleH { public override ValidationRule RuleUnderTest { get; } = QueryValidationRules.InputDocumentNonConflictingVariableInference; -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/InputObjectFieldsMustHaveInputTypesTests.cs b/test/GraphZen.Tests/Validation/Rules/InputObjectFieldsMustHaveInputTypesTests.cs index 8c81a14c3..d9f8105e3 100644 --- a/test/GraphZen.Tests/Validation/Rules/InputObjectFieldsMustHaveInputTypesTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/InputObjectFieldsMustHaveInputTypesTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; using static GraphZen.Tests.Validation.Rules.SdlValidationHelpers; @@ -16,9 +15,9 @@ public class InputObjectFieldsMustHaveInputTypesTests : ValidationRuleHarness public static IEnumerable GetValidInputFieldScenarios() { return from inputType in InputTypes - from fieldsType in InputFieldsTypes - from fieldType in "SomeInputType".WithModifiers() - select new object[] { inputType, fieldsType, fieldType }; + from fieldsType in InputFieldsTypes + from fieldType in "SomeInputType".WithModifiers() + select new object[] { inputType, fieldsType, fieldType }; } [Theory] @@ -37,9 +36,9 @@ public void AcceptsAnInputTypeAsAnInputFieldType(string inputType, string inputF public static IEnumerable GetInvalidInputFieldScenarios() { return from nonInputType in NonInputTypes - from inputFieldsType in InputFieldsTypes - from fieldType in "SomeOutputType".WithModifiers() - select new object[] { nonInputType, inputFieldsType, fieldType }; + from inputFieldsType in InputFieldsTypes + from fieldType in "SomeOutputType".WithModifiers() + select new object[] { nonInputType, inputFieldsType, fieldType }; } [Theory] @@ -55,4 +54,4 @@ public void RejectsNonInputTypeAsAnInputObjectField(string nonInputType, string }} ", Error($"The type of SomeInputObject.foo must be Input Type but got: {fieldType}.", (4, 8))); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/InputObjectsMustHaveFieldsTests.cs b/test/GraphZen.Tests/Validation/Rules/InputObjectsMustHaveFieldsTests.cs index 6638a3a12..bff2af3e7 100644 --- a/test/GraphZen.Tests/Validation/Rules/InputObjectsMustHaveFieldsTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/InputObjectsMustHaveFieldsTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; namespace GraphZen.Tests.Validation.Rules; @@ -64,4 +63,4 @@ input SomeInputObject { ", Error("The type of SomeInputObject.badObject must be Input Type but got: SomeObject.", (12, 14)), Error("The type of SomeInputObject.badUnion must be Input Type but got: SomeUnion.", (13, 13))); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/InterfaceExtensionsShouldBeValidTests.cs b/test/GraphZen.Tests/Validation/Rules/InterfaceExtensionsShouldBeValidTests.cs index 769ba9bde..8ec3a05b9 100644 --- a/test/GraphZen.Tests/Validation/Rules/InterfaceExtensionsShouldBeValidTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/InterfaceExtensionsShouldBeValidTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; namespace GraphZen.Tests.Validation.Rules; @@ -110,4 +109,4 @@ type DummyObject implements NewInterface & MismatchingInterface { "Interface field AnotherInterface.newInterfaceField expects type NewInterface but AnotherObject.newInterfaceField is type MismatchingInterface.", (14, 22), (26, 22))); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/InterfaceFieldsMustHaveOutputTypesTests.cs b/test/GraphZen.Tests/Validation/Rules/InterfaceFieldsMustHaveOutputTypesTests.cs index 6eb0101f5..9391ca637 100644 --- a/test/GraphZen.Tests/Validation/Rules/InterfaceFieldsMustHaveOutputTypesTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/InterfaceFieldsMustHaveOutputTypesTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; using static GraphZen.Tests.Validation.Rules.SdlValidationHelpers; @@ -16,8 +15,8 @@ public class InterfaceFieldsMustHaveOutputTypesTests : ValidationRuleHarness public static IEnumerable GetValidInterfaceFieldTypeScenarios() { return from outputType in OutputTypes - from fieldType in "SomeOutputType".WithModifiers() - select new object[] { outputType, fieldType }; + from fieldType in "SomeOutputType".WithModifiers() + select new object[] { outputType, fieldType }; } [Theory] @@ -36,8 +35,8 @@ interface SomeInterface {{ public static IEnumerable GetInvalidInterfaceFieldTypeScenarios() { return from nonOutputType in NonOutputTypes - from fieldType in "SomeInputType".WithModifiers() - select new object[] { nonOutputType, fieldType }; + from fieldType in "SomeInputType".WithModifiers() + select new object[] { nonOutputType, fieldType }; } [Theory] @@ -95,4 +94,4 @@ interface SomeInterface { } "); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/KnownArgumentNamesTests.cs b/test/GraphZen.Tests/Validation/Rules/KnownArgumentNamesTests.cs index 1e83965f5..e7e345b8c 100644 --- a/test/GraphZen.Tests/Validation/Rules/KnownArgumentNamesTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/KnownArgumentNamesTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; using GraphZen.QueryEngine.Validation; @@ -11,4 +10,4 @@ namespace GraphZen.Tests.Validation.Rules; public class KnownArgumentNamesTests : ValidationRuleHarness { public override ValidationRule RuleUnderTest { get; } = QueryValidationRules.KnownArgumentNames; -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/KnownDirectivesTests.cs b/test/GraphZen.Tests/Validation/Rules/KnownDirectivesTests.cs index 8ee497fbd..226b06307 100644 --- a/test/GraphZen.Tests/Validation/Rules/KnownDirectivesTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/KnownDirectivesTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; using GraphZen.QueryEngine.Validation; using GraphZen.QueryEngine.Validation.Rules; @@ -145,4 +144,4 @@ mutation Bar @onQuery { MisplacedDirective("onQuery", "MUTATION", 8, 24) ); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/KnownFragmentNamesTests.cs b/test/GraphZen.Tests/Validation/Rules/KnownFragmentNamesTests.cs index 01f76375e..bf11c8062 100644 --- a/test/GraphZen.Tests/Validation/Rules/KnownFragmentNamesTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/KnownFragmentNamesTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; using GraphZen.QueryEngine.Validation; using GraphZen.QueryEngine.Validation.Rules; @@ -71,4 +70,4 @@ fragment HumanFields on Human { private static ExpectedError UndefinedFragment(string fragmentName, int line, int column) => Error(KnownFragmentNames.UnknownFragmentMessage(fragmentName), (line, column)); -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/KnownTypeNamesTests.cs b/test/GraphZen.Tests/Validation/Rules/KnownTypeNamesTests.cs index 36878558d..21dfd4f8f 100644 --- a/test/GraphZen.Tests/Validation/Rules/KnownTypeNamesTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/KnownTypeNamesTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; using GraphZen.QueryEngine.Validation; using GraphZen.QueryEngine.Validation.Rules; @@ -83,4 +82,4 @@ query Foo($var: NotInTheSchema) { ", UnknownType("NotInTheSchema", null, 13, 27)); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/LoneAnonymousOperationTests.cs b/test/GraphZen.Tests/Validation/Rules/LoneAnonymousOperationTests.cs index f470f10ca..f536c648b 100644 --- a/test/GraphZen.Tests/Validation/Rules/LoneAnonymousOperationTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/LoneAnonymousOperationTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; using GraphZen.QueryEngine.Validation; using static GraphZen.QueryEngine.Validation.Rules.LoneAnonymousOperation; @@ -101,4 +100,4 @@ subscription Foo { ", Error(AnonymousOperationNotAloneMessage, (3, 11))); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/LoneSchemaDefinitionTests.cs b/test/GraphZen.Tests/Validation/Rules/LoneSchemaDefinitionTests.cs index abfd96f0b..7e3cd18e4 100644 --- a/test/GraphZen.Tests/Validation/Rules/LoneSchemaDefinitionTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/LoneSchemaDefinitionTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; namespace GraphZen.Tests.Validation.Rules; @@ -10,4 +9,4 @@ namespace GraphZen.Tests.Validation.Rules; public class LoneSchemaDefinitionTests : ValidationRuleHarness { public override ValidationRule RuleUnderTest { get; } = DocumentValidationRules.LoneSchemaDefinition; -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/NoFragmentCyclesTests.cs b/test/GraphZen.Tests/Validation/Rules/NoFragmentCyclesTests.cs index 6abe7a300..f70b618ef 100644 --- a/test/GraphZen.Tests/Validation/Rules/NoFragmentCyclesTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/NoFragmentCyclesTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; using GraphZen.QueryEngine.Validation; @@ -11,4 +10,4 @@ namespace GraphZen.Tests.Validation.Rules; public class NoFragmentCyclesTests : ValidationRuleHarness { public override ValidationRule RuleUnderTest { get; } = QueryValidationRules.NoFragmentCycles; -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/NoUndefinedVariablesTests.cs b/test/GraphZen.Tests/Validation/Rules/NoUndefinedVariablesTests.cs index 3c35e57e7..7ebf13929 100644 --- a/test/GraphZen.Tests/Validation/Rules/NoUndefinedVariablesTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/NoUndefinedVariablesTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; using GraphZen.QueryEngine.Validation; @@ -11,4 +10,4 @@ namespace GraphZen.Tests.Validation.Rules; public class NoUndefinedVariablesTests : ValidationRuleHarness { public override ValidationRule RuleUnderTest { get; } = QueryValidationRules.NoUndefinedVariables; -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/NoUnusedFragmentsTests.cs b/test/GraphZen.Tests/Validation/Rules/NoUnusedFragmentsTests.cs index 35d25a677..2f59292da 100644 --- a/test/GraphZen.Tests/Validation/Rules/NoUnusedFragmentsTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/NoUnusedFragmentsTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; using GraphZen.QueryEngine.Validation; @@ -11,4 +10,4 @@ namespace GraphZen.Tests.Validation.Rules; public class NoUnusedFragmentsTests : ValidationRuleHarness { public override ValidationRule RuleUnderTest { get; } = QueryValidationRules.NoUnusedFragments; -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/NoUnusedVariablesTests.cs b/test/GraphZen.Tests/Validation/Rules/NoUnusedVariablesTests.cs index e69ae4cb2..77fdd7585 100644 --- a/test/GraphZen.Tests/Validation/Rules/NoUnusedVariablesTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/NoUnusedVariablesTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; using GraphZen.QueryEngine.Validation; @@ -11,4 +10,4 @@ namespace GraphZen.Tests.Validation.Rules; public class NoUnusedVariablesTests : ValidationRuleHarness { public override ValidationRule RuleUnderTest { get; } = QueryValidationRules.NoUnusedVariables; -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/ObjectFieldsMustHaveOutputTypesTests.cs b/test/GraphZen.Tests/Validation/Rules/ObjectFieldsMustHaveOutputTypesTests.cs index 0e6112e61..1b0ad231e 100644 --- a/test/GraphZen.Tests/Validation/Rules/ObjectFieldsMustHaveOutputTypesTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/ObjectFieldsMustHaveOutputTypesTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; using static GraphZen.Tests.Validation.Rules.SdlValidationHelpers; @@ -15,8 +14,8 @@ public class ObjectFieldsMustHaveOutputTypesTests : ValidationRuleHarness public static IEnumerable GetValidFieldScenarios() { return from outputType in OutputTypes - from fieldType in "SomeOutputType".WithModifiers() - select new[] { outputType, fieldType }; + from fieldType in "SomeOutputType".WithModifiers() + select new[] { outputType, fieldType }; } [Theory] @@ -35,8 +34,8 @@ type SomeObject {{ public static IEnumerable GetInvalidFieldScenarios() { return from nonOutputType in NonOutputTypes - from fieldType in "SomeInputType".WithModifiers() - select new[] { nonOutputType, fieldType }; + from fieldType in "SomeInputType".WithModifiers() + select new[] { nonOutputType, fieldType }; } @@ -54,4 +53,4 @@ type Query {{ Error($"The type of Query.field must be Output Type but got: {fieldType}.", (3, 11)) ); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/ObjectsCanOnlyImplementUniqueInterfacesTests.cs b/test/GraphZen.Tests/Validation/Rules/ObjectsCanOnlyImplementUniqueInterfacesTests.cs index c2c049726..66f761b77 100644 --- a/test/GraphZen.Tests/Validation/Rules/ObjectsCanOnlyImplementUniqueInterfacesTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/ObjectsCanOnlyImplementUniqueInterfacesTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; namespace GraphZen.Tests.Validation.Rules; @@ -69,4 +68,4 @@ type AnotherObject implements AnotherInterface { extend type AnotherObject implements AnotherInterface ", Error("Type AnotherObject can only implement AnotherInterface once.", (9, 31), (13, 38))); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/ObjectsMustAdhereToInterfaceTheyImplementTests.cs b/test/GraphZen.Tests/Validation/Rules/ObjectsMustAdhereToInterfaceTheyImplementTests.cs index 436cccaff..3a31560da 100644 --- a/test/GraphZen.Tests/Validation/Rules/ObjectsMustAdhereToInterfaceTheyImplementTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/ObjectsMustAdhereToInterfaceTheyImplementTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; namespace GraphZen.Tests.Validation.Rules; @@ -357,4 +356,4 @@ type AnotherObject implements AnotherInterface { "Interface field AnotherInterface.field expects type String! but AnotherObject.field is type String.", (10, 10), (6, 10))); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/ObjectsMustHaveFieldsTests.cs b/test/GraphZen.Tests/Validation/Rules/ObjectsMustHaveFieldsTests.cs index dcd34d650..4a7116a11 100644 --- a/test/GraphZen.Tests/Validation/Rules/ObjectsMustHaveFieldsTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/ObjectsMustHaveFieldsTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; namespace GraphZen.Tests.Validation.Rules; @@ -51,4 +50,4 @@ public void AcceptsAnObjectWithExplicitlyAllowedLegacyNamedFields() public void ThrowsWithBadValueForExplicitlyAllowedLegacyNames() { } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/OverlappingFieldsCanBeMergedTests.cs b/test/GraphZen.Tests/Validation/Rules/OverlappingFieldsCanBeMergedTests.cs index 5c53ab5f8..481a9b660 100644 --- a/test/GraphZen.Tests/Validation/Rules/OverlappingFieldsCanBeMergedTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/OverlappingFieldsCanBeMergedTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; using GraphZen.QueryEngine.Validation; @@ -11,4 +10,4 @@ namespace GraphZen.Tests.Validation.Rules; public class OverlappingFieldsCanBeMergedTests : ValidationRuleHarness { public override ValidationRule RuleUnderTest { get; } = QueryValidationRules.OverlappingFieldsCanBeMerged; -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/PossibleFragmentSpreadsTests.cs b/test/GraphZen.Tests/Validation/Rules/PossibleFragmentSpreadsTests.cs index 380a06fb7..c71b88819 100644 --- a/test/GraphZen.Tests/Validation/Rules/PossibleFragmentSpreadsTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/PossibleFragmentSpreadsTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; using GraphZen.QueryEngine.Validation; @@ -11,4 +10,4 @@ namespace GraphZen.Tests.Validation.Rules; public class PossibleFragmentSpreadsTests : ValidationRuleHarness { public override ValidationRule RuleUnderTest { get; } = QueryValidationRules.PossibleFragmentSpreads; -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/ProvidedRequiredArgumentsTests.cs b/test/GraphZen.Tests/Validation/Rules/ProvidedRequiredArgumentsTests.cs index 1f0448322..81644f299 100644 --- a/test/GraphZen.Tests/Validation/Rules/ProvidedRequiredArgumentsTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/ProvidedRequiredArgumentsTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; using GraphZen.QueryEngine.Validation; @@ -11,4 +10,4 @@ namespace GraphZen.Tests.Validation.Rules; public class ProvidedRequiredArgumentsTests : ValidationRuleHarness { public override ValidationRule RuleUnderTest { get; } = QueryValidationRules.ProvidedRequiredArguments; -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/ScalarLeafsTests.cs b/test/GraphZen.Tests/Validation/Rules/ScalarLeafsTests.cs index 2b8567faf..2198529e6 100644 --- a/test/GraphZen.Tests/Validation/Rules/ScalarLeafsTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/ScalarLeafsTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; using GraphZen.QueryEngine.Validation; @@ -11,4 +10,4 @@ namespace GraphZen.Tests.Validation.Rules; public class ScalarLeafsTests : ValidationRuleHarness { public override ValidationRule RuleUnderTest { get; } = QueryValidationRules.ScalarLeafs; -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/SchemaMustHaveRootObjectTypesTests.cs b/test/GraphZen.Tests/Validation/Rules/SchemaMustHaveRootObjectTypesTests.cs index e08bb41ef..f8cc13392 100644 --- a/test/GraphZen.Tests/Validation/Rules/SchemaMustHaveRootObjectTypesTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/SchemaMustHaveRootObjectTypesTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; namespace GraphZen.Tests.Validation.Rules; @@ -193,4 +192,4 @@ input SomeInputObject { public void RejectsASchemaExtendedWithInvalidRootTypes() { } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/SdlValidationHelpers.cs b/test/GraphZen.Tests/Validation/Rules/SdlValidationHelpers.cs index cc6706086..ddee19d46 100644 --- a/test/GraphZen.Tests/Validation/Rules/SdlValidationHelpers.cs +++ b/test/GraphZen.Tests/Validation/Rules/SdlValidationHelpers.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.Tests.Validation.Rules; public static class SdlValidationHelpers @@ -24,4 +22,4 @@ public static IEnumerable WithModifiers(this string name) yield return $"[{name}]!"; yield return $"[{name}!]!"; } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/SingleFieldSubscriptionsTests.cs b/test/GraphZen.Tests/Validation/Rules/SingleFieldSubscriptionsTests.cs index a9dff2fd9..1cc750cbd 100644 --- a/test/GraphZen.Tests/Validation/Rules/SingleFieldSubscriptionsTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/SingleFieldSubscriptionsTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; using GraphZen.QueryEngine.Validation; @@ -11,4 +10,4 @@ namespace GraphZen.Tests.Validation.Rules; public class SingleFieldSubscriptionsTests : ValidationRuleHarness { public override ValidationRule RuleUnderTest { get; } = QueryValidationRules.SingleFieldSubscriptions; -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/UnionTypesMustBeValidTests.cs b/test/GraphZen.Tests/Validation/Rules/UnionTypesMustBeValidTests.cs index 7c0ba42a3..742a2553b 100644 --- a/test/GraphZen.Tests/Validation/Rules/UnionTypesMustBeValidTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/UnionTypesMustBeValidTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; namespace GraphZen.Tests.Validation.Rules; @@ -102,4 +101,4 @@ type TypeB { Error("Union type BadUnion can only include Object types, it cannot include Int.", (18, 25)) ); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/UniqueArgumentNamesTests.cs b/test/GraphZen.Tests/Validation/Rules/UniqueArgumentNamesTests.cs index 27087d08f..f5c895bff 100644 --- a/test/GraphZen.Tests/Validation/Rules/UniqueArgumentNamesTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/UniqueArgumentNamesTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; using GraphZen.QueryEngine.Validation; @@ -11,4 +10,4 @@ namespace GraphZen.Tests.Validation.Rules; public class UniqueArgumentNamesTests : ValidationRuleHarness { public override ValidationRule RuleUnderTest { get; } = QueryValidationRules.UniqueArgumentNames; -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/UniqueDirectivesPerLocationTests.cs b/test/GraphZen.Tests/Validation/Rules/UniqueDirectivesPerLocationTests.cs index f5412082d..8373890f3 100644 --- a/test/GraphZen.Tests/Validation/Rules/UniqueDirectivesPerLocationTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/UniqueDirectivesPerLocationTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; using GraphZen.QueryEngine.Validation; @@ -11,4 +10,4 @@ namespace GraphZen.Tests.Validation.Rules; public class UniqueDirectivesPerLocationTests : ValidationRuleHarness { public override ValidationRule RuleUnderTest { get; } = QueryValidationRules.UniqueDirectivesPerLocation; -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/UniqueFragmentNamesTests.cs b/test/GraphZen.Tests/Validation/Rules/UniqueFragmentNamesTests.cs index ce503d578..4634476e8 100644 --- a/test/GraphZen.Tests/Validation/Rules/UniqueFragmentNamesTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/UniqueFragmentNamesTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; using GraphZen.QueryEngine.Validation; @@ -11,4 +10,4 @@ namespace GraphZen.Tests.Validation.Rules; public class UniqueFragmentNamesTests : ValidationRuleHarness { public override ValidationRule RuleUnderTest { get; } = QueryValidationRules.UniqueFragmentNames; -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/UniqueInputFieldNamesTests.cs b/test/GraphZen.Tests/Validation/Rules/UniqueInputFieldNamesTests.cs index 98d6b0b51..dc819987b 100644 --- a/test/GraphZen.Tests/Validation/Rules/UniqueInputFieldNamesTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/UniqueInputFieldNamesTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; using GraphZen.QueryEngine.Validation; @@ -11,4 +10,4 @@ namespace GraphZen.Tests.Validation.Rules; public class UniqueInputFieldNamesTests : ValidationRuleHarness { public override ValidationRule RuleUnderTest { get; } = QueryValidationRules.UniqueInputFieldNames; -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/UniqueOperationNamesTests.cs b/test/GraphZen.Tests/Validation/Rules/UniqueOperationNamesTests.cs index 3e665d766..26168f958 100644 --- a/test/GraphZen.Tests/Validation/Rules/UniqueOperationNamesTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/UniqueOperationNamesTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; using GraphZen.QueryEngine.Validation; using GraphZen.QueryEngine.Validation.Rules; @@ -131,4 +130,4 @@ subscription Foo { ", DuplicateOp("Foo", (3, 17), (6, 24))); } -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/UniqueVariableNamesTests.cs b/test/GraphZen.Tests/Validation/Rules/UniqueVariableNamesTests.cs index 3dd632e87..8b0869be8 100644 --- a/test/GraphZen.Tests/Validation/Rules/UniqueVariableNamesTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/UniqueVariableNamesTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; using GraphZen.QueryEngine.Validation; @@ -11,4 +10,4 @@ namespace GraphZen.Tests.Validation.Rules; public class UniqueVariableNamesTests : ValidationRuleHarness { public override ValidationRule RuleUnderTest { get; } = QueryValidationRules.UniqueVariableNames; -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/ValidationRuleHarness.cs b/test/GraphZen.Tests/Validation/Rules/ValidationRuleHarness.cs index 3244fa859..7e4ccdffe 100644 --- a/test/GraphZen.Tests/Validation/Rules/ValidationRuleHarness.cs +++ b/test/GraphZen.Tests/Validation/Rules/ValidationRuleHarness.cs @@ -206,4 +206,4 @@ protected void QueryShouldFail(string query, ExpectedError error, params Expecte protected void SdlShouldFail(string sdl, ExpectedError error, params ExpectedError[] errors) => ExpectInvalidSdl(RuleUnderTest, sdl.Dedent(), new[] { error }.Concat(errors).ToArray()); -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/ValuesOfCorrectTypeTests.cs b/test/GraphZen.Tests/Validation/Rules/ValuesOfCorrectTypeTests.cs index 1d0cb7f08..b3a4c6552 100644 --- a/test/GraphZen.Tests/Validation/Rules/ValuesOfCorrectTypeTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/ValuesOfCorrectTypeTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; using GraphZen.QueryEngine.Validation; @@ -11,4 +10,4 @@ namespace GraphZen.Tests.Validation.Rules; public class ValuesOfCorrectTypeTests : ValidationRuleHarness { public override ValidationRule RuleUnderTest { get; } = QueryValidationRules.ValuesOfCorrectType; -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/VariablesAreInputTypesTests.cs b/test/GraphZen.Tests/Validation/Rules/VariablesAreInputTypesTests.cs index d00fc5645..d50fecef6 100644 --- a/test/GraphZen.Tests/Validation/Rules/VariablesAreInputTypesTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/VariablesAreInputTypesTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; using GraphZen.QueryEngine.Validation; @@ -11,4 +10,4 @@ namespace GraphZen.Tests.Validation.Rules; public class VariablesAreInputTypesTests : ValidationRuleHarness { public override ValidationRule RuleUnderTest { get; } = QueryValidationRules.VariablesAreInputTypes; -} \ No newline at end of file +} diff --git a/test/GraphZen.Tests/Validation/Rules/VariablesInAllowedPositionTests.cs b/test/GraphZen.Tests/Validation/Rules/VariablesInAllowedPositionTests.cs index 5f07d303e..739d1bdf4 100644 --- a/test/GraphZen.Tests/Validation/Rules/VariablesInAllowedPositionTests.cs +++ b/test/GraphZen.Tests/Validation/Rules/VariablesInAllowedPositionTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Validation; using GraphZen.QueryEngine.Validation; @@ -11,4 +10,4 @@ namespace GraphZen.Tests.Validation.Rules; public class VariablesInAllowedPositionTests : ValidationRuleHarness { public override ValidationRule RuleUnderTest { get; } = QueryValidationRules.VariablesInAllowedPosition; -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.FunctionalTests/Directives/DirectiveCreationTests.cs b/test/GraphZen.TypeSystem.FunctionalTests/Directives/DirectiveCreationTests.cs index 7b985c09d..24adc6056 100644 --- a/test/GraphZen.TypeSystem.FunctionalTests/Directives/DirectiveCreationTests.cs +++ b/test/GraphZen.TypeSystem.FunctionalTests/Directives/DirectiveCreationTests.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.TypeSystem.FunctionalTests.Directives; public class DirectiveCreationTests @@ -28,4 +26,4 @@ public void it_cannot_create_directive_from_sdl_without_directive_locations() Action act = () => Schema.Create(@"directive @foo on FIELD"); Assert.Throws(act); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.FunctionalTests/Objects/DirectiveAnnotations/ObjectDirectiveAnnotationFunctionalTests.cs b/test/GraphZen.TypeSystem.FunctionalTests/Objects/DirectiveAnnotations/ObjectDirectiveAnnotationFunctionalTests.cs index c0835c000..42913de2f 100644 --- a/test/GraphZen.TypeSystem.FunctionalTests/Objects/DirectiveAnnotations/ObjectDirectiveAnnotationFunctionalTests.cs +++ b/test/GraphZen.TypeSystem.FunctionalTests/Objects/DirectiveAnnotations/ObjectDirectiveAnnotationFunctionalTests.cs @@ -53,4 +53,4 @@ public void it_should_throw_on_adding_with_invalid_location_without_defined_loca ex.Message); }); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.FunctionalTests/Objects/Fields/ObjectFieldBuilderTypeFunctionalTests.cs b/test/GraphZen.TypeSystem.FunctionalTests/Objects/Fields/ObjectFieldBuilderTypeFunctionalTests.cs index aa7bdc9b2..edbd780b0 100644 --- a/test/GraphZen.TypeSystem.FunctionalTests/Objects/Fields/ObjectFieldBuilderTypeFunctionalTests.cs +++ b/test/GraphZen.TypeSystem.FunctionalTests/Objects/Fields/ObjectFieldBuilderTypeFunctionalTests.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.TypeSystem.FunctionalTests.Objects.Fields; public class ObjectFieldBuilderTypeFunctionalTests @@ -19,4 +17,4 @@ public void invalid_field_type_should_throw_helpful_exception() ex.Message); }); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.FunctionalTests/Objects/ObjectTypeCreationTests.cs b/test/GraphZen.TypeSystem.FunctionalTests/Objects/ObjectTypeCreationTests.cs index 8244b4b0b..d6729e2de 100644 --- a/test/GraphZen.TypeSystem.FunctionalTests/Objects/ObjectTypeCreationTests.cs +++ b/test/GraphZen.TypeSystem.FunctionalTests/Objects/ObjectTypeCreationTests.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.TypeSystem.FunctionalTests.Objects; [NoReorder] @@ -67,4 +65,4 @@ public void it_can_create_object_type_from_sdl() Assert.IsType(foo); Assert.Equal("Foo", foo.Name); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/ClrTypeUtils.cs b/test/GraphZen.TypeSystem.Tests/ClrTypeUtils.cs index 40316cf4c..be72d243b 100644 --- a/test/GraphZen.TypeSystem.Tests/ClrTypeUtils.cs +++ b/test/GraphZen.TypeSystem.Tests/ClrTypeUtils.cs @@ -32,14 +32,14 @@ public static IEnumerable GetTypesImplementingOpenGenericType(Type openGen { var assembly = openGenericType.Assembly; return from x in assembly.GetTypes() - from z in x.GetInterfaces() - let y = x.BaseType - where - (y != null && y.IsGenericType && - openGenericType.IsAssignableFrom(y.GetGenericTypeDefinition())) || - (z.IsGenericType && - openGenericType.IsAssignableFrom(z.GetGenericTypeDefinition())) - where !isAbstract.HasValue || x.IsAbstract == isAbstract.Value - select x; + from z in x.GetInterfaces() + let y = x.BaseType + where + (y != null && y.IsGenericType && + openGenericType.IsAssignableFrom(y.GetGenericTypeDefinition())) || + (z.IsGenericType && + openGenericType.IsAssignableFrom(z.GetGenericTypeDefinition())) + where !isAbstract.HasValue || x.IsAbstract == isAbstract.Value + select x; } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/CollectionConventionConfigurationTests.cs b/test/GraphZen.TypeSystem.Tests/Configuration/CollectionConventionConfigurationTests.cs index 9ad8be438..63d6be643 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/CollectionConventionConfigurationTests.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/CollectionConventionConfigurationTests.cs @@ -350,4 +350,4 @@ public void when_parent_configured_explicitly_then_clr_member_set_items_added_by Assert.NotNull(collection[ctx.ItemNamedByDataAnnotation!]); }); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/CollectionExplicitConfigurationTests.cs b/test/GraphZen.TypeSystem.Tests/Configuration/CollectionExplicitConfigurationTests.cs index 11e2e1813..c03a22b25 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/CollectionExplicitConfigurationTests.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/CollectionExplicitConfigurationTests.cs @@ -240,4 +240,4 @@ public void item_added_explicitly_then_renamed_explicitly(ICollectionExplicitCon Assert.Equal(changedItemName, collection[changedItemName].Name); }); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/ConfigurationFixtures.cs b/test/GraphZen.TypeSystem.Tests/Configuration/ConfigurationFixtures.cs index 28bd24d8d..036f9895b 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/ConfigurationFixtures.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/ConfigurationFixtures.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Directives; using GraphZen.TypeSystem.Tests.Configuration.Enums; using GraphZen.TypeSystem.Tests.Configuration.Enums.Description; @@ -211,4 +210,4 @@ public static IEnumerable GetAll() where T : IConfigurationFixture => new EnumValue_Explicit_Description(), new EnumValue_ViaClrEnumValue_Description() }.OfType(); -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/CollectionConventionContext.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/CollectionConventionContext.cs index 70625ec79..a6fda0d0b 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/CollectionConventionContext.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/CollectionConventionContext.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Internal; namespace GraphZen.TypeSystem.Tests.Configuration.Infrastructure; @@ -15,4 +14,4 @@ public class CollectionConventionContext public string? ItemNamedByDataAnnotation { get; set; } public ConfigurationSource? DefaultItemConfigurationSource { get; set; } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/ConfigurationFixture.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/ConfigurationFixture.cs index 1bfb8594e..ece0f7cc5 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/ConfigurationFixture.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/ConfigurationFixture.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.TypeSystem.Tests.Configuration.Infrastructure; public abstract class ConfigurationFixture< @@ -48,4 +46,4 @@ public abstract TParentMemberDefinition GetParent(SchemaBuilder sb, public abstract TParentMember GetParent(Schema schema, string parentName); -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/ConfigurationFixturesTests.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/ConfigurationFixturesTests.cs index d801cfdf7..af73608e2 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/ConfigurationFixturesTests.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/ConfigurationFixturesTests.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.TypeSystem.Tests.Configuration.Infrastructure; public class ConfigurationFixturesTests @@ -43,7 +41,9 @@ public void ensure_all_known_fixtures_are_included() .ToArray(); if (missingTypeNames.Any()) + { throw new Exception( $"The following types need to be added to {nameof(ConfigurationFixtures)}.{nameof(ConfigurationFixtures.GetAll)}:\n\n{string.Join(Environment.NewLine, missingTypeNames)} \n\n"); + } } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/DirectiveAnnotationsConfigurationFixture.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/DirectiveAnnotationsConfigurationFixture.cs index c0fc80272..b247b202e 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/DirectiveAnnotationsConfigurationFixture.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/DirectiveAnnotationsConfigurationFixture.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Taxonomy; namespace GraphZen.TypeSystem.Tests.Configuration.Infrastructure; @@ -12,4 +11,4 @@ public abstract class TMemberDefinition, TMember> where TMemberDefinition : AnnotatableMemberDefinition where TMember : AnnotatableMember { -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/ICollectionConfigurationFixture.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/ICollectionConfigurationFixture.cs index ee890a532..eab76d63c 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/ICollectionConfigurationFixture.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/ICollectionConfigurationFixture.cs @@ -22,4 +22,4 @@ void RenameItem(SchemaBuilder sb, string parentName, string itemName, ConfigurationSource? FindIgnoredItemConfigurationSource(SchemaBuilder sb, string parentName, string itemName); -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/ICollectionConventionConfigurationFixture.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/ICollectionConventionConfigurationFixture.cs index 884fb5d67..df219ff38 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/ICollectionConventionConfigurationFixture.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/ICollectionConventionConfigurationFixture.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.TypeSystem.Tests.Configuration.Infrastructure; public interface ICollectionConventionConfigurationFixture : ICollectionConfigurationFixture @@ -13,4 +11,4 @@ public interface ICollectionConventionConfigurationFixture : ICollectionConfigur void ConfigureClrContext(SchemaBuilder sb, string parentName); //void AddItemNamedByDataAnnotationViaClrType(SchemaBuilder sb); -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/ICollectionExplicitConfigurationFixture.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/ICollectionExplicitConfigurationFixture.cs index 50b6fb392..81fed92ab 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/ICollectionExplicitConfigurationFixture.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/ICollectionExplicitConfigurationFixture.cs @@ -1,10 +1,8 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.TypeSystem.Tests.Configuration.Infrastructure; public interface ICollectionExplicitConfigurationFixture : ICollectionConfigurationFixture { -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/IConfigurationFixture.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/IConfigurationFixture.cs index 6b1ed2202..c238714b3 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/IConfigurationFixture.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/IConfigurationFixture.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.TypeSystem.Tests.Configuration.Infrastructure; public interface IConfigurationFixture @@ -13,4 +11,4 @@ public interface IConfigurationFixture void ConfigureParentExplicitly(SchemaBuilder sb, string parentName); Member GetParent(Schema schema, string parentName); MemberDefinition GetParent(SchemaBuilder sb, string parentName); -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/ILeafConfigurationFixture.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/ILeafConfigurationFixture.cs index 469b35c55..5c785e280 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/ILeafConfigurationFixture.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/ILeafConfigurationFixture.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Internal; namespace GraphZen.TypeSystem.Tests.Configuration.Infrastructure; @@ -15,4 +14,4 @@ public interface ILeafConfigurationFixture : IConfigurationFixture bool TryGetValue(Member parent, [NotNullWhen(true)] out object? value); void ConfigureExplicitly(SchemaBuilder sb, string parentName, object value); void RemoveValue(SchemaBuilder sb, string parentName); -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/ILeafConventionConfigurationFixture.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/ILeafConventionConfigurationFixture.cs index e4adf7802..d00c7bd49 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/ILeafConventionConfigurationFixture.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/ILeafConventionConfigurationFixture.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.TypeSystem.Tests.Configuration.Infrastructure; public interface ILeafConventionConfigurationFixture : ILeafConfigurationFixture @@ -13,4 +11,4 @@ public interface ILeafConventionConfigurationFixture : ILeafConfigurationFixture void ConfigureContextConventionally(SchemaBuilder sb); void ConfigureClrContext(SchemaBuilder sb, string parentName); -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/ILeafExplicitConfigurationFixture.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/ILeafExplicitConfigurationFixture.cs index e488511a2..3d225c70e 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/ILeafExplicitConfigurationFixture.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/ILeafExplicitConfigurationFixture.cs @@ -1,10 +1,8 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.TypeSystem.Tests.Configuration.Infrastructure; public interface ILeafExplicitConfigurationFixture : ILeafConfigurationFixture { -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/LeafConventionContext.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/LeafConventionContext.cs index cdeceec13..883bff75d 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/LeafConventionContext.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/LeafConventionContext.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.TypeSystem.Tests.Configuration.Infrastructure; public class LeafConventionContext @@ -10,4 +8,4 @@ public class LeafConventionContext public string? ParentName { get; set; } public object? DataAnnotationValue { get; set; } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/NamedCollectionConfigurationFixture.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/NamedCollectionConfigurationFixture.cs index 7cd7c3e90..1b8b5e51a 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/NamedCollectionConfigurationFixture.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Infrastructure/NamedCollectionConfigurationFixture.cs @@ -81,4 +81,4 @@ public abstract NamedCollection GetCollection( // public T this[string key] => throw new NotImplementedException(); //} -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/LeafConventionConfigurationTests.cs b/test/GraphZen.TypeSystem.Tests/Configuration/LeafConventionConfigurationTests.cs index 36848e1c0..ebe2f0af1 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/LeafConventionConfigurationTests.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/LeafConventionConfigurationTests.cs @@ -198,4 +198,4 @@ public virtual void define_by_data_annotation_overridden_by_explicit_configurati //val.Should().Be(ValueA); } */ -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/LeafElementConfigurationFixture.cs b/test/GraphZen.TypeSystem.Tests/Configuration/LeafElementConfigurationFixture.cs index 8fa4b2492..ee70416b7 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/LeafElementConfigurationFixture.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/LeafElementConfigurationFixture.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Internal; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; @@ -116,4 +115,4 @@ public void ConfigureExplicitly(SchemaBuilder sb, string parentName, object valu public abstract bool TryGetValue(TParentMember parent, out TElement value); public abstract bool TryGetValue(TParentMemberDefinition parent, out TElement value); -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/LeafExplicitConfigurationTests.cs b/test/GraphZen.TypeSystem.Tests/Configuration/LeafExplicitConfigurationTests.cs index 2592f0326..2258a3ba4 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/LeafExplicitConfigurationTests.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/LeafExplicitConfigurationTests.cs @@ -124,4 +124,4 @@ public void initial_value_then_reconfigured_explicitly_then_removed(ILeafExplici Assert.False(fixture.TryGetValue(parent, out _)); }); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Directives/Schema_Directives.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Directives/Schema_Directives.cs index 91b3dd2b8..50f9d200b 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Directives/Schema_Directives.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Directives/Schema_Directives.cs @@ -51,4 +51,4 @@ public override NamedCollection GetCollection(Schema parent) => public override ConfigurationSource? FindIgnoredItemConfigurationSource(SchemaDefinition parent, string name) => parent.FindIgnoredDirectiveConfigurationSource(name); -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Directives/Schema_Directives_Explicit.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Directives/Schema_Directives_Explicit.cs index 3fec35aab..90f03cb23 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Directives/Schema_Directives_Explicit.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Directives/Schema_Directives_Explicit.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.Directives; @@ -9,4 +8,4 @@ namespace GraphZen.TypeSystem.Tests.Configuration.Directives; // ReSharper disable once InconsistentNaming public class Schema_Directives_Explicit : Schema_Directives, ICollectionExplicitConfigurationFixture { -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Directives/Schema_Directives_ViaObjectClrPropertyAttribute.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Directives/Schema_Directives_ViaObjectClrPropertyAttribute.cs index 7cbd8a0f0..b297b82c8 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Directives/Schema_Directives_ViaObjectClrPropertyAttribute.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Directives/Schema_Directives_ViaObjectClrPropertyAttribute.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; @@ -48,4 +47,4 @@ public class FooObject { [FieldDefinition] public string? Bar { get; set; } } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/ClrType/EnumClrTypeConfigurationTests.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/ClrType/EnumClrTypeConfigurationTests.cs index 32892c84c..502a65c5c 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/ClrType/EnumClrTypeConfigurationTests.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/ClrType/EnumClrTypeConfigurationTests.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.TypeSystem.Tests.Configuration.Enums.ClrType; [NoReorder] @@ -39,4 +37,4 @@ public void }); Assert.Equal(typeof(ExampleEnum), schema.GetEnum().ClrType); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/Description/Enum_Description.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/Description/Enum_Description.cs index f3a75435f..9b64202d2 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/Description/Enum_Description.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/Description/Enum_Description.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Internal; using GraphZen.TypeSystem.Taxonomy; @@ -51,4 +50,4 @@ public override bool TryGetValue(EnumTypeDefinition parent, out string? value) // ReSharper disable once ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract return value != null; } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/Description/Enum_Explicit_Description.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/Description/Enum_Explicit_Description.cs index 3abcdede2..3e3b901f4 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/Description/Enum_Explicit_Description.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/Description/Enum_Explicit_Description.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.Enums.Description; @@ -9,4 +8,4 @@ namespace GraphZen.TypeSystem.Tests.Configuration.Enums.Description; // ReSharper disable once InconsistentNaming public class Enum_Explicit_Description : Enum_Description, ILeafExplicitConfigurationFixture { -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/Description/Enum_ViaClrEnum_Description.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/Description/Enum_ViaClrEnum_Description.cs index 83fcf4d0b..75355feea 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/Description/Enum_ViaClrEnum_Description.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/Description/Enum_ViaClrEnum_Description.cs @@ -2,7 +2,6 @@ // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. using System.ComponentModel; -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.Enums.Description; @@ -33,4 +32,4 @@ public void ConfigureClrContext(SchemaBuilder sb, string parentName) { sb.Enum(); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/EnumValues/Description/EnumValue_Description.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/EnumValues/Description/EnumValue_Description.cs index cfdbc009d..63ac984a4 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/EnumValues/Description/EnumValue_Description.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/EnumValues/Description/EnumValue_Description.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Internal; using GraphZen.TypeSystem.Taxonomy; @@ -51,4 +50,4 @@ public override bool TryGetValue(EnumValueDefinition parent, out string? value) value = parent.Description; return value != null; } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/EnumValues/Description/EnumValue_Explicit_Description.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/EnumValues/Description/EnumValue_Explicit_Description.cs index 5f1347c9c..a25b855e5 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/EnumValues/Description/EnumValue_Explicit_Description.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/EnumValues/Description/EnumValue_Explicit_Description.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.Enums.EnumValues.Description; @@ -9,4 +8,4 @@ namespace GraphZen.TypeSystem.Tests.Configuration.Enums.EnumValues.Description; // ReSharper disable once InconsistentNaming public class EnumValue_Explicit_Description : EnumValue_Description, ILeafExplicitConfigurationFixture { -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/EnumValues/Description/EnumValue_ViaClrEnumValue_Description.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/EnumValues/Description/EnumValue_ViaClrEnumValue_Description.cs index 1e8e666d7..3986c32b5 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/EnumValues/Description/EnumValue_ViaClrEnumValue_Description.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/EnumValues/Description/EnumValue_ViaClrEnumValue_Description.cs @@ -2,7 +2,6 @@ // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. using System.ComponentModel; -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.Enums.EnumValues.Description; @@ -35,4 +34,4 @@ public void ConfigureClrContext(SchemaBuilder sb, string parentName) { sb.Enum(); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/EnumValues/Enum_Values.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/EnumValues/Enum_Values.cs index de20953e8..ae00e2f42 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/EnumValues/Enum_Values.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/EnumValues/Enum_Values.cs @@ -53,4 +53,4 @@ public override void RenameItem(SchemaBuilder sb, string parentName, string name { sb.Enum(parentName).Value(name, value => value.Name(newName)); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/EnumValues/Enum_Values_Explicit.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/EnumValues/Enum_Values_Explicit.cs index 3856763ed..8fdd528e9 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/EnumValues/Enum_Values_Explicit.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/EnumValues/Enum_Values_Explicit.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.Enums.EnumValues; @@ -9,4 +8,4 @@ namespace GraphZen.TypeSystem.Tests.Configuration.Enums.EnumValues; // ReSharper disable once InconsistentNaming public class Enum_Values_Explicit : Enum_Values, ICollectionExplicitConfigurationFixture { -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/EnumValues/Enum_Values_ViaClrEnumValues.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/EnumValues/Enum_Values_ViaClrEnumValues.cs index 0c87de2df..c5de36d08 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/EnumValues/Enum_Values_ViaClrEnumValues.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/EnumValues/Enum_Values_ViaClrEnumValues.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.Enums.EnumValues; @@ -39,4 +38,4 @@ public void ConfigureClrContext(SchemaBuilder sb, string parentName) } public override string ToString() => nameof(Enum_Values_ViaClrEnumValues); -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/Schema_Enums.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/Schema_Enums.cs index 5928c26e4..9c67ef9dc 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/Schema_Enums.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/Schema_Enums.cs @@ -50,4 +50,4 @@ public override NamedCollection GetCollection(SchemaDefiniti public override ConfigurationSource? FindIgnoredItemConfigurationSource(SchemaDefinition parent, string name) => parent.FindIgnoredTypeConfigurationSource(name); -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/Schema_Enums_Explicit.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/Schema_Enums_Explicit.cs index 227d9eb79..9efb807b7 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/Schema_Enums_Explicit.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/Schema_Enums_Explicit.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.Enums; @@ -9,4 +8,4 @@ namespace GraphZen.TypeSystem.Tests.Configuration.Enums; // ReSharper disable once InconsistentNaming public class Schema_Enums_Explicit : Schema_Enums, ICollectionExplicitConfigurationFixture { -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/Schema_Enums_ViaClrEnums.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/Schema_Enums_ViaClrEnums.cs index 3076e2fe0..575e342ba 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/Schema_Enums_ViaClrEnums.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Enums/Schema_Enums_ViaClrEnums.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.Enums; @@ -65,4 +64,4 @@ public class Query public NamedByDataAnnotation NamedByDataAnnoation { get; set; } } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/ClrType/InputObjectClrTypeConfigurationTests.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/ClrType/InputObjectClrTypeConfigurationTests.cs index 9f0facc67..6d43b1612 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/ClrType/InputObjectClrTypeConfigurationTests.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/ClrType/InputObjectClrTypeConfigurationTests.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.TypeSystem.Tests.Configuration.InputObjects.ClrType; [NoReorder] @@ -40,4 +38,4 @@ public void }); Assert.Equal(typeof(ExampleInputObject), schema.GetInputObject().ClrType); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Description/InputObject_Description.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Description/InputObject_Description.cs index fee0c4ad5..f0f4f30d1 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Description/InputObject_Description.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Description/InputObject_Description.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Internal; using GraphZen.TypeSystem.Taxonomy; @@ -51,4 +50,4 @@ public override bool TryGetValue(InputObjectTypeDefinition parent, out string? v value = parent.Description; return value != null; } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Description/InputObject_Explicit_Description.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Description/InputObject_Explicit_Description.cs index b976a458a..c9a57bd64 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Description/InputObject_Explicit_Description.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Description/InputObject_Explicit_Description.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.InputObjects.Description; @@ -9,4 +8,4 @@ namespace GraphZen.TypeSystem.Tests.Configuration.InputObjects.Description; // ReSharper disable once InconsistentNaming public class InputObject_Explicit_Description : InputObject_Description, ILeafExplicitConfigurationFixture { -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Description/InputObject_ViaClrClass_Description.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Description/InputObject_ViaClrClass_Description.cs index 1e7cbdb2c..b2cda3a58 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Description/InputObject_ViaClrClass_Description.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Description/InputObject_ViaClrClass_Description.cs @@ -2,7 +2,6 @@ // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. using System.ComponentModel; -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.InputObjects.Description; @@ -34,4 +33,4 @@ public void ConfigureClrContext(SchemaBuilder sb, string parentName) private class ExampleInputObject { } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Fields/Description/InputObject_Field_Description.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Fields/Description/InputObject_Field_Description.cs index b77af4087..3b54bac9f 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Fields/Description/InputObject_Field_Description.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Fields/Description/InputObject_Field_Description.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Internal; using GraphZen.TypeSystem.Taxonomy; @@ -51,4 +50,4 @@ public override bool TryGetValue(InputFieldDefinition parent, out string? value) value = parent.Description; return value != null; } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Fields/Description/InputObject_Field_Explicit_Description.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Fields/Description/InputObject_Field_Explicit_Description.cs index e2bad8b5f..d20065186 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Fields/Description/InputObject_Field_Explicit_Description.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Fields/Description/InputObject_Field_Explicit_Description.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.InputObjects.Fields.Description; @@ -10,4 +9,4 @@ namespace GraphZen.TypeSystem.Tests.Configuration.InputObjects.Fields.Descriptio public class InputObject_Field_Explicit_Description : InputObject_Field_Description, ILeafExplicitConfigurationFixture { -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Fields/Description/InputObject_Field_ViaClrProperty_Description.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Fields/Description/InputObject_Field_ViaClrProperty_Description.cs index ebee6b94a..551fbb7dc 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Fields/Description/InputObject_Field_ViaClrProperty_Description.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Fields/Description/InputObject_Field_ViaClrProperty_Description.cs @@ -36,4 +36,4 @@ public class ExampleInputObject [Description(DataAnnotationDescriptionValue)] public string? ExampleField { get; set; } } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Fields/InputObject_Fields.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Fields/InputObject_Fields.cs index d56c608de..e032c8e5d 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Fields/InputObject_Fields.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Fields/InputObject_Fields.cs @@ -55,4 +55,4 @@ public override void RenameItem(SchemaBuilder sb, string parentName, string name { sb.InputObject(parentName).Field(name, f => f.Name(newName)); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Fields/InputObject_Fields_Explicit.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Fields/InputObject_Fields_Explicit.cs index cebd8ea90..c6145df43 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Fields/InputObject_Fields_Explicit.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Fields/InputObject_Fields_Explicit.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.InputObjects.Fields; @@ -9,4 +8,4 @@ namespace GraphZen.TypeSystem.Tests.Configuration.InputObjects.Fields; // ReSharper disable once InconsistentNaming public class InputObject_Fields_Explicit : InputObject_Fields, ICollectionExplicitConfigurationFixture { -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Fields/InputObject_Fields_ViaClrProperties.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Fields/InputObject_Fields_ViaClrProperties.cs index d3d5f0b55..19496a937 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Fields/InputObject_Fields_ViaClrProperties.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Fields/InputObject_Fields_ViaClrProperties.cs @@ -54,4 +54,4 @@ public class ExampleInputObject public IgnoredType IgnoredByConvention { get; set; } = null!; } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Schema_InputObjects.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Schema_InputObjects.cs index 1a7e15c4e..3b52c7340 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Schema_InputObjects.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Schema_InputObjects.cs @@ -51,4 +51,4 @@ public override NamedCollection GetCollection(Schema parent) => public override ConfigurationSource? FindIgnoredItemConfigurationSource(SchemaDefinition parent, string name) => parent.FindIgnoredTypeConfigurationSource(name); -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Schema_InputObjects_Explicit.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Schema_InputObjects_Explicit.cs index 171291ecb..8aab006a4 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Schema_InputObjects_Explicit.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Schema_InputObjects_Explicit.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.InputObjects; @@ -9,4 +8,4 @@ namespace GraphZen.TypeSystem.Tests.Configuration.InputObjects; // ReSharper disable once InconsistentNaming public class Schema_InputObjects_Explicit : Schema_InputObjects, ICollectionExplicitConfigurationFixture { -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Schema_InputObjects_ViaClrClasses.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Schema_InputObjects_ViaClrClasses.cs index 351138d03..f3333a0f1 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Schema_InputObjects_ViaClrClasses.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/InputObjects/Schema_InputObjects_ViaClrClasses.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.InputObjects; @@ -66,4 +65,4 @@ public class IgnoredByConvention public class IgnoredByDataAnnotation { } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/ClrType/InterfaceClrTypeConfigurationTests.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/ClrType/InterfaceClrTypeConfigurationTests.cs index 5d85bad1c..7b538f152 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/ClrType/InterfaceClrTypeConfigurationTests.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/ClrType/InterfaceClrTypeConfigurationTests.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.TypeSystem.Tests.Configuration.Interfaces.ClrType; [NoReorder] @@ -39,4 +37,4 @@ public void }); Assert.Equal(typeof(IExampleInterface), schema.GetInterface().ClrType); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Description/Interface_Description.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Description/Interface_Description.cs index 711b0b1f5..d9c7bd3c5 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Description/Interface_Description.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Description/Interface_Description.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Internal; using GraphZen.TypeSystem.Taxonomy; @@ -50,4 +49,4 @@ public override bool TryGetValue(InterfaceTypeDefinition parent, out string? val value = parent.Description; return value != null; } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Description/Interface_Explicit_Description.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Description/Interface_Explicit_Description.cs index c3d3c1541..1d8c252a9 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Description/Interface_Explicit_Description.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Description/Interface_Explicit_Description.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.Interfaces.Description; @@ -9,4 +8,4 @@ namespace GraphZen.TypeSystem.Tests.Configuration.Interfaces.Description; // ReSharper disable once InconsistentNaming public class Interface_Explicit_Description : Interface_Description, ILeafExplicitConfigurationFixture { -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Description/Interface_ViaClrClass_Description.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Description/Interface_ViaClrClass_Description.cs index e27ea9c7a..34efa5528 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Description/Interface_ViaClrClass_Description.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Description/Interface_ViaClrClass_Description.cs @@ -2,7 +2,6 @@ // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. using System.ComponentModel; -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.Interfaces.Description; @@ -33,4 +32,4 @@ public void ConfigureClrContext(SchemaBuilder sb, string parentName) public interface IExampleInterface { } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Arguments/Description/Interface_Field_Argument_Description.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Arguments/Description/Interface_Field_Argument_Description.cs index f94615e73..cc96d3c11 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Arguments/Description/Interface_Field_Argument_Description.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Arguments/Description/Interface_Field_Argument_Description.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Internal; using GraphZen.TypeSystem.Taxonomy; @@ -53,4 +52,4 @@ public override bool TryGetValue(ArgumentDefinition parent, out string? value) value = parent.Description; return value != null; } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Arguments/Description/Interface_Field_Argument_Explicit_Description.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Arguments/Description/Interface_Field_Argument_Explicit_Description.cs index 9dded3428..e0330d487 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Arguments/Description/Interface_Field_Argument_Explicit_Description.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Arguments/Description/Interface_Field_Argument_Explicit_Description.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.Interfaces.Fields.Arguments.Description; @@ -10,4 +9,4 @@ namespace GraphZen.TypeSystem.Tests.Configuration.Interfaces.Fields.Arguments.De public class Interface_Field_Argument_Explicit_Description : Interface_Field_Argument_Description, ILeafExplicitConfigurationFixture { -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Arguments/Description/Interface_Field_Argument_ViaClrMethod_Description.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Arguments/Description/Interface_Field_Argument_ViaClrMethod_Description.cs index 97cbb5607..cdd826fd1 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Arguments/Description/Interface_Field_Argument_ViaClrMethod_Description.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Arguments/Description/Interface_Field_Argument_ViaClrMethod_Description.cs @@ -2,7 +2,6 @@ // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. using System.ComponentModel; -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.Interfaces.Fields.Arguments.Description; @@ -36,4 +35,4 @@ public interface IExampleInterface [GraphQLName(Grandparent)] string ExampleField([Description(DataAnnotationDescriptionValue)] string argName); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Arguments/Interface_Field_Arguments.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Arguments/Interface_Field_Arguments.cs index 1b9075508..55fac04ab 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Arguments/Interface_Field_Arguments.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Arguments/Interface_Field_Arguments.cs @@ -51,4 +51,4 @@ public override void RenameItem(SchemaBuilder sb, string parentName, string name { sb.Interface(Grandparent).Field(parentName, f => f.Argument(name, arg => arg.Name(newName))); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Arguments/Interface_Field_Arguments_Explicit.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Arguments/Interface_Field_Arguments_Explicit.cs index 4df6985e1..736b65621 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Arguments/Interface_Field_Arguments_Explicit.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Arguments/Interface_Field_Arguments_Explicit.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.Interfaces.Fields.Arguments; @@ -9,4 +8,4 @@ namespace GraphZen.TypeSystem.Tests.Configuration.Interfaces.Fields.Arguments; // ReSharper disable once InconsistentNaming public class Interface_Field_Arguments_Explicit : Interface_Field_Arguments, ICollectionExplicitConfigurationFixture { -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Arguments/Interface_Field_Arguments_ViaClrMethodParameters.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Arguments/Interface_Field_Arguments_ViaClrMethodParameters.cs index e6b400e95..3dd1b29bd 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Arguments/Interface_Field_Arguments_ViaClrMethodParameters.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Arguments/Interface_Field_Arguments_ViaClrMethodParameters.cs @@ -40,4 +40,4 @@ string SomeField( [GraphQLIgnore] string ignoreMe, [GraphQLName(DataAnnotationName)] string arg2); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Description/Interface_Field_Description.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Description/Interface_Field_Description.cs index 100dc4d19..1f73278df 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Description/Interface_Field_Description.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Description/Interface_Field_Description.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Internal; using GraphZen.TypeSystem.Taxonomy; @@ -51,4 +50,4 @@ public override bool TryGetValue(FieldDefinition parent, out string? value) value = parent.Description; return value != null; } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Description/Interface_Field_Explicit_Description.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Description/Interface_Field_Explicit_Description.cs index fec3e5d27..a42dea964 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Description/Interface_Field_Explicit_Description.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Description/Interface_Field_Explicit_Description.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.Interfaces.Fields.Description; @@ -9,4 +8,4 @@ namespace GraphZen.TypeSystem.Tests.Configuration.Interfaces.Fields.Description; // ReSharper disable once InconsistentNaming public class Interface_Field_Explicit_Description : Interface_Field_Description, ILeafExplicitConfigurationFixture { -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Description/Interface_Field_ViaClrProperty_Description.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Description/Interface_Field_ViaClrProperty_Description.cs index a8e7bf946..532ecf382 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Description/Interface_Field_ViaClrProperty_Description.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Description/Interface_Field_ViaClrProperty_Description.cs @@ -36,4 +36,4 @@ public interface IExampleInterface [Description(DataAnnotationDescriptionValue)] string ExampleField { get; set; } } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Interface_Fields.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Interface_Fields.cs index 58437e8fb..69d3c4149 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Interface_Fields.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Interface_Fields.cs @@ -53,4 +53,4 @@ public override void RenameItem(SchemaBuilder sb, string parentName, string item { sb.Interface(parentName).Field(itemName, field => field.Name(newName)); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Interface_Fields_Explicit.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Interface_Fields_Explicit.cs index 992a19d96..2ae48bae5 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Interface_Fields_Explicit.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Interface_Fields_Explicit.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.Interfaces.Fields; @@ -9,4 +8,4 @@ namespace GraphZen.TypeSystem.Tests.Configuration.Interfaces.Fields; // ReSharper disable once InconsistentNaming public class Interface_Fields_Explicit : Interface_Fields, ICollectionExplicitConfigurationFixture { -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Interface_Fields_ViaClrMethods.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Interface_Fields_ViaClrMethods.cs index 2e93800fb..774ccad15 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Interface_Fields_ViaClrMethods.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Interface_Fields_ViaClrMethods.cs @@ -56,4 +56,4 @@ public interface IExampleInterface IgnoredType IgnoredByConvention(); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Interface_Fields_ViaClrProperties.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Interface_Fields_ViaClrProperties.cs index e2d9c196a..264b66fd6 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Interface_Fields_ViaClrProperties.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Fields/Interface_Fields_ViaClrProperties.cs @@ -49,4 +49,4 @@ public interface IExampleInterface IgnoredType IgnoredByConvention { get; set; } } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Schema_Interfaces.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Schema_Interfaces.cs index b89c0d81d..2f5ee7890 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Schema_Interfaces.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Schema_Interfaces.cs @@ -51,4 +51,4 @@ public override NamedCollection GetCollection(Schema parent) => public override ConfigurationSource? FindIgnoredItemConfigurationSource(SchemaDefinition parent, string name) => parent.FindIgnoredTypeConfigurationSource(name); -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Schema_Interfaces_Explicit.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Schema_Interfaces_Explicit.cs index aad3adf6f..c821f10dd 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Schema_Interfaces_Explicit.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Schema_Interfaces_Explicit.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.Interfaces; @@ -9,4 +8,4 @@ namespace GraphZen.TypeSystem.Tests.Configuration.Interfaces; // ReSharper disable once InconsistentNaming public class Schema_Interfaces_Explicit : Schema_Interfaces, ICollectionExplicitConfigurationFixture { -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Schema_Interfaces_ViaClrInterfaces.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Schema_Interfaces_ViaClrInterfaces.cs index 41466923c..6271b9e39 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Schema_Interfaces_ViaClrInterfaces.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Interfaces/Schema_Interfaces_ViaClrInterfaces.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.Interfaces; @@ -60,4 +59,4 @@ public interface IIgnoredByConvention public interface IIgnoredByDataAnnotation { } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/ClrType/ObjectClrTypeConfigurationTests.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/ClrType/ObjectClrTypeConfigurationTests.cs index f57cbd97c..3fece1623 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/ClrType/ObjectClrTypeConfigurationTests.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/ClrType/ObjectClrTypeConfigurationTests.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.TypeSystem.Tests.Configuration.Objects.ClrType; [NoReorder] @@ -41,4 +39,4 @@ public void }); Assert.Equal(typeof(ExampleObject), schema.GetObject().ClrType); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Description/Object_Description.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Description/Object_Description.cs index 2e84049be..5848f1964 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Description/Object_Description.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Description/Object_Description.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Internal; using GraphZen.TypeSystem.Taxonomy; @@ -50,4 +49,4 @@ public override bool TryGetValue(ObjectTypeDefinition parent, out string? value) value = parent.Description; return value != null; } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Description/Object_Explicit_Description.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Description/Object_Explicit_Description.cs index aba2855cb..24eee93bb 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Description/Object_Explicit_Description.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Description/Object_Explicit_Description.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.Objects.Description; @@ -9,4 +8,4 @@ namespace GraphZen.TypeSystem.Tests.Configuration.Objects.Description; // ReSharper disable once InconsistentNaming public class Object_Explicit_Description : Object_Description, ILeafExplicitConfigurationFixture { -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Description/Object_ViaClrClass_Description.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Description/Object_ViaClrClass_Description.cs index 0d641cf17..92f31a07d 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Description/Object_ViaClrClass_Description.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Description/Object_ViaClrClass_Description.cs @@ -2,7 +2,6 @@ // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. using System.ComponentModel; -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.Objects.Description; @@ -33,4 +32,4 @@ public void ConfigureClrContext(SchemaBuilder sb, string parentName) public class ExampleObject { } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Arguments/Description/Object_Field_Argument_Description.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Arguments/Description/Object_Field_Argument_Description.cs index 700d9db35..c1d823680 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Arguments/Description/Object_Field_Argument_Description.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Arguments/Description/Object_Field_Argument_Description.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Internal; using GraphZen.TypeSystem.Taxonomy; @@ -53,4 +52,4 @@ public override bool TryGetValue(ArgumentDefinition parent, out string? value) value = parent.Description; return value != null; } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Arguments/Description/Object_Field_Argument_Explicit_Description.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Arguments/Description/Object_Field_Argument_Explicit_Description.cs index 83f16f444..503bb6b6d 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Arguments/Description/Object_Field_Argument_Explicit_Description.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Arguments/Description/Object_Field_Argument_Explicit_Description.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.Objects.Fields.Arguments.Description; @@ -10,4 +9,4 @@ namespace GraphZen.TypeSystem.Tests.Configuration.Objects.Fields.Arguments.Descr public class Object_Field_Argument_Explicit_Description : Object_Field_Argument_Description, ILeafExplicitConfigurationFixture { -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Arguments/Description/Object_Field_Argument_ViaClrMethod_Description.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Arguments/Description/Object_Field_Argument_ViaClrMethod_Description.cs index 1ef297105..01d086451 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Arguments/Description/Object_Field_Argument_ViaClrMethod_Description.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Arguments/Description/Object_Field_Argument_ViaClrMethod_Description.cs @@ -2,7 +2,6 @@ // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. using System.ComponentModel; -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.Objects.Fields.Arguments.Description; @@ -37,4 +36,4 @@ public class ExampleObject public string ExampleField([Description(DataAnnotationDescriptionValue)] string argName) => throw new NotImplementedException(); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Arguments/Object_Field_Arguments.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Arguments/Object_Field_Arguments.cs index 9639fa011..d1fbb2d6f 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Arguments/Object_Field_Arguments.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Arguments/Object_Field_Arguments.cs @@ -51,4 +51,4 @@ public override void RenameItem(SchemaBuilder sb, string parentName, string name { sb.Object(Grandparent).Field(parentName, f => f.Argument(name, arg => arg.Name(newName))); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Arguments/Object_Field_Arguments_Explicit.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Arguments/Object_Field_Arguments_Explicit.cs index 8b499aaec..0fe1f0f25 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Arguments/Object_Field_Arguments_Explicit.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Arguments/Object_Field_Arguments_Explicit.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.Objects.Fields.Arguments; @@ -9,4 +8,4 @@ namespace GraphZen.TypeSystem.Tests.Configuration.Objects.Fields.Arguments; // ReSharper disable once InconsistentNaming public class Object_Field_Arguments_Explicit : Object_Field_Arguments, ICollectionExplicitConfigurationFixture { -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Arguments/Object_Field_Arguments_ViaClrMethodParameters.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Arguments/Object_Field_Arguments_ViaClrMethodParameters.cs index 17713a331..df6744815 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Arguments/Object_Field_Arguments_ViaClrMethodParameters.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Arguments/Object_Field_Arguments_ViaClrMethodParameters.cs @@ -41,4 +41,4 @@ public string SomeField( [GraphQLName(DataAnnotationName)] string arg2) => throw new NotImplementedException(); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Description/Object_Field_Description.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Description/Object_Field_Description.cs index ae508a1b5..74ec66fb4 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Description/Object_Field_Description.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Description/Object_Field_Description.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Internal; using GraphZen.TypeSystem.Taxonomy; @@ -51,4 +50,4 @@ public override bool TryGetValue(FieldDefinition parent, out string? value) value = parent.Description; return value != null; } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Description/Object_Field_Explicit_Description.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Description/Object_Field_Explicit_Description.cs index f0c1b8bd9..439a0ca77 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Description/Object_Field_Explicit_Description.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Description/Object_Field_Explicit_Description.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.Objects.Fields.Description; @@ -9,4 +8,4 @@ namespace GraphZen.TypeSystem.Tests.Configuration.Objects.Fields.Description; // ReSharper disable once InconsistentNaming public class Object_Field_Explicit_Description : Object_Field_Description, ILeafExplicitConfigurationFixture { -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Description/Object_Field_ViaClrMethod_Description.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Description/Object_Field_ViaClrMethod_Description.cs index 91da732d8..0f0fe1f4a 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Description/Object_Field_ViaClrMethod_Description.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Description/Object_Field_ViaClrMethod_Description.cs @@ -35,4 +35,4 @@ public class ExampleObject [Description(DataAnnotationDescriptionValue)] public string ExampleField() => throw new NotImplementedException(); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Description/Object_Field_ViaClrProperty_Description.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Description/Object_Field_ViaClrProperty_Description.cs index 89bd7b44c..a1364906a 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Description/Object_Field_ViaClrProperty_Description.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Description/Object_Field_ViaClrProperty_Description.cs @@ -35,4 +35,4 @@ public class ExampleObject [Description(DataAnnotationDescriptionValue)] public string? ExampleField { get; set; } } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Object_Fields.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Object_Fields.cs index 791d6c6c7..f23216158 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Object_Fields.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Object_Fields.cs @@ -52,4 +52,4 @@ public override void RenameItem(SchemaBuilder sb, string parentName, string name { sb.Object(parentName).Field(name, field => field.Name(newName)); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Object_Fields_Explicit.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Object_Fields_Explicit.cs index 05616cb3b..c2e007784 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Object_Fields_Explicit.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Object_Fields_Explicit.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.Objects.Fields; @@ -9,4 +8,4 @@ namespace GraphZen.TypeSystem.Tests.Configuration.Objects.Fields; // ReSharper disable once InconsistentNaming public class Object_Fields_Explicit : Object_Fields, ICollectionExplicitConfigurationFixture { -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Object_Fields_ViaClrMethods.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Object_Fields_ViaClrMethods.cs index f36fe012b..815630783 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Object_Fields_ViaClrMethods.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Object_Fields_ViaClrMethods.cs @@ -53,4 +53,4 @@ public class ExampleObject public IgnoredType IgnoredByConvention() => throw new NotImplementedException(); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Object_Fields_ViaClrProperties.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Object_Fields_ViaClrProperties.cs index 127cff13d..ff6b1f6b9 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Object_Fields_ViaClrProperties.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Fields/Object_Fields_ViaClrProperties.cs @@ -49,4 +49,4 @@ public class ExampleObject public IgnoredType? IgnoredByConvention { get; set; } } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Interfaces/Object_Interfaces.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Interfaces/Object_Interfaces.cs index 8d83cb3ff..157b42ac3 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Interfaces/Object_Interfaces.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Interfaces/Object_Interfaces.cs @@ -54,4 +54,4 @@ public override void RenameItem(SchemaBuilder sb, string parentName, string name { sb.Interface(name).Name(newName); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Interfaces/Object_Interfaces_Explicit.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Interfaces/Object_Interfaces_Explicit.cs index 824cf5ce2..9f0bcbb7c 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Interfaces/Object_Interfaces_Explicit.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Interfaces/Object_Interfaces_Explicit.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.Objects.Interfaces; @@ -9,4 +8,4 @@ namespace GraphZen.TypeSystem.Tests.Configuration.Objects.Interfaces; // ReSharper disable once InconsistentNaming public class Object_Interfaces_Explicit : Object_Interfaces, ICollectionExplicitConfigurationFixture { -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Interfaces/Object_Interfaces_ViaClrInterfaces.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Interfaces/Object_Interfaces_ViaClrInterfaces.cs index 7376271bc..a47ebbcc9 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Interfaces/Object_Interfaces_ViaClrInterfaces.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Interfaces/Object_Interfaces_ViaClrInterfaces.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.Objects.Interfaces; @@ -59,4 +58,4 @@ public interface IIgnoredByConvention public interface IIgnoredByDataAnnotation { } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Schema_Objects.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Schema_Objects.cs index bf7030824..aebab5fec 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Schema_Objects.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Schema_Objects.cs @@ -54,4 +54,4 @@ public override NamedCollection GetCollection(Schema parent) public override ConfigurationSource? FindIgnoredItemConfigurationSource(SchemaDefinition parent, string name) => parent.FindIgnoredTypeConfigurationSource(name); -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Schema_Objects_Explicit.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Schema_Objects_Explicit.cs index 148fd7f71..a8636987b 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Schema_Objects_Explicit.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Schema_Objects_Explicit.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.Objects; @@ -9,4 +8,4 @@ namespace GraphZen.TypeSystem.Tests.Configuration.Objects; // ReSharper disable once InconsistentNaming public class Schema_Objects_Explicit : Schema_Objects, ICollectionExplicitConfigurationFixture { -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Schema_Objects_ViaClrClasses.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Schema_Objects_ViaClrClasses.cs index ed5d19360..b905cca82 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Schema_Objects_ViaClrClasses.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Objects/Schema_Objects_ViaClrClasses.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.Objects; @@ -61,4 +60,4 @@ public class IgnoredByConvention public class IgnoredByDataAnnotation { } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Scalars/ClrType/ScalarClrTypeConfigurationTests.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Scalars/ClrType/ScalarClrTypeConfigurationTests.cs index 468676990..2e8644e89 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Scalars/ClrType/ScalarClrTypeConfigurationTests.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Scalars/ClrType/ScalarClrTypeConfigurationTests.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.TypeSystem.Tests.Configuration.Scalars.ClrType; [NoReorder] @@ -39,4 +37,4 @@ public void }); Assert.Equal(typeof(ExampleScalar), schema.GetScalar().ClrType); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Scalars/Description/Scalar_Description.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Scalars/Description/Scalar_Description.cs index eb5411f02..88622ac89 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Scalars/Description/Scalar_Description.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Scalars/Description/Scalar_Description.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Internal; using GraphZen.TypeSystem.Taxonomy; @@ -50,4 +49,4 @@ public override bool TryGetValue(ScalarTypeDefinition parent, out string? value) value = parent.Description; return value != null; } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Scalars/Description/Scalar_Explicit_Description.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Scalars/Description/Scalar_Explicit_Description.cs index 5095c657a..77d11a716 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Scalars/Description/Scalar_Explicit_Description.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Scalars/Description/Scalar_Explicit_Description.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.Scalars.Description; @@ -9,4 +8,4 @@ namespace GraphZen.TypeSystem.Tests.Configuration.Scalars.Description; // ReSharper disable once InconsistentNaming public class Scalar_Explicit_Description : Scalar_Description, ILeafExplicitConfigurationFixture { -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Scalars/Description/Scalar_ViaClrClass_Description.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Scalars/Description/Scalar_ViaClrClass_Description.cs index c22b453f5..a5c8767f8 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Scalars/Description/Scalar_ViaClrClass_Description.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Scalars/Description/Scalar_ViaClrClass_Description.cs @@ -2,7 +2,6 @@ // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. using System.ComponentModel; -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.Scalars.Description; @@ -33,4 +32,4 @@ public void ConfigureClrContext(SchemaBuilder sb, string parentName) public class ExampleScalar { } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Scalars/Schema_Scalars.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Scalars/Schema_Scalars.cs index beee8fa82..f92c066fe 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Scalars/Schema_Scalars.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Scalars/Schema_Scalars.cs @@ -50,4 +50,4 @@ public override NamedCollection GetCollection(SchemaDefini public override ConfigurationSource? FindIgnoredItemConfigurationSource(SchemaDefinition parent, string name) => parent.FindIgnoredTypeConfigurationSource(name); -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Scalars/Schema_Scalars_Explicit.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Scalars/Schema_Scalars_Explicit.cs index 58b773bdd..6bc469313 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Scalars/Schema_Scalars_Explicit.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Scalars/Schema_Scalars_Explicit.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.Scalars; @@ -9,4 +8,4 @@ namespace GraphZen.TypeSystem.Tests.Configuration.Scalars; // ReSharper disable once InconsistentNaming public class Schema_Scalars_Explicit : Schema_Scalars, ICollectionExplicitConfigurationFixture { -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/ClrType/UnionClrTypeConfigurationTests.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/ClrType/UnionClrTypeConfigurationTests.cs index 15daf4a93..e1707f87a 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/ClrType/UnionClrTypeConfigurationTests.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/ClrType/UnionClrTypeConfigurationTests.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.TypeSystem.Tests.Configuration.Unions.ClrType; [NoReorder] @@ -39,4 +37,4 @@ public void }); Assert.Equal(typeof(ExampleUnion), schema.GetUnion().ClrType); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Description/Union_Description.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Description/Union_Description.cs index 902045dd8..d41701392 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Description/Union_Description.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Description/Union_Description.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Internal; using GraphZen.TypeSystem.Taxonomy; @@ -50,4 +49,4 @@ public override bool TryGetValue(UnionTypeDefinition parent, out string? value) value = parent.Description; return value != null; } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Description/Union_Explicit_Description.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Description/Union_Explicit_Description.cs index 18db04981..c7ab7945f 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Description/Union_Explicit_Description.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Description/Union_Explicit_Description.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.Unions.Description; @@ -9,4 +8,4 @@ namespace GraphZen.TypeSystem.Tests.Configuration.Unions.Description; // ReSharper disable once InconsistentNaming public class Union_Explicit_Description : Union_Description, ILeafExplicitConfigurationFixture { -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Description/Union_ViaClrClass_Description.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Description/Union_ViaClrClass_Description.cs index 75ceac479..4ad1675db 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Description/Union_ViaClrClass_Description.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Description/Union_ViaClrClass_Description.cs @@ -2,7 +2,6 @@ // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. using System.ComponentModel; -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.Unions.Description; @@ -33,4 +32,4 @@ public void ConfigureClrContext(SchemaBuilder sb, string parentName) public class ExampleUnion { } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Description/Union_ViaClrMarkerInterface_Description.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Description/Union_ViaClrMarkerInterface_Description.cs index 5a2ed8988..62e67a842 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Description/Union_ViaClrMarkerInterface_Description.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Description/Union_ViaClrMarkerInterface_Description.cs @@ -2,7 +2,6 @@ // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. using System.ComponentModel; -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.Unions.Description; @@ -39,4 +38,4 @@ public class Query public interface IExampleUnion { } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Schema_Unions.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Schema_Unions.cs index d1845e60a..a21a2d6e3 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Schema_Unions.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Schema_Unions.cs @@ -50,4 +50,4 @@ public override NamedCollection GetCollection(SchemaDefinit public override ConfigurationSource? FindIgnoredItemConfigurationSource(SchemaDefinition parent, string name) => parent.FindIgnoredTypeConfigurationSource(name); -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Schema_Unions_Explicit.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Schema_Unions_Explicit.cs index 7ddca384b..83414823d 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Schema_Unions_Explicit.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Schema_Unions_Explicit.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.Unions; @@ -9,4 +8,4 @@ namespace GraphZen.TypeSystem.Tests.Configuration.Unions; // ReSharper disable once InconsistentNaming public class Schema_Unions_Explicit : Schema_Unions, ICollectionExplicitConfigurationFixture { -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Schema_Unions_ViaClassWithMarkerInterface.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Schema_Unions_ViaClassWithMarkerInterface.cs index 962ef9912..bab9b71ad 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Schema_Unions_ViaClassWithMarkerInterface.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Schema_Unions_ViaClassWithMarkerInterface.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Internal; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; @@ -84,4 +83,4 @@ public interface IIgnoredByConvention public interface IIgnoredByDataAnnotation { } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Schema_Unions_ViaClrBaseClass.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Schema_Unions_ViaClrBaseClass.cs index 36d33cc63..792f56450 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Schema_Unions_ViaClrBaseClass.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Schema_Unions_ViaClrBaseClass.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.Unions; @@ -59,4 +58,4 @@ public abstract class IgnoredByConvention public abstract class IgnoredByDataAnnotation { } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Schema_Unions_ViaClrChildClass.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Schema_Unions_ViaClrChildClass.cs index 3d9a82f70..e34175e9a 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Schema_Unions_ViaClrChildClass.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Schema_Unions_ViaClrChildClass.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; namespace GraphZen.TypeSystem.Tests.Configuration.Unions; @@ -78,4 +77,4 @@ public class FooBar : IgnoredByDataAnnotation public abstract class IgnoredByDataAnnotation { } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Schema_Unions_ViaMarkerInterface.cs b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Schema_Unions_ViaMarkerInterface.cs index c38c7d4d1..8224a1b1e 100644 --- a/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Schema_Unions_ViaMarkerInterface.cs +++ b/test/GraphZen.TypeSystem.Tests/Configuration/Schema/Unions/Schema_Unions_ViaMarkerInterface.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Internal; using GraphZen.TypeSystem.Tests.Configuration.Infrastructure; @@ -84,4 +83,4 @@ public interface IIgnoredByConvention public interface IIgnoredByDataAnnotation { } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/CoreOptionsExtensionTests.cs b/test/GraphZen.TypeSystem.Tests/CoreOptionsExtensionTests.cs index ca0d8285f..689373e0d 100644 --- a/test/GraphZen.TypeSystem.Tests/CoreOptionsExtensionTests.cs +++ b/test/GraphZen.TypeSystem.Tests/CoreOptionsExtensionTests.cs @@ -12,4 +12,4 @@ public void it_should_have_default_constructor() { Assert.NotNull(new CoreOptionsExtension()); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Definitions/BlogContext.cs b/test/GraphZen.TypeSystem.Tests/Definitions/BlogContext.cs index 6937b2772..24a06b21f 100644 --- a/test/GraphZen.TypeSystem.Tests/Definitions/BlogContext.cs +++ b/test/GraphZen.TypeSystem.Tests/Definitions/BlogContext.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.TypeSystem.Tests; public class BlogContext : GraphQLContext @@ -47,4 +45,4 @@ protected internal override void OnSchemaCreating(SchemaBuilder schema) // .Argument("id").Type("String"); }); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Definitions/BlogExampleSchemaTests.cs b/test/GraphZen.TypeSystem.Tests/Definitions/BlogExampleSchemaTests.cs index b80414db8..61fbeebbf 100644 --- a/test/GraphZen.TypeSystem.Tests/Definitions/BlogExampleSchemaTests.cs +++ b/test/GraphZen.TypeSystem.Tests/Definitions/BlogExampleSchemaTests.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.TypeSystem.Tests; public class BlogExampleSchemaTests @@ -69,4 +67,4 @@ public void DefinesSubscriptionSchema() Assert.Equal(schema.GetType("Article"), sub.FieldType); Assert.Equal("articleSubscribe", sub.Name); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Definitions/BlogMutationContext.cs b/test/GraphZen.TypeSystem.Tests/Definitions/BlogMutationContext.cs index 894593f06..b8bebc87a 100644 --- a/test/GraphZen.TypeSystem.Tests/Definitions/BlogMutationContext.cs +++ b/test/GraphZen.TypeSystem.Tests/Definitions/BlogMutationContext.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.TypeSystem.Tests; public class BlogMutationContext : BlogContext @@ -12,4 +10,4 @@ protected internal override void OnSchemaCreating(SchemaBuilder schema) base.OnSchemaCreating(schema); schema.MutationType("Mutation"); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Definitions/BlogSubscriptionContext.cs b/test/GraphZen.TypeSystem.Tests/Definitions/BlogSubscriptionContext.cs index 26e5f0d62..eee384a5e 100644 --- a/test/GraphZen.TypeSystem.Tests/Definitions/BlogSubscriptionContext.cs +++ b/test/GraphZen.TypeSystem.Tests/Definitions/BlogSubscriptionContext.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.TypeSystem.Tests; public class BlogSubscriptionContext : BlogContext @@ -12,4 +10,4 @@ protected internal override void OnSchemaCreating(SchemaBuilder schema) base.OnSchemaCreating(schema); schema.SubscriptionType("Subscription"); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Definitions/Builders/EnumTypeBuilderIdentityTests.cs b/test/GraphZen.TypeSystem.Tests/Definitions/Builders/EnumTypeBuilderIdentityTests.cs index 124b2d98b..822e2e83c 100644 --- a/test/GraphZen.TypeSystem.Tests/Definitions/Builders/EnumTypeBuilderIdentityTests.cs +++ b/test/GraphZen.TypeSystem.Tests/Definitions/Builders/EnumTypeBuilderIdentityTests.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.TypeSystem.Tests; [NoReorder] @@ -49,4 +47,4 @@ public override void RemoveNameByClrType(SchemaBuilder schemaBuilder, Type clrTy { throw new NotImplementedException(); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Definitions/Builders/EnumTypeBuilderTests.cs b/test/GraphZen.TypeSystem.Tests/Definitions/Builders/EnumTypeBuilderTests.cs index 1418a6c44..8ae125948 100644 --- a/test/GraphZen.TypeSystem.Tests/Definitions/Builders/EnumTypeBuilderTests.cs +++ b/test/GraphZen.TypeSystem.Tests/Definitions/Builders/EnumTypeBuilderTests.cs @@ -27,4 +27,4 @@ public void EnumCreatedWithClrTypeInfersValues() Assert.Equal("bar desc", values[0].Description); Assert.Equal("customBaz", values[1].Name); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Definitions/Builders/InputObjectTypeBuilderIdenitityTests.cs b/test/GraphZen.TypeSystem.Tests/Definitions/Builders/InputObjectTypeBuilderIdenitityTests.cs index 66a15a987..b6fb1b748 100644 --- a/test/GraphZen.TypeSystem.Tests/Definitions/Builders/InputObjectTypeBuilderIdenitityTests.cs +++ b/test/GraphZen.TypeSystem.Tests/Definitions/Builders/InputObjectTypeBuilderIdenitityTests.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.TypeSystem.Tests; [NoReorder] @@ -50,4 +48,4 @@ public override void RemoveNameByClrType(SchemaBuilder schemaBuilder, Type clrTy { schemaBuilder.InputObject(clrType).Name(null!); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Definitions/Builders/InputTypeBuilderIdentityTests.cs b/test/GraphZen.TypeSystem.Tests/Definitions/Builders/InputTypeBuilderIdentityTests.cs index b81a96d2b..387eb2ca3 100644 --- a/test/GraphZen.TypeSystem.Tests/Definitions/Builders/InputTypeBuilderIdentityTests.cs +++ b/test/GraphZen.TypeSystem.Tests/Definitions/Builders/InputTypeBuilderIdentityTests.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.TypeSystem.Tests; [NoReorder] @@ -49,4 +47,4 @@ public override void RemoveNameByClrType(SchemaBuilder schemaBuilder, Type clrTy { throw new NotImplementedException(); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Definitions/Builders/InterfaceTypeBuilderIdentityTests.cs b/test/GraphZen.TypeSystem.Tests/Definitions/Builders/InterfaceTypeBuilderIdentityTests.cs index 45a47f7ff..c263dcfe8 100644 --- a/test/GraphZen.TypeSystem.Tests/Definitions/Builders/InterfaceTypeBuilderIdentityTests.cs +++ b/test/GraphZen.TypeSystem.Tests/Definitions/Builders/InterfaceTypeBuilderIdentityTests.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.TypeSystem.Tests; [NoReorder] @@ -49,4 +47,4 @@ public override void RemoveNameByClrType(SchemaBuilder schemaBuilder, Type clrTy { schemaBuilder.Interface(clrType).Name(null!); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Definitions/Builders/ObjectTypeBuilderIdentityTests.cs b/test/GraphZen.TypeSystem.Tests/Definitions/Builders/ObjectTypeBuilderIdentityTests.cs index 2c3e447d7..3fbe81563 100644 --- a/test/GraphZen.TypeSystem.Tests/Definitions/Builders/ObjectTypeBuilderIdentityTests.cs +++ b/test/GraphZen.TypeSystem.Tests/Definitions/Builders/ObjectTypeBuilderIdentityTests.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.TypeSystem.Tests; [NoReorder] @@ -49,4 +47,4 @@ public override void RemoveNameByClrType(SchemaBuilder schemaBuilder, Type clrTy { schemaBuilder.Object(clrType).Name(null!); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Definitions/Builders/ScalarTypeBuilderIdentityTests.cs b/test/GraphZen.TypeSystem.Tests/Definitions/Builders/ScalarTypeBuilderIdentityTests.cs index dec00878c..805a22d12 100644 --- a/test/GraphZen.TypeSystem.Tests/Definitions/Builders/ScalarTypeBuilderIdentityTests.cs +++ b/test/GraphZen.TypeSystem.Tests/Definitions/Builders/ScalarTypeBuilderIdentityTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.Internal; namespace GraphZen.TypeSystem.Tests; @@ -51,4 +50,4 @@ public override void RemoveNameByClrType(SchemaBuilder schemaBuilder, Type clrTy { schemaBuilder.Scalar(clrType).Name(null!); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Definitions/Builders/SchemaBuilderTests.cs b/test/GraphZen.TypeSystem.Tests/Definitions/Builders/SchemaBuilderTests.cs index d3e1b07bf..bd841983b 100644 --- a/test/GraphZen.TypeSystem.Tests/Definitions/Builders/SchemaBuilderTests.cs +++ b/test/GraphZen.TypeSystem.Tests/Definitions/Builders/SchemaBuilderTests.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.TypeSystem.Tests; public class SchemaBuilderTests @@ -52,4 +50,4 @@ public void type_with_duplicate_name_via_clr_type_throws_error() public class Foo { } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Definitions/Builders/TypeBuilderIdentityTests.cs b/test/GraphZen.TypeSystem.Tests/Definitions/Builders/TypeBuilderIdentityTests.cs index 0e1e1deb6..393b7d6de 100644 --- a/test/GraphZen.TypeSystem.Tests/Definitions/Builders/TypeBuilderIdentityTests.cs +++ b/test/GraphZen.TypeSystem.Tests/Definitions/Builders/TypeBuilderIdentityTests.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.TypeSystem.Tests; [NoReorder] @@ -427,4 +425,4 @@ public void CannotCreateTypeNamedAfterBuiltinType(string name) { Schema.Create(_ => { CreateTypeWithName(_, name); }); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Definitions/Builders/TypeNodeClrTests.cs b/test/GraphZen.TypeSystem.Tests/Definitions/Builders/TypeNodeClrTests.cs index ad38aa032..42940ccc0 100644 --- a/test/GraphZen.TypeSystem.Tests/Definitions/Builders/TypeNodeClrTests.cs +++ b/test/GraphZen.TypeSystem.Tests/Definitions/Builders/TypeNodeClrTests.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.TypeSystem.Tests; [NoReorder] @@ -11,4 +9,4 @@ public class TypeNodeClrTests public class Foo { } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Definitions/Builders/TypeReferenceTests.cs b/test/GraphZen.TypeSystem.Tests/Definitions/Builders/TypeReferenceTests.cs index 84b6a43f4..be9e9efc1 100644 --- a/test/GraphZen.TypeSystem.Tests/Definitions/Builders/TypeReferenceTests.cs +++ b/test/GraphZen.TypeSystem.Tests/Definitions/Builders/TypeReferenceTests.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.TypeSystem.Tests; public class TypeReferenceTests @@ -48,4 +46,4 @@ private class Foo private class Bar { } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Definitions/Builders/UnionTypeBuilderIdenitityTests.cs b/test/GraphZen.TypeSystem.Tests/Definitions/Builders/UnionTypeBuilderIdenitityTests.cs index 771c92106..0e4875202 100644 --- a/test/GraphZen.TypeSystem.Tests/Definitions/Builders/UnionTypeBuilderIdenitityTests.cs +++ b/test/GraphZen.TypeSystem.Tests/Definitions/Builders/UnionTypeBuilderIdenitityTests.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.TypeSystem.Tests; [NoReorder] @@ -51,4 +49,4 @@ public override void RemoveNameByClrType(SchemaBuilder schemaBuilder, Type clrTy { schemaBuilder.Union(clrType).Name(null!); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Discovery/TypeDiscoveryTests.cs b/test/GraphZen.TypeSystem.Tests/Discovery/TypeDiscoveryTests.cs index 137cc491f..13b6537d4 100644 --- a/test/GraphZen.TypeSystem.Tests/Discovery/TypeDiscoveryTests.cs +++ b/test/GraphZen.TypeSystem.Tests/Discovery/TypeDiscoveryTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel.Internal; using GraphZen.TypeSystem.Internal; @@ -98,8 +97,10 @@ public void included_by_convention(Type clrType, TypeKind? kind, ConfigurationSo { Assert.Null(def); if (ignoredConfigurationSource.HasValue) + { Assert.Equal(ignoredConfigurationSource, _.GetDefinition().FindIgnoredTypeConfigurationSource(clrType.GetGraphQLName())); + } } else { @@ -111,8 +112,12 @@ public void included_by_convention(Type clrType, TypeKind? kind, ConfigurationSo var type = schema.GetTypes().Where(t => t.Kind == kind).SingleOrDefault(_ => _.ClrType == clrType); if (ignored) + { Assert.Null(type); + } else + { Assert.NotNull(type); + } } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Discovery/UnionTypeBaseClassConfigurationTests.cs b/test/GraphZen.TypeSystem.Tests/Discovery/UnionTypeBaseClassConfigurationTests.cs index 2c95e545e..a0a5fbbc1 100644 --- a/test/GraphZen.TypeSystem.Tests/Discovery/UnionTypeBaseClassConfigurationTests.cs +++ b/test/GraphZen.TypeSystem.Tests/Discovery/UnionTypeBaseClassConfigurationTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Internal; @@ -114,4 +113,4 @@ public void union_type_from_abstract_class_convention() Assert.Equal(childC, unionB.MemberTypesMap[childC.Name]); Assert.Equal(childD, unionB.MemberTypesMap[childD.Name]); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Discovery/UnionTypeConventionDiscoveryTests.cs b/test/GraphZen.TypeSystem.Tests/Discovery/UnionTypeConventionDiscoveryTests.cs index bdb5551e3..eb70662bf 100644 --- a/test/GraphZen.TypeSystem.Tests/Discovery/UnionTypeConventionDiscoveryTests.cs +++ b/test/GraphZen.TypeSystem.Tests/Discovery/UnionTypeConventionDiscoveryTests.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.TypeSystem.Tests; [NoReorder] @@ -19,4 +17,4 @@ public class UnionChildA : UnionBase public class UnionChildB : UnionBase { } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/Discovery/UnionTypeDataAnnotationDiscoveryTests.cs b/test/GraphZen.TypeSystem.Tests/Discovery/UnionTypeDataAnnotationDiscoveryTests.cs index 9310fe1a5..57c69cb32 100644 --- a/test/GraphZen.TypeSystem.Tests/Discovery/UnionTypeDataAnnotationDiscoveryTests.cs +++ b/test/GraphZen.TypeSystem.Tests/Discovery/UnionTypeDataAnnotationDiscoveryTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Internal; @@ -129,4 +128,4 @@ public void union_discovered_by_data_annotation_on_object_field_type() Assert.Equal(memberA, union.MemberTypesMap[memberA.Name]); Assert.Equal(memberB, union.MemberTypesMap[memberB.Name]); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/GraphQLContextOptionsBuilderTests.cs b/test/GraphZen.TypeSystem.Tests/GraphQLContextOptionsBuilderTests.cs index 57603cc03..be5b61e31 100644 --- a/test/GraphZen.TypeSystem.Tests/GraphQLContextOptionsBuilderTests.cs +++ b/test/GraphZen.TypeSystem.Tests/GraphQLContextOptionsBuilderTests.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.TypeSystem.Tests; public class GraphQLContextOptionsBuilderTests @@ -40,4 +38,4 @@ public void it_should_be_created_with_custom_options_from_custom_context() public class CustomContext : GraphQLContext { } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/GraphQLContextOptionsTests.cs b/test/GraphZen.TypeSystem.Tests/GraphQLContextOptionsTests.cs index 700ff967a..80fa49010 100644 --- a/test/GraphZen.TypeSystem.Tests/GraphQLContextOptionsTests.cs +++ b/test/GraphZen.TypeSystem.Tests/GraphQLContextOptionsTests.cs @@ -1,8 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; - namespace GraphZen.TypeSystem.Tests; public class GraphQLContextOptionsTests @@ -24,4 +22,4 @@ public void it_should_be_created_with_custom_context() public class CustomContext : GraphQLContext { } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/PropertyInfoTests.cs b/test/GraphZen.TypeSystem.Tests/PropertyInfoTests.cs index e5c02eaff..3717b7dcd 100644 --- a/test/GraphZen.TypeSystem.Tests/PropertyInfoTests.cs +++ b/test/GraphZen.TypeSystem.Tests/PropertyInfoTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Internal; namespace GraphZen.TypeSystem.Tests; @@ -35,4 +34,4 @@ public void PropertyNullability(string propertyName, bool excpectCanBeNull) var canBeNull = property.CanBeNull(); Assert.Equal(excpectCanBeNull, canBeNull); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/SchemaToSyntaxTests.cs b/test/GraphZen.TypeSystem.Tests/SchemaToSyntaxTests.cs index 859be26d5..4c147d834 100644 --- a/test/GraphZen.TypeSystem.Tests/SchemaToSyntaxTests.cs +++ b/test/GraphZen.TypeSystem.Tests/SchemaToSyntaxTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.LanguageModel; using static GraphZen.LanguageModel.SyntaxFactory; using static GraphZen.TypeSystem.SyntaxHelpers; @@ -166,4 +165,4 @@ public void input_object_type_to_syntax_mode() }); Assert.Equal(expected, inputObject.ToSyntaxNode()); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/StringLiteral.cs b/test/GraphZen.TypeSystem.Tests/StringLiteral.cs index 4dbe2bb40..d565cd4f0 100644 --- a/test/GraphZen.TypeSystem.Tests/StringLiteral.cs +++ b/test/GraphZen.TypeSystem.Tests/StringLiteral.cs @@ -12,4 +12,4 @@ internal struct StringLiteral : IInspectable public string Value { get; set; } public string GetDisplayValue() => Value; -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/TaxonomyTests.cs b/test/GraphZen.TypeSystem.Tests/TaxonomyTests.cs index 9a9e925fd..bf87eeb45 100644 --- a/test/GraphZen.TypeSystem.Tests/TaxonomyTests.cs +++ b/test/GraphZen.TypeSystem.Tests/TaxonomyTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Taxonomy; namespace GraphZen.TypeSystem.Tests; @@ -310,4 +309,4 @@ public void NullableTypes() Assert.Equal(expected, types); } -} \ No newline at end of file +} diff --git a/test/GraphZen.TypeSystem.Tests/TypePredicateTests.cs b/test/GraphZen.TypeSystem.Tests/TypePredicateTests.cs index 32960040c..5d82b72f2 100644 --- a/test/GraphZen.TypeSystem.Tests/TypePredicateTests.cs +++ b/test/GraphZen.TypeSystem.Tests/TypePredicateTests.cs @@ -1,7 +1,6 @@ // Copyright (c) GraphZen LLC. All rights reserved. // Licensed under the GraphZen Community License. See the LICENSE file in the project root for license information. -using GraphZen.Infrastructure; using GraphZen.TypeSystem.Taxonomy; namespace GraphZen.TypeSystem.Tests; @@ -458,4 +457,4 @@ public void GetNamedType_UnwrapsDeeplyWrapperTypes() Assert.Equal(InputObjectType, NonNullType.Of(ListType.Of(NonNullType.Of(InputObjectType))).GetNamedType()); } -} \ No newline at end of file +}