Skip to content

Commit b62be52

Browse files
Merge pull request #186 from octokit/ismutation
Added `IsMutation` to `ICompiledQuery`.
2 parents ed4ab53 + 9f5042c commit b62be52

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

Octokit.GraphQL.Core/Core/PagedQuery.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ public PagedQuery(
3131
Subqueries = subqueries.ToList();
3232
}
3333

34+
/// <summary>
35+
/// Gets a value indicating whether the query is a mutation.
36+
/// </summary>
37+
public bool IsMutation => MasterQuery.IsMutation;
38+
3439
/// <summary>
3540
/// Gets the master query.
3641
/// </summary>

Octokit.GraphQL.Core/Core/SimpleQuery.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ public SimpleQuery(
3636
ResultBuilder = ExpressionCompiler.Compile(resultBuilder);
3737
}
3838

39+
/// <summary>
40+
/// Gets a value indicating whether the query is a mutation.
41+
/// </summary>
42+
public bool IsMutation => OperationDefinition.Type == OperationType.Mutation;
43+
3944
/// <summary>
4045
/// Gets the GraphQL operation definition.
4146
/// </summary>

Octokit.GraphQL.Core/ICompiledQuery.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ namespace Octokit.GraphQL
99
/// </summary>
1010
public interface ICompiledQuery
1111
{
12+
/// <summary>
13+
/// Gets a value indicating whether the query is a mutation.
14+
/// </summary>
15+
bool IsMutation { get; }
16+
1217
/// <summary>
1318
/// Returns an <see cref="IQueryRunner"/> which can be used to run the query on a connection.
1419
/// </summary>

0 commit comments

Comments
 (0)