Skip to content

Commit

Permalink
Fixed compile issues after cherry picking fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelstaib committed Nov 5, 2024
1 parent 03e5fb4 commit b30f0da
Show file tree
Hide file tree
Showing 18 changed files with 744 additions and 495 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,34 +89,11 @@ public async Task Download_GraphQL_Schema_Slicing_Args_Enabled(string path)
// assert
Assert.Equal(HttpStatusCode.OK, response.StatusCode);

#if NET7_0_OR_GREATER
response.MatchMarkdownSnapshot();
}

[Theory]
[InlineData("/graphql?sdl")]
[InlineData("/graphql/schema/")]
[InlineData("/graphql/schema.graphql")]
[InlineData("/graphql/schema")]
public async Task Download_GraphQL_Schema_Slicing_Args_Enabled(string path)
{
// arrange
var server = CreateStarWarsServer(
configureServices: sp =>
sp
.RemoveAll<ITimeProvider>()
.AddSingleton<ITimeProvider, StaticTimeProvider>()
.AddGraphQL()
.ModifyPagingOptions(o => o.RequirePagingBoundaries = true));
var url = TestServerExtensions.CreateUrl(path);
var request = new HttpRequestMessage(HttpMethod.Get, url);

// act
var response = await server.CreateClient().SendAsync(request);

// assert
Assert.Equal(HttpStatusCode.OK, response.StatusCode);

response.MatchMarkdownSnapshot();
#else
response.MatchMarkdownSnapshot("NET6");
#endif
}

[Theory]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
# Download_GraphQL_Schema_Slicing_Args_Enabled

```text
Headers:
ETag: "1-kBEjhe2t+jfqbeZRxnezu0WDQFYAc0qzjLF1RlHs428="
Cache-Control: public, must-revalidate, max-age=3600
Content-Type: application/graphql; charset=utf-8
Content-Disposition: attachment; filename="schema.graphql"
Last-Modified: Fri, 01 Jan 2021 00:00:00 GMT
Content-Length: 5070
-------------------------->
Status Code: OK
-------------------------->
schema {
query: Query
mutation: Mutation
subscription: Subscription
}
interface Character {
id: ID!
name: String!
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
appearsIn: [Episode]
traits: JSON
height(unit: Unit): Float
}
type Droid implements Character {
id: ID!
name: String!
appearsIn: [Episode]
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
height(unit: Unit): Float
primaryFunction: String
traits: JSON
}
"A connection to a list of items."
type FriendsConnection {
"Information to aid in pagination."
pageInfo: PageInfo!
"A list of edges."
edges: [FriendsEdge!]
"A flattened list of the nodes."
nodes: [Character]
}
"An edge in a connection."
type FriendsEdge {
"A cursor for use in pagination."
cursor: String!
"The item at the end of the edge."
node: Character
}
type Human implements Character {
id: ID!
name: String!
appearsIn: [Episode]
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
otherHuman: Human
height(unit: Unit): Float
homePlanet: String
traits: JSON
}
type Mutation {
createReview(episode: Episode! review: ReviewInput!): Review!
complete(episode: Episode!): Boolean!
}
"Information about pagination in a connection."
type PageInfo {
"Indicates whether more edges exist following the set defined by the clients arguments."
hasNextPage: Boolean!
"Indicates whether more edges exist prior the set defined by the clients arguments."
hasPreviousPage: Boolean!
"When paginating backwards, the cursor to continue."
startCursor: String
"When paginating forwards, the cursor to continue."
endCursor: String
}
type Query {
hero(episode: Episode! = NEW_HOPE): Character
heroByTraits(traits: JSON!): Character
heroes(episodes: [Episode!]!): [Character!]
character(characterIds: [String!]!): [Character!]!
search(text: String!): [SearchResult]
human(id: String!): Human
droid(id: String!): Droid
time: Long!
evict: Boolean!
wait(m: Int!): Boolean!
someDeprecatedField(deprecatedArg: String! = "foo" @deprecated(reason: "use something else")): String! @deprecated(reason: "use something else")
}
type Review {
commentary: String
stars: Int!
}
type Starship {
id: ID!
name: String!
length(unit: Unit): Float!
}
type Subscription {
onReview(episode: Episode!): Review!
onNext: String!
onException: String!
delay(delay: Int! count: Int!): String!
}
union SearchResult = Starship | Human | Droid
input ReviewInput {
stars: Int!
commentary: String
}
enum Episode {
NEW_HOPE
EMPIRE
JEDI
}
enum Unit {
FOOT
METERS
}
"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`."
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
"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`."
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
scalar JSON
"The `Long` scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1."
scalar Long
```
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public unsafe NodeId Parse(string formattedId, INodeIdRuntimeTypeLookup runtimeT
}
}

Base64.DecodeFromUtf8InPlace(span, out var written);
var status = Base64.DecodeFromUtf8InPlace(span, out var written);
span = span.Slice(0, written);

var delimiterIndex = FindDelimiterIndex(span);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ public async Task FetchMultipleNodesDataLoader()
await ExpectValid(
"""
{
a: node(id: "RW50aXR5OjE==") { ... on Entity { id } }
b: node(id: "RW50aXR5OjI==") { ... on Entity { id } }
a: node(id: "RW50aXR5OjE=") { ... on Entity { id } }
b: node(id: "RW50aXR5OjI=") { ... on Entity { id } }
}
""",
configure: b => b
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static int GetTest([LocalState("Test")] int test)
}
}

internal class Test;
internal class Test { }
""").MatchMarkdownAsync();
}

Expand All @@ -44,7 +44,7 @@ public static int GetTest([ScopedState("Test")] int test)
}
}

internal class Test;
internal class Test { }
""").MatchMarkdownAsync();
}

Expand All @@ -67,7 +67,7 @@ public static int GetTest([GlobalState("Test")] int test)
}
}

internal class Test;
internal class Test { }
""").MatchMarkdownAsync();
}

Expand All @@ -91,7 +91,7 @@ public static int GetTest([LocalState] SetState<int> test)
}
}

internal class Test;
internal class Test { }
""").MatchMarkdownAsync();
}

Expand All @@ -115,7 +115,7 @@ public static int GetTest([ScopedState] SetState<int> test)
}
}

internal class Test;
internal class Test { }
""").MatchMarkdownAsync();
}

Expand All @@ -139,7 +139,7 @@ public static int GetTest([GlobalState] SetState<int> test)
}
}

internal class Test;
internal class Test { }
""").MatchMarkdownAsync();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,26 +94,3 @@ namespace Microsoft.Extensions.DependencyInjection

```

## Compilation Diagnostics

```json
[
{
"Id": "GD0002",
"Title": "Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.",
"Severity": "Error",
"WarningLevel": 0,
"Location": ": (15,8)-(15,47)",
"HelpLinkUri": "https://msdn.microsoft.com/query/roslyn.query?appId=roslyn&k=k(CS9204)",
"MessageFormat": "'{0}' is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.",
"Message": "'GreenDonut.Predicates.IPredicateBuilder' is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.",
"Category": "Compiler",
"CustomTags": [
"Compiler",
"Telemetry",
"CustomObsolete"
]
}
]
```

Loading

0 comments on commit b30f0da

Please sign in to comment.