Skip to content

Commit dd54fc2

Browse files
authored
Merge pull request Michannne#5 from Michannne/micah/fixInternalAndConfig
Made config an optional parameter
2 parents 65150fc + a67961f commit dd54fc2

File tree

8 files changed

+20
-14
lines changed

8 files changed

+20
-14
lines changed

GraphQL-Core/CSharpClassBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace GraphQLCore
1010
/// <summary>
1111
/// Responsible for dynamically creating C# classes to wrap instances of GenericType{T}
1212
/// </summary>
13-
internal static class GraphQLCoreTypeWrapperGenerator
13+
public static class GraphQLCoreTypeWrapperGenerator
1414
{
1515
internal static AssemblyBuilder asmBuilder = AssemblyBuilder.DefineDynamicAssembly(CreateDynamicAssemblyName(), AssemblyBuilderAccess.Run);
1616
internal static ModuleBuilder mdBuilder = null;

GraphQL-Core/Extensions/GraphQLExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace GraphQLCore.Extensions
1010
/// <summary>
1111
/// Contains extension methods for GraphQLCore
1212
/// </summary>
13-
internal static class GraphQLExtensions
13+
public static class GraphQLExtensions
1414
{
1515
/// <summary>
1616
/// Given a C# Type instance that represents a value type, enumeration, or class, returns the appropriate GraphQL.NET Type

GraphQL-Core/Extensions/ReflectionExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace GraphQLCore.Extensions
99
/// <summary>
1010
/// Extensions necessary when performing reflection-based logic in GraphQLCore
1111
/// </summary>
12-
internal static class ReflectionExtensions
12+
public static class ReflectionExtensions
1313
{
1414
/// <summary>
1515
/// Detects whether a given type, <paramref name="t"/>, implements the given interface, <paramref name="i"/>

GraphQL-Core/GraphQLBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public class GraphQLBuilder : IGraphQLBuilder
123123
/// <summary>
124124
/// Defaulted to null
125125
/// </summary>
126-
internal StitchedQuery Schema { get; set; }
126+
public StitchedQuery Schema { get; set; }
127127

128128
/// <summary>
129129
/// Defaulted to null

GraphQL-Core/GraphQLMiddleware.cs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,22 @@ public static class GraphQLMiddleware
1616
/// <param name="services"></param>
1717
/// <param name="config"></param>
1818
/// <returns>An instance of IGraphQLBuilder that can be used to add types, queries, etc.</returns>
19-
public static IGraphQLBuilder AddGraphQL(this IServiceCollection services, Expression<Func<IGraphQLBuilder, IGraphQLBuilder>> config)
19+
public static IGraphQLBuilder AddGraphQL(this IServiceCollection services, Expression<Func<IGraphQLBuilder, IGraphQLBuilder>> config = null)
2020
{
2121
var builder = new GraphQLBuilder(services);
2222

23-
config
24-
.Compile()
25-
(builder)
26-
.Build();
23+
if(config != null)
24+
{
25+
config
26+
.Compile()
27+
(builder)
28+
.Build();
2729

28-
return builder;
30+
return null;
31+
}
32+
33+
else
34+
return builder;
2935
}
3036
}
3137
}

GraphQL-Core/Queries/Queries.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public interface IGraphQLGenericQuery { }
1212
/// <summary>
1313
///
1414
/// </summary>
15-
internal class StitchedQuery : ObjectGraphType
15+
public class StitchedQuery : ObjectGraphType
1616
{
1717
/// <summary>
1818
/// List of resolved fields
@@ -35,7 +35,7 @@ public void Build()
3535
/// A user-defined query that acts as a container until the query is supplied to a StitchedQuery instance
3636
/// </summary>
3737
/// <typeparam name="T">The return type of the query</typeparam>
38-
internal class GenericQuery<T> : ObjectGraphType, IGraphQLGenericQuery
38+
public class GenericQuery<T> : ObjectGraphType, IGraphQLGenericQuery
3939
{
4040
/// <summary>
4141
/// An instance of StitchedQuery that will received the proxy query

GraphQL-Core/Resolvers/Resolvers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ namespace GraphQLCore.Resolvers
77
/// <summary>
88
/// Interface for a generic field resolver
99
/// </summary>
10-
internal interface IGenericFieldResolver
10+
public interface IGenericFieldResolver
1111
{
1212
/// <summary>
1313
/// When called, returns an instance of FieldType that can be added to any ObjectGraphType

GraphQL-Core/Schemas/Schemas.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ internal interface IGraphQLGenericSchema { }
1212
/// <summary>
1313
/// Schema which will be used to combine all user-provided queries
1414
/// </summary>
15-
internal class SuperSchema : Schema, IGraphQLGenericSchema
15+
public class SuperSchema : Schema, IGraphQLGenericSchema
1616
{
1717
/// <summary>
1818
/// Creates a new GraphQL Schema-node using the provided dependency resolver

0 commit comments

Comments
 (0)