Skip to content

Commit

Permalink
Made config an optional parameter
Browse files Browse the repository at this point in the history
Removed  unnecessary internal modifiers
  • Loading branch information
Michannne committed Apr 30, 2019
1 parent 65150fc commit a67961f
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 14 deletions.
2 changes: 1 addition & 1 deletion GraphQL-Core/CSharpClassBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace GraphQLCore
/// <summary>
/// Responsible for dynamically creating C# classes to wrap instances of GenericType{T}
/// </summary>
internal static class GraphQLCoreTypeWrapperGenerator
public static class GraphQLCoreTypeWrapperGenerator
{
internal static AssemblyBuilder asmBuilder = AssemblyBuilder.DefineDynamicAssembly(CreateDynamicAssemblyName(), AssemblyBuilderAccess.Run);
internal static ModuleBuilder mdBuilder = null;
Expand Down
2 changes: 1 addition & 1 deletion GraphQL-Core/Extensions/GraphQLExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace GraphQLCore.Extensions
/// <summary>
/// Contains extension methods for GraphQLCore
/// </summary>
internal static class GraphQLExtensions
public static class GraphQLExtensions
{
/// <summary>
/// Given a C# Type instance that represents a value type, enumeration, or class, returns the appropriate GraphQL.NET Type
Expand Down
2 changes: 1 addition & 1 deletion GraphQL-Core/Extensions/ReflectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace GraphQLCore.Extensions
/// <summary>
/// Extensions necessary when performing reflection-based logic in GraphQLCore
/// </summary>
internal static class ReflectionExtensions
public static class ReflectionExtensions
{
/// <summary>
/// Detects whether a given type, <paramref name="t"/>, implements the given interface, <paramref name="i"/>
Expand Down
2 changes: 1 addition & 1 deletion GraphQL-Core/GraphQLBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public class GraphQLBuilder : IGraphQLBuilder
/// <summary>
/// Defaulted to null
/// </summary>
internal StitchedQuery Schema { get; set; }
public StitchedQuery Schema { get; set; }

/// <summary>
/// Defaulted to null
Expand Down
18 changes: 12 additions & 6 deletions GraphQL-Core/GraphQLMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,22 @@ public static class GraphQLMiddleware
/// <param name="services"></param>
/// <param name="config"></param>
/// <returns>An instance of IGraphQLBuilder that can be used to add types, queries, etc.</returns>
public static IGraphQLBuilder AddGraphQL(this IServiceCollection services, Expression<Func<IGraphQLBuilder, IGraphQLBuilder>> config)
public static IGraphQLBuilder AddGraphQL(this IServiceCollection services, Expression<Func<IGraphQLBuilder, IGraphQLBuilder>> config = null)
{
var builder = new GraphQLBuilder(services);

config
.Compile()
(builder)
.Build();
if(config != null)
{
config
.Compile()
(builder)
.Build();

return builder;
return null;
}

else
return builder;
}
}
}
4 changes: 2 additions & 2 deletions GraphQL-Core/Queries/Queries.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public interface IGraphQLGenericQuery { }
/// <summary>
///
/// </summary>
internal class StitchedQuery : ObjectGraphType
public class StitchedQuery : ObjectGraphType
{
/// <summary>
/// List of resolved fields
Expand All @@ -35,7 +35,7 @@ public void Build()
/// A user-defined query that acts as a container until the query is supplied to a StitchedQuery instance
/// </summary>
/// <typeparam name="T">The return type of the query</typeparam>
internal class GenericQuery<T> : ObjectGraphType, IGraphQLGenericQuery
public class GenericQuery<T> : ObjectGraphType, IGraphQLGenericQuery
{
/// <summary>
/// An instance of StitchedQuery that will received the proxy query
Expand Down
2 changes: 1 addition & 1 deletion GraphQL-Core/Resolvers/Resolvers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace GraphQLCore.Resolvers
/// <summary>
/// Interface for a generic field resolver
/// </summary>
internal interface IGenericFieldResolver
public interface IGenericFieldResolver
{
/// <summary>
/// When called, returns an instance of FieldType that can be added to any ObjectGraphType
Expand Down
2 changes: 1 addition & 1 deletion GraphQL-Core/Schemas/Schemas.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ internal interface IGraphQLGenericSchema { }
/// <summary>
/// Schema which will be used to combine all user-provided queries
/// </summary>
internal class SuperSchema : Schema, IGraphQLGenericSchema
public class SuperSchema : Schema, IGraphQLGenericSchema
{
/// <summary>
/// Creates a new GraphQL Schema-node using the provided dependency resolver
Expand Down

0 comments on commit a67961f

Please sign in to comment.