Skip to content

Commit b30f0da

Browse files
committed
Fixed compile issues after cherry picking fixes.
1 parent 03e5fb4 commit b30f0da

18 files changed

+744
-495
lines changed

src/HotChocolate/AspNetCore/test/AspNetCore.Tests/HttpGetSchemaMiddlewareTests.cs

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -89,34 +89,11 @@ public async Task Download_GraphQL_Schema_Slicing_Args_Enabled(string path)
8989
// assert
9090
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
9191

92+
#if NET7_0_OR_GREATER
9293
response.MatchMarkdownSnapshot();
93-
}
94-
95-
[Theory]
96-
[InlineData("/graphql?sdl")]
97-
[InlineData("/graphql/schema/")]
98-
[InlineData("/graphql/schema.graphql")]
99-
[InlineData("/graphql/schema")]
100-
public async Task Download_GraphQL_Schema_Slicing_Args_Enabled(string path)
101-
{
102-
// arrange
103-
var server = CreateStarWarsServer(
104-
configureServices: sp =>
105-
sp
106-
.RemoveAll<ITimeProvider>()
107-
.AddSingleton<ITimeProvider, StaticTimeProvider>()
108-
.AddGraphQL()
109-
.ModifyPagingOptions(o => o.RequirePagingBoundaries = true));
110-
var url = TestServerExtensions.CreateUrl(path);
111-
var request = new HttpRequestMessage(HttpMethod.Get, url);
112-
113-
// act
114-
var response = await server.CreateClient().SendAsync(request);
115-
116-
// assert
117-
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
118-
119-
response.MatchMarkdownSnapshot();
94+
#else
95+
response.MatchMarkdownSnapshot("NET6");
96+
#endif
12097
}
12198

12299
[Theory]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
# Download_GraphQL_Schema_Slicing_Args_Enabled
2+
3+
```text
4+
Headers:
5+
ETag: "1-kBEjhe2t+jfqbeZRxnezu0WDQFYAc0qzjLF1RlHs428="
6+
Cache-Control: public, must-revalidate, max-age=3600
7+
Content-Type: application/graphql; charset=utf-8
8+
Content-Disposition: attachment; filename="schema.graphql"
9+
Last-Modified: Fri, 01 Jan 2021 00:00:00 GMT
10+
Content-Length: 5070
11+
-------------------------->
12+
Status Code: OK
13+
-------------------------->
14+
schema {
15+
query: Query
16+
mutation: Mutation
17+
subscription: Subscription
18+
}
19+
20+
interface Character {
21+
id: ID!
22+
name: String!
23+
friends("Returns the first _n_ elements from the list." first: Int "Returns the elements in the list that come after the specified cursor." after: String "Returns the last _n_ elements from the list." last: Int "Returns the elements in the list that come before the specified cursor." before: String): FriendsConnection
24+
appearsIn: [Episode]
25+
traits: JSON
26+
height(unit: Unit): Float
27+
}
28+
29+
type Droid implements Character {
30+
id: ID!
31+
name: String!
32+
appearsIn: [Episode]
33+
friends("Returns the first _n_ elements from the list." first: Int "Returns the elements in the list that come after the specified cursor." after: String "Returns the last _n_ elements from the list." last: Int "Returns the elements in the list that come before the specified cursor." before: String): FriendsConnection
34+
height(unit: Unit): Float
35+
primaryFunction: String
36+
traits: JSON
37+
}
38+
39+
"A connection to a list of items."
40+
type FriendsConnection {
41+
"Information to aid in pagination."
42+
pageInfo: PageInfo!
43+
"A list of edges."
44+
edges: [FriendsEdge!]
45+
"A flattened list of the nodes."
46+
nodes: [Character]
47+
}
48+
49+
"An edge in a connection."
50+
type FriendsEdge {
51+
"A cursor for use in pagination."
52+
cursor: String!
53+
"The item at the end of the edge."
54+
node: Character
55+
}
56+
57+
type Human implements Character {
58+
id: ID!
59+
name: String!
60+
appearsIn: [Episode]
61+
friends("Returns the first _n_ elements from the list." first: Int "Returns the elements in the list that come after the specified cursor." after: String "Returns the last _n_ elements from the list." last: Int "Returns the elements in the list that come before the specified cursor." before: String): FriendsConnection
62+
otherHuman: Human
63+
height(unit: Unit): Float
64+
homePlanet: String
65+
traits: JSON
66+
}
67+
68+
type Mutation {
69+
createReview(episode: Episode! review: ReviewInput!): Review!
70+
complete(episode: Episode!): Boolean!
71+
}
72+
73+
"Information about pagination in a connection."
74+
type PageInfo {
75+
"Indicates whether more edges exist following the set defined by the clients arguments."
76+
hasNextPage: Boolean!
77+
"Indicates whether more edges exist prior the set defined by the clients arguments."
78+
hasPreviousPage: Boolean!
79+
"When paginating backwards, the cursor to continue."
80+
startCursor: String
81+
"When paginating forwards, the cursor to continue."
82+
endCursor: String
83+
}
84+
85+
type Query {
86+
hero(episode: Episode! = NEW_HOPE): Character
87+
heroByTraits(traits: JSON!): Character
88+
heroes(episodes: [Episode!]!): [Character!]
89+
character(characterIds: [String!]!): [Character!]!
90+
search(text: String!): [SearchResult]
91+
human(id: String!): Human
92+
droid(id: String!): Droid
93+
time: Long!
94+
evict: Boolean!
95+
wait(m: Int!): Boolean!
96+
someDeprecatedField(deprecatedArg: String! = "foo" @deprecated(reason: "use something else")): String! @deprecated(reason: "use something else")
97+
}
98+
99+
type Review {
100+
commentary: String
101+
stars: Int!
102+
}
103+
104+
type Starship {
105+
id: ID!
106+
name: String!
107+
length(unit: Unit): Float!
108+
}
109+
110+
type Subscription {
111+
onReview(episode: Episode!): Review!
112+
onNext: String!
113+
onException: String!
114+
delay(delay: Int! count: Int!): String!
115+
}
116+
117+
union SearchResult = Starship | Human | Droid
118+
119+
input ReviewInput {
120+
stars: Int!
121+
commentary: String
122+
}
123+
124+
enum Episode {
125+
NEW_HOPE
126+
EMPIRE
127+
JEDI
128+
}
129+
130+
enum Unit {
131+
FOOT
132+
METERS
133+
}
134+
135+
"The `@defer` directive may be provided for fragment spreads and inline fragments to inform the executor to delay the execution of the current fragment to indicate deprioritization of the current fragment. A query with `@defer` directive will cause the request to potentially return multiple responses, where non-deferred data is delivered in the initial response and data deferred is delivered in a subsequent response. `@include` and `@skip` take precedence over `@defer`."
136+
directive @defer("If this argument label has a value other than null, it will be passed on to the result of this defer directive. This label is intended to give client applications a way to identify to which fragment a deferred result belongs to." label: String "Deferred when true." if: Boolean) on FRAGMENT_SPREAD | INLINE_FRAGMENT
137+
138+
"The `@stream` directive may be provided for a field of `List` type so that the backend can leverage technology such as asynchronous iterators to provide a partial list in the initial response, and additional list items in subsequent responses. `@include` and `@skip` take precedence over `@stream`."
139+
directive @stream("If this argument label has a value other than null, it will be passed on to the result of this stream directive. This label is intended to give client applications a way to identify to which fragment a streamed result belongs to." label: String "The initial elements that shall be send down to the consumer." initialCount: Int! = 0 "Streamed when true." if: Boolean) on FIELD
140+
141+
scalar JSON
142+
143+
"The `Long` scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1."
144+
scalar Long
145+
```

src/HotChocolate/Core/src/Types/Types/Relay/Serialization/OptimizedNodeIdSerializer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public unsafe NodeId Parse(string formattedId, INodeIdRuntimeTypeLookup runtimeT
118118
}
119119
}
120120

121-
Base64.DecodeFromUtf8InPlace(span, out var written);
121+
var status = Base64.DecodeFromUtf8InPlace(span, out var written);
122122
span = span.Slice(0, written);
123123

124124
var delimiterIndex = FindDelimiterIndex(span);

src/HotChocolate/Core/test/Execution.Tests/Integration/DataLoader/DataLoaderTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ public async Task FetchMultipleNodesDataLoader()
6767
await ExpectValid(
6868
"""
6969
{
70-
a: node(id: "RW50aXR5OjE==") { ... on Entity { id } }
71-
b: node(id: "RW50aXR5OjI==") { ... on Entity { id } }
70+
a: node(id: "RW50aXR5OjE=") { ... on Entity { id } }
71+
b: node(id: "RW50aXR5OjI=") { ... on Entity { id } }
7272
}
7373
""",
7474
configure: b => b

src/HotChocolate/Core/test/Types.Analyzers.Tests/ResolverTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public static int GetTest([LocalState("Test")] int test)
2121
}
2222
}
2323
24-
internal class Test;
24+
internal class Test { }
2525
""").MatchMarkdownAsync();
2626
}
2727

@@ -44,7 +44,7 @@ public static int GetTest([ScopedState("Test")] int test)
4444
}
4545
}
4646
47-
internal class Test;
47+
internal class Test { }
4848
""").MatchMarkdownAsync();
4949
}
5050

@@ -67,7 +67,7 @@ public static int GetTest([GlobalState("Test")] int test)
6767
}
6868
}
6969
70-
internal class Test;
70+
internal class Test { }
7171
""").MatchMarkdownAsync();
7272
}
7373

@@ -91,7 +91,7 @@ public static int GetTest([LocalState] SetState<int> test)
9191
}
9292
}
9393
94-
internal class Test;
94+
internal class Test { }
9595
""").MatchMarkdownAsync();
9696
}
9797

@@ -115,7 +115,7 @@ public static int GetTest([ScopedState] SetState<int> test)
115115
}
116116
}
117117
118-
internal class Test;
118+
internal class Test { }
119119
""").MatchMarkdownAsync();
120120
}
121121

@@ -139,7 +139,7 @@ public static int GetTest([GlobalState] SetState<int> test)
139139
}
140140
}
141141
142-
internal class Test;
142+
internal class Test { }
143143
""").MatchMarkdownAsync();
144144
}
145145
}

src/HotChocolate/Core/test/Types.Analyzers.Tests/__snapshots__/DataLoaderTests.Generate_Without_Interface.md

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -94,26 +94,3 @@ namespace Microsoft.Extensions.DependencyInjection
9494

9595
```
9696

97-
## Compilation Diagnostics
98-
99-
```json
100-
[
101-
{
102-
"Id": "GD0002",
103-
"Title": "Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.",
104-
"Severity": "Error",
105-
"WarningLevel": 0,
106-
"Location": ": (15,8)-(15,47)",
107-
"HelpLinkUri": "https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS9204)",
108-
"MessageFormat": "'{0}' is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.",
109-
"Message": "'GreenDonut.Predicates.IPredicateBuilder' is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.",
110-
"Category": "Compiler",
111-
"CustomTags": [
112-
"Compiler",
113-
"Telemetry",
114-
"CustomObsolete"
115-
]
116-
}
117-
]
118-
```
119-

0 commit comments

Comments
 (0)