-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from kirpi4ik/v1.2
V1.2
- Loading branch information
Showing
10 changed files
with
73 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,4 +7,5 @@ build/ | |
### IntelliJ IDEA ### | ||
.DS_Store | ||
.idea | ||
|
||
### VSC | ||
bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/main/groovy/graphql/linter/rules/TypeNameFirstCaps.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package graphql.linter.rules | ||
|
||
import graphql.linter.registry.types.TypeRule | ||
import graphql.schema.GraphQLNamedSchemaElement | ||
|
||
@TypeRule | ||
class TypeNameFirstCaps extends LintRule { | ||
@Override | ||
def validate(GraphQLNamedSchemaElement parent, GraphQLNamedSchemaElement node) { | ||
if (!(node.name ==~ /^[A-Z].+/)) { | ||
fail(parent, node, "Type `${node.name}` has invalid name, it should start with caps ") | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
rule(["FIELD", "TYPE"]) { | ||
if (node.name ==~ /^[a-z].*/) { | ||
fail(parent, node, "The fieldname `${parent.name}.${node.name}` starts with uppercase.") | ||
fail(parent, node, "The fieldname `${parent?.name}.${node.name}` starts with uppercase.") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,14 @@ | ||
extend type Query { | ||
Camel:String | ||
field(arg:invalidInputName):String | ||
} | ||
|
||
input invalidInputName { | ||
id:String | ||
} | ||
type invalidTypeName{ | ||
id:String | ||
} | ||
enum invalidEnumName{ | ||
EN | ||
} |