Skip to content

Commit 83d6472

Browse files
Bump demo projects to NET9 (#90)
1 parent 2e13ef7 commit 83d6472

File tree

23 files changed

+435
-16
lines changed

23 files changed

+435
-16
lines changed

Authorization/Authorization.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<RootNamespace>GraphQL.AspNet.Examples.Authorization</RootNamespace>
66
</PropertyGroup>
77

Authorization/graphiql.html

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<!--
2+
* Copyright (c) 2021 GraphQL Contributors
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
-->
8+
<!DOCTYPE html>
9+
<html>
10+
<head>
11+
<style>
12+
body {
13+
height: 100%;
14+
margin: 0;
15+
width: 100%;
16+
overflow: hidden;
17+
}
18+
19+
#graphiql {
20+
height: 100vh;
21+
}
22+
</style>
23+
24+
<!--
25+
This GraphiQL example depends on Promise and fetch, which are available in
26+
modern browsers, but can be "polyfilled" for older browsers.
27+
GraphiQL itself depends on React DOM.
28+
If you do not want to rely on a CDN, you can host these files locally or
29+
include them directly in your favored resource bundler.
30+
-->
31+
<script
32+
crossorigin
33+
src="https://unpkg.com/react@17/umd/react.development.js"
34+
></script>
35+
<script
36+
crossorigin
37+
src="https://unpkg.com/react-dom@17/umd/react-dom.development.js"
38+
></script>
39+
40+
<!--
41+
These two files can be found in the npm module, however you may wish to
42+
copy them directly into your environment, or perhaps include them in your
43+
favored resource bundler.
44+
-->
45+
<link rel="stylesheet" href="https://unpkg.com/graphiql/graphiql.min.css" />
46+
</head>
47+
48+
<body>
49+
<div id="graphiql">Loading...</div>
50+
<script
51+
src="https://unpkg.com/graphiql/graphiql.min.js"
52+
type="application/javascript"
53+
></script>
54+
<script>
55+
ReactDOM.render(
56+
React.createElement(GraphiQL, {
57+
fetcher: GraphiQL.createFetcher({
58+
url: 'http://localhost:5000/graphql',
59+
subscriptionUrl: 'ws://localhost:5000/graphql'
60+
}),
61+
defaultEditorToolsVisibility: true,
62+
}),
63+
document.getElementById('graphiql'),
64+
);
65+
</script>
66+
</body>
67+
</html>

Custom-Directives/Custom-Directives.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<RootNamespace>GraphQL.AspNet.Examples.CustomDirectives</RootNamespace>
66
</PropertyGroup>
77

Custom-Directives/graphiql.html

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<!--
2+
* Copyright (c) 2021 GraphQL Contributors
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
-->
8+
<!DOCTYPE html>
9+
<html>
10+
<head>
11+
<style>
12+
body {
13+
height: 100%;
14+
margin: 0;
15+
width: 100%;
16+
overflow: hidden;
17+
}
18+
19+
#graphiql {
20+
height: 100vh;
21+
}
22+
</style>
23+
24+
<!--
25+
This GraphiQL example depends on Promise and fetch, which are available in
26+
modern browsers, but can be "polyfilled" for older browsers.
27+
GraphiQL itself depends on React DOM.
28+
If you do not want to rely on a CDN, you can host these files locally or
29+
include them directly in your favored resource bundler.
30+
-->
31+
<script
32+
crossorigin
33+
src="https://unpkg.com/react@17/umd/react.development.js"
34+
></script>
35+
<script
36+
crossorigin
37+
src="https://unpkg.com/react-dom@17/umd/react-dom.development.js"
38+
></script>
39+
40+
<!--
41+
These two files can be found in the npm module, however you may wish to
42+
copy them directly into your environment, or perhaps include them in your
43+
favored resource bundler.
44+
-->
45+
<link rel="stylesheet" href="https://unpkg.com/graphiql/graphiql.min.css" />
46+
</head>
47+
48+
<body>
49+
<div id="graphiql">Loading...</div>
50+
<script
51+
src="https://unpkg.com/graphiql/graphiql.min.js"
52+
type="application/javascript"
53+
></script>
54+
<script>
55+
ReactDOM.render(
56+
React.createElement(GraphiQL, {
57+
fetcher: GraphiQL.createFetcher({
58+
url: 'http://localhost:5000/graphql',
59+
subscriptionUrl: 'ws://localhost:5000/graphql'
60+
}),
61+
defaultEditorToolsVisibility: true,
62+
}),
63+
document.getElementById('graphiql'),
64+
);
65+
</script>
66+
</body>
67+
</html>

Custom-HttpProcessor/Custom-HttpProcessor.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<RootNamespace>GraphQL.AspNet.Examples.CustomHttpProcessor</RootNamespace>
66
</PropertyGroup>
77

Custom-HttpProcessor/graphiql.html

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<!--
2+
* Copyright (c) 2021 GraphQL Contributors
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
-->
8+
<!DOCTYPE html>
9+
<html>
10+
<head>
11+
<style>
12+
body {
13+
height: 100%;
14+
margin: 0;
15+
width: 100%;
16+
overflow: hidden;
17+
}
18+
19+
#graphiql {
20+
height: 100vh;
21+
}
22+
</style>
23+
24+
<!--
25+
This GraphiQL example depends on Promise and fetch, which are available in
26+
modern browsers, but can be "polyfilled" for older browsers.
27+
GraphiQL itself depends on React DOM.
28+
If you do not want to rely on a CDN, you can host these files locally or
29+
include them directly in your favored resource bundler.
30+
-->
31+
<script
32+
crossorigin
33+
src="https://unpkg.com/react@17/umd/react.development.js"
34+
></script>
35+
<script
36+
crossorigin
37+
src="https://unpkg.com/react-dom@17/umd/react-dom.development.js"
38+
></script>
39+
40+
<!--
41+
These two files can be found in the npm module, however you may wish to
42+
copy them directly into your environment, or perhaps include them in your
43+
favored resource bundler.
44+
-->
45+
<link rel="stylesheet" href="https://unpkg.com/graphiql/graphiql.min.css" />
46+
</head>
47+
48+
<body>
49+
<div id="graphiql">Loading...</div>
50+
<script
51+
src="https://unpkg.com/graphiql/graphiql.min.js"
52+
type="application/javascript"
53+
></script>
54+
<script>
55+
ReactDOM.render(
56+
React.createElement(GraphiQL, {
57+
fetcher: GraphiQL.createFetcher({
58+
url: 'http://localhost:5000/graphql',
59+
subscriptionUrl: 'ws://localhost:5000/graphql'
60+
}),
61+
defaultEditorToolsVisibility: true,
62+
}),
63+
document.getElementById('graphiql'),
64+
);
65+
</script>
66+
</body>
67+
</html>

File-Uploads/graphiql.html

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<!--
2+
* Copyright (c) 2021 GraphQL Contributors
3+
* All rights reserved.
4+
*
5+
* This source code is licensed under the license found in the
6+
* LICENSE file in the root directory of this source tree.
7+
-->
8+
<!DOCTYPE html>
9+
<html>
10+
<head>
11+
<style>
12+
body {
13+
height: 100%;
14+
margin: 0;
15+
width: 100%;
16+
overflow: hidden;
17+
}
18+
19+
#graphiql {
20+
height: 100vh;
21+
}
22+
</style>
23+
24+
<!--
25+
This GraphiQL example depends on Promise and fetch, which are available in
26+
modern browsers, but can be "polyfilled" for older browsers.
27+
GraphiQL itself depends on React DOM.
28+
If you do not want to rely on a CDN, you can host these files locally or
29+
include them directly in your favored resource bundler.
30+
-->
31+
<script
32+
crossorigin
33+
src="https://unpkg.com/react@17/umd/react.development.js"
34+
></script>
35+
<script
36+
crossorigin
37+
src="https://unpkg.com/react-dom@17/umd/react-dom.development.js"
38+
></script>
39+
40+
<!--
41+
These two files can be found in the npm module, however you may wish to
42+
copy them directly into your environment, or perhaps include them in your
43+
favored resource bundler.
44+
-->
45+
<link rel="stylesheet" href="https://unpkg.com/graphiql/graphiql.min.css" />
46+
</head>
47+
48+
<body>
49+
<div id="graphiql">Loading...</div>
50+
<script
51+
src="https://unpkg.com/graphiql/graphiql.min.js"
52+
type="application/javascript"
53+
></script>
54+
<script>
55+
ReactDOM.render(
56+
React.createElement(GraphiQL, {
57+
fetcher: GraphiQL.createFetcher({
58+
url: 'http://localhost:5000/graphql',
59+
subscriptionUrl: 'ws://localhost:5000/graphql'
60+
}),
61+
defaultEditorToolsVisibility: true,
62+
}),
63+
document.getElementById('graphiql'),
64+
);
65+
</script>
66+
</body>
67+
</html>

File-Uploads/src/FileUploads.API/FileUploads.API.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<RootNamespace>GraphQL.Aspnet.Examples.MultipartRequest.API</RootNamespace>
66
</PropertyGroup>
77

File-Uploads/src/FileUploads.UI/FileUploads.UI.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
66
<TypeScriptToolsVersion>Latest</TypeScriptToolsVersion>
77
<IsPackable>false</IsPackable>

Firebase-Authentication/firebase-authentication/Startup.cs

+17
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ namespace Firebase.AuthTest
1111

1212
public class Startup
1313
{
14+
private const string ALL_ORIGINS_POLICY = "_allOrigins";
15+
1416
public Startup(IConfiguration configuration)
1517
{
1618
Configuration = configuration;
@@ -21,6 +23,20 @@ public Startup(IConfiguration configuration)
2123
// This method gets called by the runtime. Use this method to add services to the container.
2224
public void ConfigureServices(IServiceCollection services)
2325
{
26+
// to allow use on many of the tools for testing (graphiql, altair etc.)
27+
// Do not do this in production
28+
services.AddCors(options =>
29+
{
30+
options.AddPolicy(
31+
ALL_ORIGINS_POLICY,
32+
builder =>
33+
{
34+
builder.AllowAnyOrigin()
35+
.AllowAnyHeader()
36+
.AllowAnyMethod();
37+
});
38+
});
39+
2440
var firebaseProjectId = this.Configuration.GetValue<string>("firebaseProjectId");
2541
if (string.IsNullOrWhiteSpace(firebaseProjectId))
2642
throw new ArgumentException("Firebase Project Id must be set.", nameof(firebaseProjectId));
@@ -54,6 +70,7 @@ public void ConfigureServices(IServiceCollection services)
5470
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
5571
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
5672
{
73+
app.UseCors(ALL_ORIGINS_POLICY);
5774
app.UseRouting();
5875

5976
// make sure to call Authentication and Authorization before GraphQL

Firebase-Authentication/firebase-authentication/firebase-authentication.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<RootNamespace>Firebase.AuthTest</RootNamespace>
66
</PropertyGroup>
77

0 commit comments

Comments
 (0)