Skip to content

Commit 9675f5a

Browse files
authored
Merge branch 'master' into fixes/227-inner-paging
2 parents 953ad66 + cc603c9 commit 9675f5a

File tree

107 files changed

+1692
-1165
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+1692
-1165
lines changed

.github/workflows/dotnetcore.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ jobs:
3131
run: dotnet build Octokit.GraphQL.sln -c ${{ env.config }}
3232

3333
- name: Run Octokit.GraphQL.UnitTests
34-
run: dotnet test -c ${{ env.config }} --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[Octokit.GraphQL]Octokit.GraphQL.*" .\Octokit.GraphQL.UnitTests\Octokit.GraphQL.UnitTests.csproj
34+
run: dotnet test -c ${{ env.config }} --no-build .\Octokit.GraphQL.UnitTests\Octokit.GraphQL.UnitTests.csproj # /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[Octokit.GraphQL]Octokit.GraphQL.*"
3535
- name: Run Octokit.GraphQL.Core.UnitTests
36-
run: dotnet test -c ${{ env.config }} --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[Octokit.GraphQL]Octokit.GraphQL.*" .\Octokit.GraphQL.Core.UnitTests\Octokit.GraphQL.Core.UnitTests.csproj
36+
run: dotnet test -c ${{ env.config }} --no-build .\Octokit.GraphQL.Core.UnitTests\Octokit.GraphQL.Core.UnitTests.csproj # /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[Octokit.GraphQL]Octokit.GraphQL.*"
3737
- name: Run Octokit.GraphQL.Core.Generation.UnitTests
38-
run: dotnet test -c ${{ env.config }} --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[Octokit.GraphQL]Octokit.GraphQL.*" .\Octokit.GraphQL.Core.Generation.UnitTests\Octokit.GraphQL.Core.Generation.UnitTests.csproj
38+
run: dotnet test -c ${{ env.config }} --no-build .\Octokit.GraphQL.Core.Generation.UnitTests\Octokit.GraphQL.Core.Generation.UnitTests.csproj # /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[Octokit.GraphQL]Octokit.GraphQL.*"
3939

4040
- name: Create package using .nuspec
4141
run: dotnet pack Octokit.GraphQL.Pack/Octokit.GraphQL.Pack.csproj --output ${{ env.PackageOutputPath }}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Test Generate Schema
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
schedule:
9+
- cron: "0 0 * * *" # Run at 00:00 UTC everyday
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
18+
- name: Setup .NET Core
19+
uses: actions/setup-dotnet@v1
20+
with:
21+
dotnet-version: 3.1.x
22+
23+
- name: Install dependencies
24+
run: dotnet restore
25+
26+
- name: Generate
27+
run: dotnet run --project ./Tools/Generate/Generate.csproj -- ${{ github.token }} ./Octokit.GraphQL/
28+
29+
- name: Build
30+
run: dotnet build

CODE_OF_CONDUCT.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, gender identity and expression, level of experience,
9+
nationality, personal appearance, race, religion, or sexual identity and
10+
orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
- Using welcoming and inclusive language
18+
- Being respectful of differing viewpoints and experiences
19+
- Gracefully accepting constructive criticism
20+
- Focusing on what is best for the community
21+
- Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
- The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
- Trolling, insulting/derogatory comments, and personal or political attacks
28+
- Public or private harassment
29+
- Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
- Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at [email protected].. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at [https://contributor-covenant.org/version/1/4][version]
72+
73+
[homepage]: https://contributor-covenant.org
74+
[version]: https://contributor-covenant.org/version/1/4/

Octokit.GraphQL.Core.Generation.UnitTests/Octokit.GraphQL.Core.Generation.UnitTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>netcoreapp2.1</TargetFramework>
3+
<TargetFramework>netcoreapp3.1</TargetFramework>
44
<LangVersion>7.2</LangVersion>
55
</PropertyGroup>
66
<ItemGroup>

Octokit.GraphQL.Core.UnitTests/Octokit.GraphQL.Core.UnitTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>netcoreapp2.1</TargetFramework>
3+
<TargetFramework>netcoreapp3.1</TargetFramework>
44
<LangVersion>7.2</LangVersion>
55
</PropertyGroup>
66
<ItemGroup>

Octokit.GraphQL.Core/Core/Builders/QueryEntityBuilders.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
using System;
2+
using System.Collections;
23
using System.Collections.Generic;
4+
using System.Linq;
35
using System.Linq.Expressions;
46
using System.Reflection;
7+
using Octokit.GraphQL.Core.Utilities;
58

69
namespace Octokit.GraphQL.Core.Builders
710
{
@@ -51,6 +54,26 @@ public static IQueryableValue<TValue> CreateMethodCall<TObject, TValue>(
5154
arguments));
5255
}
5356

57+
public static IEnumerable<TValue> CreateMethodCall<TObject, TValue>(
58+
this TObject o,
59+
Expression<Func<TObject, IEnumerable<TValue>>> selector)
60+
where TObject : IQueryableValue
61+
{
62+
var methodCall = (MethodCallExpression)selector.Body;
63+
var arguments = new List<ConstantExpression>();
64+
65+
foreach (MemberExpression arg in methodCall.Arguments)
66+
{
67+
var expression = (ConstantExpression)arg.Expression;
68+
var value = ((FieldInfo)arg.Member).GetValue(expression.Value);
69+
arguments.Add(Expression.Constant(value, arg.Type));
70+
}
71+
72+
return (IEnumerable<TValue>)(Expression.Call(Expression.Constant(o),
73+
methodCall.Method,
74+
arguments));
75+
}
76+
5477
public static TValue CreateMethodCall<TObject, TValue>(
5578
this TObject o,
5679
Expression<Func<TObject, TValue>> selector,

Octokit.GraphQL.Core/QueryableListExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public static IDictionary<TKey, TElement> ToDictionary<TSource, TKey, TElement>(
7070
[MethodId(nameof(ToListMethod))]
7171
public static List<TValue> ToList<TValue>(this IQueryableList<TValue> source)
7272
{
73-
throw new NotImplementedException();
73+
return source.ToList<TValue>();
7474
}
7575

7676
public static ICompiledQuery<IEnumerable<T>> Compile<T>(this IQueryableList<T> expression)

Octokit.GraphQL.IntegrationTests/Octokit.GraphQL.IntegrationTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>netcoreapp2.1</TargetFramework>
3+
<TargetFramework>netcoreapp3.1</TargetFramework>
44
<AssemblyName>Octokit.GraphQL.IntegrationTests</AssemblyName>
55
<LangVersion>7.2</LangVersion>
66
</PropertyGroup>

Octokit.GraphQL.IntegrationTests/Queries/ViewerTests.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,15 @@ public async Task Viewer_By_GraphyQL_Matches_Api()
7878
//PublicGists
7979
//TotalPrivateRepos
8080
}
81+
82+
[IntegrationTest]
83+
public async Task Viewer_Has_No_OrganizationVerifiedDomainEmails_For_Octokit()
84+
{
85+
var query = new GraphQL.Query().Viewer.Select(user => user.OrganizationVerifiedDomainEmails("octokit").ToList());
86+
87+
var emails = await Connection.Run(query);
88+
89+
Assert.Empty(emails);
90+
}
8191
}
82-
}
92+
}

Octokit.GraphQL.UnitTests/Octokit.GraphQL.UnitTests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>netcoreapp2.1</TargetFramework>
3+
<TargetFramework>netcoreapp3.1</TargetFramework>
44
<LangVersion>7.2</LangVersion>
55
</PropertyGroup>
66
<ItemGroup>

0 commit comments

Comments
 (0)