Skip to content

Commit

Permalink
Merge 49093bd into b07c5ea
Browse files Browse the repository at this point in the history
  • Loading branch information
Shane32 committed Jul 20, 2021
2 parents b07c5ea + 49093bd commit 3058835
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/GraphQL.DI/DIObjectGraphBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace GraphQL.DI
/// used if the <see cref="IResolveFieldContext.Source"/> type is <see cref="object"/>.
/// </summary>
//this class is a placeholder for future support of properties or methods on the base class
public class DIObjectGraphBase<TSource>
public class DIObjectGraphBase<TSource> : IDIObjectGraphBase<TSource>
{
//this would be an ideal spot to put public readonly fields for the resolving query, such as Schema, Metrics, Executor, and so on, rather than being inside the ResolveFieldContext instance.
//this could only contain fields that are not unique to a resolving field (such as Source), so as to not break multithreading support
Expand All @@ -16,7 +16,7 @@ public class DIObjectGraphBase<TSource>
/// This is a required base type of all DI-created graph types. <see cref="DIObjectGraphBase{TSource}"/> may be
/// used when the <see cref="IResolveFieldContext.Source"/> type is not <see cref="object"/>.
/// </summary>
public class DIObjectGraphBase : DIObjectGraphBase<object>
public class DIObjectGraphBase : DIObjectGraphBase<object>, IDIObjectGraphBase<object>
{
}
}
4 changes: 2 additions & 2 deletions src/GraphQL.DI/DIObjectGraphType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ namespace GraphQL.DI
/// Wraps a <see cref="DIObjectGraphBase"/> graph type for use with GraphQL. This class should be registered as a singleton
/// within your dependency injection provider.
/// </summary>
public class DIObjectGraphType<TDIGraph> : DIObjectGraphType<TDIGraph, object> where TDIGraph : DIObjectGraphBase<object> { }
public class DIObjectGraphType<TDIGraph> : DIObjectGraphType<TDIGraph, object> where TDIGraph : IDIObjectGraphBase<object> { }
/// <summary>
/// Wraps a <see cref="DIObjectGraphBase{TSource}"/> graph type for use with GraphQL. This class should be registered as a singleton
/// within your dependency injection provider.
/// </summary>
public class DIObjectGraphType<TDIGraph, TSource> : ObjectGraphType<TSource> where TDIGraph : DIObjectGraphBase<TSource>
public class DIObjectGraphType<TDIGraph, TSource> : ObjectGraphType<TSource> where TDIGraph : IDIObjectGraphBase<TSource>
{
/// <summary>
/// Initializes a new instance, configuring the <see cref="GraphType.Name"/>, <see cref="GraphType.Description"/>,
Expand Down
14 changes: 14 additions & 0 deletions src/GraphQL.DI/IDIObjectGraphBase.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace GraphQL.DI
{
public interface IDIObjectGraphBase
{
}

public interface IDIObjectGraphBase<TSource> : IDIObjectGraphBase
{
}
}

0 comments on commit 3058835

Please sign in to comment.