Back to Graphql Dotnet

GraphQL.NET Analyzer Documentation

docs2/site/docs/analyzers/overview.md

8.8.43.9 KB
Original Source

GraphQL.NET Analyzer Documentation

This documentation provides an overview of the analyzers that have been included in GraphQL.NET and how to configure them using the .editorconfig file.

Introduction

Analyzers in GraphQL.NET are tools that help you identify and address potential issues or improvements in your GraphQL code. This documentation covers currently available analyzers and code fixes, along with the methods to configure them.

Configuration in .editorconfig

Certain analyzers and code fixes offer configuration options that control when the rule is applied and how the automatic code fix executes code adjustments. Refer to the specific documentation page for each analyzer to understand the available configuration options and their application methods.

Set rule severity

You can set the severity for analyzer rules in .editorconfig file with the following syntax:

ini
dotnet_diagnostic.<rule ID>.severity = <severity>

For example

ini
dotnet_diagnostic.GQL001.severity = none

Note: configuration keys are case insensitive

For more information about analyzers configuration see Code Analysis Configuration Overview

Included Analyzers

IdentifierName
GQL001Define the name in Field, Connection or ConnectionBuilder.Create method
GQL002Name method invocation can be removed
GQL003Different names defined by Field, Connection or ConnectionBuilder.Create and Name methods
GQL004Don't use obsolete Field methods
GQL005Illegal resolver usage
GQL006Can not match input field to the source field
GQL007Can not set source field
GQL008Don't use an obsolete Argument method
GQL009Use async resolver
GQL010Can not resolve input source type constructor
GQL011The type must not be convertible to IGraphType
GQL012Illegal method usage
GQL013OneOf fields must be nullable
GQL014OneOf fields must not have default value
GQL015Can't infer a Field name from expression
GQL016Require parameterless constructor
GQL017Could not find method
GQL018Parser method must be valid
GQL019Validator method must be valid
GQL020ValidateArguments method must be valid