Skip to content

Commit 7c48ed9

Browse files
committed
Merge from v8
2 parents 4f1bc22 + 51e77c1 commit 7c48ed9

13 files changed

+534
-4
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ name: CodeQL analysis
44

55
on:
66
push:
7-
branches: [master, develop]
7+
branches: [master, develop, v8]
88
pull_request:
9-
branches: [master, develop]
9+
branches: [master, develop, v8]
1010

1111
jobs:
1212
analyze:

.github/workflows/publish-preview.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
branches:
88
- master
99
- develop
10+
- v8
1011
paths:
1112
- src/**
1213
- .github/workflows/**

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
branches:
66
- master
77
- develop
8+
- v8
89
paths:
910
- src/**
1011
- .github/workflows/**

src/GraphQLParser.ApiTests/GraphQLParser.approved.txt

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ namespace GraphQLParser.Visitors
763763
protected virtual System.Threading.Tasks.ValueTask VisitArgumentsAsync(GraphQLParser.AST.GraphQLArguments arguments, TContext context) { }
764764
protected virtual System.Threading.Tasks.ValueTask VisitArgumentsDefinitionAsync(GraphQLParser.AST.GraphQLArgumentsDefinition argumentsDefinition, TContext context) { }
765765
public virtual System.Threading.Tasks.ValueTask VisitAsync(GraphQLParser.AST.ASTNode? node, TContext context) { }
766-
protected System.Threading.Tasks.ValueTask VisitAsync<T>(System.Collections.Generic.List<T>? nodes, TContext context)
766+
protected virtual System.Threading.Tasks.ValueTask VisitAsync<T>(System.Collections.Generic.List<T>? nodes, TContext context)
767767
where T : GraphQLParser.AST.ASTNode { }
768768
protected virtual System.Threading.Tasks.ValueTask VisitBooleanValueAsync(GraphQLParser.AST.GraphQLBooleanValue booleanValue, TContext context) { }
769769
protected virtual System.Threading.Tasks.ValueTask VisitCommentAsync(GraphQLParser.AST.GraphQLComment comment, TContext context) { }
@@ -981,6 +981,21 @@ namespace GraphQLParser.Visitors
981981
protected override System.Threading.Tasks.ValueTask VisitVariableDefinitionAsync(GraphQLParser.AST.GraphQLVariableDefinition variableDefinition, TContext context) { }
982982
protected override System.Threading.Tasks.ValueTask VisitVariablesDefinitionAsync(GraphQLParser.AST.GraphQLVariablesDefinition variablesDefinition, TContext context) { }
983983
}
984+
public sealed class SDLSorter : GraphQLParser.Visitors.ASTVisitor<GraphQLParser.Visitors.SDLSorterOptions>
985+
{
986+
protected override System.Threading.Tasks.ValueTask VisitAsync<T>(System.Collections.Generic.List<T>? nodes, GraphQLParser.Visitors.SDLSorterOptions context)
987+
where T : GraphQLParser.AST.ASTNode { }
988+
protected override System.Threading.Tasks.ValueTask VisitDirectiveLocationsAsync(GraphQLParser.AST.GraphQLDirectiveLocations directiveLocations, GraphQLParser.Visitors.SDLSorterOptions context) { }
989+
public static void Sort(GraphQLParser.AST.ASTNode node, GraphQLParser.Visitors.SDLSorterOptions? options = null) { }
990+
}
991+
public class SDLSorterOptions : GraphQLParser.Visitors.IASTVisitorContext, System.Collections.Generic.IComparer<GraphQLParser.AST.ASTNode>, System.Collections.Generic.IComparer<GraphQLParser.AST.DirectiveLocation>
992+
{
993+
public SDLSorterOptions(System.StringComparison stringComparison) { }
994+
public System.StringComparison StringComparison { get; }
995+
public static GraphQLParser.Visitors.SDLSorterOptions Default { get; }
996+
public virtual int Compare(GraphQLParser.AST.ASTNode x, GraphQLParser.AST.ASTNode y) { }
997+
public int Compare(GraphQLParser.AST.DirectiveLocation x, GraphQLParser.AST.DirectiveLocation y) { }
998+
}
984999
public class StructurePrinter : GraphQLParser.Visitors.StructurePrinter<GraphQLParser.Visitors.SDLPrinter.DefaultPrintContext>
9851000
{
9861001
public StructurePrinter() { }
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
scalar Type3
2+
3+
schema {
4+
mutation: Type2
5+
query: Type3
6+
subscription: Type1
7+
}
8+
9+
type Type1 @dir3 @dir1 @dir2 {
10+
f1(arg3: [ID], arg1: Float, arg2: Int!): String
11+
f3: ID
12+
f2: Float
13+
}
14+
15+
# Type2 comment
16+
"Type2 description"
17+
input Type2 {
18+
"f1 description"
19+
f1: String
20+
"f3 description"
21+
f3: ID!
22+
"f2 description"
23+
f2: [[Float!]!]!
24+
}
25+
26+
directive @zdir3(arg3: [ID], arg1: Float, arg2: Int!)
27+
on FRAGMENT_SPREAD | FIELD | INLINE_FRAGMENT
28+
29+
directive @zdir1 on FIELD
30+
31+
directive @zdir2 on INLINE_FRAGMENT
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
mutation m2 {
2+
field
3+
}
4+
5+
# comments for q2
6+
query q2 {
7+
dummy
8+
}
9+
10+
subscription s3 @dir3 @dir1 @dir2 {
11+
dummy
12+
}
13+
14+
mutation m1 {
15+
field
16+
}
17+
18+
subscription s1 {
19+
dummy
20+
}
21+
22+
# l2 - comments on default query line 1
23+
# l1 - comments on default query line 2
24+
# l3 - comments on default query line 3
25+
{
26+
...fragment8
27+
field2
28+
... on Type2 {
29+
field5
30+
}
31+
...fragment7
32+
field1 (arg2: "value1", arg1: [3, 1, 2], arg3: { sub2: 1, sub1: 2, sub3: 3 })
33+
... {
34+
field4
35+
}
36+
field3 @dir2 @dir1(arg2: "value1", arg1: [3, 1, 2], arg3: { sub2: 1, sub1: 2, sub3: 3 }) @dir3
37+
...fragment9
38+
... on Type3 {
39+
field6
40+
}
41+
}
42+
43+
fragment frag2 on Type1 {
44+
dummy
45+
}
46+
47+
fragment frag1 on Type2 {
48+
dummy
49+
}
50+
51+
mutation m3 {
52+
field
53+
}
54+
55+
fragment frag3 on Type3 {
56+
dummy3
57+
dummy1
58+
dummy2
59+
}
60+
61+
subscription s2 {
62+
dummy
63+
}
64+
65+
# comments for q3
66+
query q3 ($arg2: ID, $arg1: String, $arg3: Float) {
67+
dummy
68+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
schema {
2+
query: Type3
3+
mutation: Type2
4+
subscription: Type1
5+
}
6+
7+
directive @zdir1 on FIELD
8+
9+
directive @zdir2 on INLINE_FRAGMENT
10+
11+
directive @zdir3(arg1: Float, arg2: Int!, arg3: [ID]) on FIELD | FRAGMENT_SPREAD | INLINE_FRAGMENT
12+
13+
type Type1 @dir1 @dir2 @dir3 {
14+
f1(arg1: Float, arg2: Int!, arg3: [ID]): String
15+
f2: Float
16+
f3: ID
17+
}
18+
19+
# Type2 comment
20+
"Type2 description"
21+
input Type2 {
22+
"f1 description"
23+
f1: String
24+
"f2 description"
25+
f2: [[Float!]!]!
26+
"f3 description"
27+
f3: ID!
28+
}
29+
30+
scalar Type3
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# l2 - comments on default query line 1
2+
# l1 - comments on default query line 2
3+
# l3 - comments on default query line 3
4+
{
5+
field1(arg1: [3, 1, 2], arg2: "value1", arg3: {sub1: 2, sub2: 1, sub3: 3})
6+
field2
7+
field3 @dir1(arg1: [3, 1, 2], arg2: "value1", arg3: {sub1: 2, sub2: 1, sub3: 3}) @dir2 @dir3
8+
... {
9+
field4
10+
}
11+
... on Type2 {
12+
field5
13+
}
14+
... on Type3 {
15+
field6
16+
}
17+
...fragment7
18+
...fragment8
19+
...fragment9
20+
}
21+
22+
# comments for q2
23+
query q2 {
24+
dummy
25+
}
26+
27+
# comments for q3
28+
query q3($arg1: String, $arg2: ID, $arg3: Float) {
29+
dummy
30+
}
31+
32+
mutation m1 {
33+
field
34+
}
35+
36+
mutation m2 {
37+
field
38+
}
39+
40+
mutation m3 {
41+
field
42+
}
43+
44+
subscription s1 {
45+
dummy
46+
}
47+
48+
subscription s2 {
49+
dummy
50+
}
51+
52+
subscription s3 @dir1 @dir2 @dir3 {
53+
dummy
54+
}
55+
56+
fragment frag2 on Type1 {
57+
dummy
58+
}
59+
60+
fragment frag1 on Type2 {
61+
dummy
62+
}
63+
64+
fragment frag3 on Type3 {
65+
dummy1
66+
dummy2
67+
dummy3
68+
}

0 commit comments

Comments
 (0)