-
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 #1471 from aml-org/W-11047878
W-11047878: Add invalid name validation for GraphQL
- Loading branch information
Showing
24 changed files
with
332 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...d/src/test/resources/graphql/tck/apis/invalid/introspection-argument-interface.api.report
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 @@ | ||
ModelId: file://amf-cli/shared/src/test/resources/graphql/tck/apis/invalid/introspection-argument-interface.api.graphql | ||
Profile: GraphQL | ||
Conforms: false | ||
Number of results: 1 | ||
|
||
Level: Violation | ||
|
||
- Constraint: http://a.ml/vocabularies/amf/parser#DomainElement-name-invalidIntrospectionName | ||
Message: Name must not begin with '__' as this is used exclusively by GraphQL’s introspection system | ||
Severity: Violation | ||
Target: file://amf-cli/shared/src/test/resources/graphql/tck/apis/invalid/introspection-argument-interface.api.graphql#/declares/shape/Starship/supportedOperation/length/expects/request/parameter/parameter/__unit | ||
Property: http://a.ml/vocabularies/core#name | ||
Range: [(1,0)-(1,0)] | ||
Location: |
14 changes: 14 additions & 0 deletions
14
...ared/src/test/resources/graphql/tck/apis/invalid/introspection-argument-object.api.report
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 @@ | ||
ModelId: file://amf-cli/shared/src/test/resources/graphql/tck/apis/invalid/introspection-argument-object.api.graphql | ||
Profile: GraphQL | ||
Conforms: false | ||
Number of results: 1 | ||
|
||
Level: Violation | ||
|
||
- Constraint: http://a.ml/vocabularies/amf/parser#DomainElement-name-invalidIntrospectionName | ||
Message: Name must not begin with '__' as this is used exclusively by GraphQL’s introspection system | ||
Severity: Violation | ||
Target: file://amf-cli/shared/src/test/resources/graphql/tck/apis/invalid/introspection-argument-object.api.graphql#/declares/shape/Starship/supportedOperation/length/expects/request/parameter/parameter/__unit | ||
Property: http://a.ml/vocabularies/core#name | ||
Range: [(1,0)-(1,0)] | ||
Location: |
9 changes: 9 additions & 0 deletions
9
...hared/src/test/resources/graphql/tck/apis/invalid/introspection-custom-scalar.api.graphql
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,9 @@ | ||
schema { | ||
query: Query | ||
} | ||
|
||
type Query { | ||
date: __Date | ||
} | ||
|
||
scalar __Date |
14 changes: 14 additions & 0 deletions
14
...shared/src/test/resources/graphql/tck/apis/invalid/introspection-custom-scalar.api.report
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 @@ | ||
ModelId: file://amf-cli/shared/src/test/resources/graphql/tck/apis/invalid/introspection-custom-scalar.api.graphql | ||
Profile: GraphQL | ||
Conforms: false | ||
Number of results: 1 | ||
|
||
Level: Violation | ||
|
||
- Constraint: http://a.ml/vocabularies/amf/parser#DomainElement-name-invalidIntrospectionName | ||
Message: Name must not begin with '__' as this is used exclusively by GraphQL’s introspection system | ||
Severity: Violation | ||
Target: file://amf-cli/shared/src/test/resources/graphql/tck/apis/invalid/introspection-custom-scalar.api.graphql#/declares/scalar/__Date | ||
Property: http://www.w3.org/ns/shacl#name | ||
Range: [(1,0)-(1,0)] | ||
Location: |
9 changes: 9 additions & 0 deletions
9
.../src/test/resources/graphql/tck/apis/invalid/introspection-directive-argument.api.graphql
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,9 @@ | ||
schema { | ||
query: Query | ||
} | ||
|
||
type Query { | ||
name: String | ||
} | ||
|
||
directive @MyDirective(__text: String) on SCHEMA |
14 changes: 14 additions & 0 deletions
14
...d/src/test/resources/graphql/tck/apis/invalid/introspection-directive-argument.api.report
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 @@ | ||
ModelId: file://amf-cli/shared/src/test/resources/graphql/tck/apis/invalid/introspection-directive-argument.api.graphql | ||
Profile: GraphQL | ||
Conforms: false | ||
Number of results: 1 | ||
|
||
Level: Violation | ||
|
||
- Constraint: http://a.ml/vocabularies/amf/parser#DomainElement-name-invalidIntrospectionName | ||
Message: Name must not begin with '__' as this is used exclusively by GraphQL’s introspection system | ||
Severity: Violation | ||
Target: file://amf-cli/shared/src/test/resources/graphql/tck/apis/invalid/introspection-directive-argument.api.graphql#/declares/MyDirective/shape/default-node/property/property/__text | ||
Property: http://www.w3.org/ns/shacl#name | ||
Range: [(1,0)-(1,0)] | ||
Location: |
14 changes: 14 additions & 0 deletions
14
...cli/shared/src/test/resources/graphql/tck/apis/invalid/introspection-directive.api.report
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 @@ | ||
ModelId: file://amf-cli/shared/src/test/resources/graphql/tck/apis/invalid/introspection-directive.api.graphql | ||
Profile: GraphQL | ||
Conforms: false | ||
Number of results: 1 | ||
|
||
Level: Violation | ||
|
||
- Constraint: http://a.ml/vocabularies/amf/parser#DomainElement-name-invalidIntrospectionName | ||
Message: Name must not begin with '__' as this is used exclusively by GraphQL’s introspection system | ||
Severity: Violation | ||
Target: file://amf-cli/shared/src/test/resources/graphql/tck/apis/invalid/introspection-directive.api.graphql#/declares/__invalidName | ||
Property: http://a.ml/vocabularies/core#name | ||
Range: [(1,0)-(1,0)] | ||
Location: |
14 changes: 14 additions & 0 deletions
14
amf-cli/shared/src/test/resources/graphql/tck/apis/invalid/introspection-enum.api.graphql
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 @@ | ||
schema { | ||
query: Query | ||
} | ||
|
||
type Query { | ||
season: __Season | ||
} | ||
|
||
enum __Season { | ||
SPRING | ||
AUTUMN | ||
SUMMER | ||
WINTER | ||
} |
14 changes: 14 additions & 0 deletions
14
amf-cli/shared/src/test/resources/graphql/tck/apis/invalid/introspection-enum.api.report
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 @@ | ||
ModelId: file://amf-cli/shared/src/test/resources/graphql/tck/apis/invalid/introspection-enum.api.graphql | ||
Profile: GraphQL | ||
Conforms: false | ||
Number of results: 1 | ||
|
||
Level: Violation | ||
|
||
- Constraint: http://a.ml/vocabularies/amf/parser#DomainElement-name-invalidIntrospectionName | ||
Message: Name must not begin with '__' as this is used exclusively by GraphQL’s introspection system | ||
Severity: Violation | ||
Target: file://amf-cli/shared/src/test/resources/graphql/tck/apis/invalid/introspection-enum.api.graphql#/declares/scalar/__Season | ||
Property: http://www.w3.org/ns/shacl#name | ||
Range: [(1,0)-(1,0)] | ||
Location: |
14 changes: 14 additions & 0 deletions
14
...red/src/test/resources/graphql/tck/apis/invalid/introspection-field-input-type.api.report
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 @@ | ||
ModelId: file://amf-cli/shared/src/test/resources/graphql/tck/apis/invalid/introspection-field-input-type.api.graphql | ||
Profile: GraphQL | ||
Conforms: false | ||
Number of results: 1 | ||
|
||
Level: Violation | ||
|
||
- Constraint: http://a.ml/vocabularies/amf/parser#DomainElement-name-invalidIntrospectionName | ||
Message: Name must not begin with '__' as this is used exclusively by GraphQL’s introspection system | ||
Severity: Violation | ||
Target: file://amf-cli/shared/src/test/resources/graphql/tck/apis/invalid/introspection-field-input-type.api.graphql#/declares/shape/Person/property/property/__name | ||
Property: http://www.w3.org/ns/shacl#name | ||
Range: [(1,0)-(1,0)] | ||
Location: |
14 changes: 14 additions & 0 deletions
14
...ared/src/test/resources/graphql/tck/apis/invalid/introspection-field-interface.api.report
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 @@ | ||
ModelId: file://amf-cli/shared/src/test/resources/graphql/tck/apis/invalid/introspection-field-interface.api.graphql | ||
Profile: GraphQL | ||
Conforms: false | ||
Number of results: 1 | ||
|
||
Level: Violation | ||
|
||
- Constraint: http://a.ml/vocabularies/amf/parser#DomainElement-name-invalidIntrospectionName | ||
Message: Name must not begin with '__' as this is used exclusively by GraphQL’s introspection system | ||
Severity: Violation | ||
Target: file://amf-cli/shared/src/test/resources/graphql/tck/apis/invalid/introspection-field-interface.api.graphql#/declares/shape/Person/property/property/__name | ||
Property: http://www.w3.org/ns/shacl#name | ||
Range: [(1,0)-(1,0)] | ||
Location: |
14 changes: 14 additions & 0 deletions
14
.../shared/src/test/resources/graphql/tck/apis/invalid/introspection-field-object.api.report
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 @@ | ||
ModelId: file://amf-cli/shared/src/test/resources/graphql/tck/apis/invalid/introspection-field-object.api.graphql | ||
Profile: GraphQL | ||
Conforms: false | ||
Number of results: 1 | ||
|
||
Level: Violation | ||
|
||
- Constraint: http://a.ml/vocabularies/amf/parser#DomainElement-name-invalidIntrospectionName | ||
Message: Name must not begin with '__' as this is used exclusively by GraphQL’s introspection system | ||
Severity: Violation | ||
Target: file://amf-cli/shared/src/test/resources/graphql/tck/apis/invalid/introspection-field-object.api.graphql#/declares/shape/Person/property/property/__name | ||
Property: http://www.w3.org/ns/shacl#name | ||
Range: [(1,0)-(1,0)] | ||
Location: |
11 changes: 11 additions & 0 deletions
11
...i/shared/src/test/resources/graphql/tck/apis/invalid/introspection-input-type.api.graphql
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,11 @@ | ||
schema { | ||
query: Query | ||
} | ||
|
||
type Query { | ||
name: String | ||
} | ||
|
||
input __Person { | ||
name: String | ||
} |
14 changes: 14 additions & 0 deletions
14
...li/shared/src/test/resources/graphql/tck/apis/invalid/introspection-input-type.api.report
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 @@ | ||
ModelId: file://amf-cli/shared/src/test/resources/graphql/tck/apis/invalid/introspection-input-type.api.graphql | ||
Profile: GraphQL | ||
Conforms: false | ||
Number of results: 1 | ||
|
||
Level: Violation | ||
|
||
- Constraint: http://a.ml/vocabularies/amf/parser#DomainElement-name-invalidIntrospectionName | ||
Message: Name must not begin with '__' as this is used exclusively by GraphQL’s introspection system | ||
Severity: Violation | ||
Target: file://amf-cli/shared/src/test/resources/graphql/tck/apis/invalid/introspection-input-type.api.graphql#/declares/shape/__Person | ||
Property: http://www.w3.org/ns/shacl#name | ||
Range: [(1,0)-(1,0)] | ||
Location: |
11 changes: 11 additions & 0 deletions
11
...li/shared/src/test/resources/graphql/tck/apis/invalid/introspection-interface.api.graphql
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,11 @@ | ||
schema { | ||
query: Query | ||
} | ||
|
||
type Query { | ||
person: __Person | ||
} | ||
|
||
interface __Person { | ||
name: String | ||
} |
14 changes: 14 additions & 0 deletions
14
...cli/shared/src/test/resources/graphql/tck/apis/invalid/introspection-interface.api.report
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 @@ | ||
ModelId: file://amf-cli/shared/src/test/resources/graphql/tck/apis/invalid/introspection-interface.api.graphql | ||
Profile: GraphQL | ||
Conforms: false | ||
Number of results: 1 | ||
|
||
Level: Violation | ||
|
||
- Constraint: http://a.ml/vocabularies/amf/parser#DomainElement-name-invalidIntrospectionName | ||
Message: Name must not begin with '__' as this is used exclusively by GraphQL’s introspection system | ||
Severity: Violation | ||
Target: file://amf-cli/shared/src/test/resources/graphql/tck/apis/invalid/introspection-interface.api.graphql#/declares/shape/__Person | ||
Property: http://www.w3.org/ns/shacl#name | ||
Range: [(1,0)-(1,0)] | ||
Location: |
11 changes: 11 additions & 0 deletions
11
amf-cli/shared/src/test/resources/graphql/tck/apis/invalid/introspection-object.api.graphql
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,11 @@ | ||
schema { | ||
query: Query | ||
} | ||
|
||
type Query { | ||
person: __Person | ||
} | ||
|
||
type __Person { | ||
name: String | ||
} |
14 changes: 14 additions & 0 deletions
14
amf-cli/shared/src/test/resources/graphql/tck/apis/invalid/introspection-object.api.report
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 @@ | ||
ModelId: file://amf-cli/shared/src/test/resources/graphql/tck/apis/invalid/introspection-object.api.graphql | ||
Profile: GraphQL | ||
Conforms: false | ||
Number of results: 1 | ||
|
||
Level: Violation | ||
|
||
- Constraint: http://a.ml/vocabularies/amf/parser#DomainElement-name-invalidIntrospectionName | ||
Message: Name must not begin with '__' as this is used exclusively by GraphQL’s introspection system | ||
Severity: Violation | ||
Target: file://amf-cli/shared/src/test/resources/graphql/tck/apis/invalid/introspection-object.api.graphql#/declares/shape/__Person | ||
Property: http://www.w3.org/ns/shacl#name | ||
Range: [(1,0)-(1,0)] | ||
Location: |
7 changes: 7 additions & 0 deletions
7
amf-cli/shared/src/test/resources/graphql/tck/apis/invalid/introspection-root.api.graphql
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,7 @@ | ||
schema { | ||
query: __Query | ||
} | ||
|
||
type __Query { | ||
__string(__arg: String): String | ||
} |
30 changes: 30 additions & 0 deletions
30
amf-cli/shared/src/test/resources/graphql/tck/apis/invalid/introspection-root.api.report
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,30 @@ | ||
ModelId: file://amf-cli/shared/src/test/resources/graphql/tck/apis/invalid/introspection-root.api.graphql | ||
Profile: GraphQL | ||
Conforms: false | ||
Number of results: 3 | ||
|
||
Level: Violation | ||
|
||
- Constraint: http://a.ml/vocabularies/amf/parser#DomainElement-name-invalidIntrospectionName | ||
Message: Name must not begin with '__' as this is used exclusively by GraphQL’s introspection system | ||
Severity: Violation | ||
Target: file://amf-cli/shared/src/test/resources/graphql/tck/apis/invalid/introspection-root.api.graphql#/web-api/endpoint/%2Fquery%2F__string | ||
Property: http://a.ml/vocabularies/core#name | ||
Range: [(1,0)-(1,0)] | ||
Location: | ||
|
||
- Constraint: http://a.ml/vocabularies/amf/parser#DomainElement-name-invalidIntrospectionName | ||
Message: Name must not begin with '__' as this is used exclusively by GraphQL’s introspection system | ||
Severity: Violation | ||
Target: file://amf-cli/shared/src/test/resources/graphql/tck/apis/invalid/introspection-root.api.graphql#/web-api/endpoint/%2Fquery%2F__string/supportedOperation/query/__Query.__string | ||
Property: http://a.ml/vocabularies/core#name | ||
Range: [(1,0)-(1,0)] | ||
Location: | ||
|
||
- Constraint: http://a.ml/vocabularies/amf/parser#DomainElement-name-invalidIntrospectionName | ||
Message: Name must not begin with '__' as this is used exclusively by GraphQL’s introspection system | ||
Severity: Violation | ||
Target: file://amf-cli/shared/src/test/resources/graphql/tck/apis/invalid/introspection-root.api.graphql#/web-api/endpoint/%2Fquery%2F__string/supportedOperation/query/__Query.__string/expects/request/parameter/parameter/query/__arg | ||
Property: http://a.ml/vocabularies/core#name | ||
Range: [(1,0)-(1,0)] | ||
Location: |
19 changes: 19 additions & 0 deletions
19
amf-cli/shared/src/test/resources/graphql/tck/apis/invalid/introspection-union.api.graphql
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,19 @@ | ||
schema { | ||
query: Query | ||
} | ||
|
||
type Query { | ||
searchResult: __SearchResult | ||
} | ||
|
||
type Person { | ||
name: String! | ||
surname: String! | ||
} | ||
|
||
type Dog { | ||
name: String! | ||
breed: String! | ||
} | ||
|
||
union __SearchResult = Person | Dog |
Oops, something went wrong.